Worked on web frontend for project versions list

This commit is contained in:
Tim Shannon 2016-04-17 21:14:04 -05:00
parent d117c3e664
commit 5f26454adf
4 changed files with 19 additions and 8 deletions

View File

@ -223,12 +223,12 @@ func (p *Project) release() {
p.setStage(stageReleased) p.setStage(stageReleased)
if p.errHandled(p.ds.AddLog(p.version, p.stage, if p.errHandled(p.ds.AddLog(p.version, p.stage,
fmt.Sprintf("Project: %s Version %s built, tested, and released successfully.\n", p.id(), p.version))) { fmt.Sprintf("Project %s Version %s built, tested, and released successfully.\n", p.id(), p.version))) {
return return
} }
//build successfull, remove working dir //build successfull, remove working dir
p.errHandled(os.RemoveAll(p.workingDir())) p.errHandled(os.RemoveAll(p.workingDir()))
vlog("Project: %s Version %s built, tested, and released successfully.\n", p.id(), p.version) vlog("Project %s Version %s built, tested, and released successfully.\n", p.id(), p.version)
} }

View File

@ -86,7 +86,6 @@ func (ds *Store) Versions() ([]*Log, error) {
// capture the newest entry for each version // capture the newest entry for each version
if l.Version != current { if l.Version != current {
l.Log = "" // only care about date, ver and stage
vers = append(vers, l) vers = append(vers, l)
current = l.Version current = l.Version
} }

View File

@ -134,6 +134,7 @@
<th>Status</th> <th>Status</th>
<th>Stage</th> <th>Stage</th>
<th>Last Release</th> <th>Last Release</th>
<th>Last Release File</th>
<th>Last Version</th> <th>Last Version</th>
<th>Last Log</th> <th>Last Log</th>
</tr> </tr>
@ -144,8 +145,15 @@
<td><a href="/project/{{.id}}/">{{.name}}</a></td> <td><a href="/project/{{.id}}/">{{.name}}</a></td>
<td>{{.status}}</td> <td>{{.status}}</td>
<td>{{.stage}}</td> <td>{{.stage}}</td>
<td>{{.releaseVersion}}</td> <td>
<td>{{.lastLog.version}}</td> <a href="/project/{{.id}}/{{.releaseVersion}}">{{.releaseVersion}}</a>
</td>
<td>
<a href="/release/{{.id}}?file">Download</a>
</td>
<td>
<a href="/project/{{.id}}/{{.lastLog.version}}">{{.lastLog.version}}</a>
</td>
<td title="{{.lastLog.log}}">{{#if .lastLog.log}}{{.lastLog.log.substring(0,100) + " ..."}}{{/if}}</td> <td title="{{.lastLog.log}}">{{#if .lastLog.log}}{{.lastLog.log.substring(0,100) + " ..."}}{{/if}}</td>
</tr> </tr>
{{/projects}} {{/projects}}
@ -168,7 +176,9 @@
<tbody> <tbody>
{{#project.versions:i}} {{#project.versions:i}}
<tr> <tr>
<td>{{.version}}</td> <td>
<a href="/project/{{project.id}}/{{.version}}">{{.version}}</a>
</td>
<td>{{.stage}}</td> <td>{{.stage}}</td>
<td title="{{.log}}">{{#if .log}}{{.log.substring(0,100) + " ..."}}{{/if}}</td> <td title="{{.log}}">{{#if .log}}{{.log.substring(0,100) + " ..."}}{{/if}}</td>
<td> <td>

View File

@ -15,6 +15,7 @@ Ractive.DEBUG = false;
return { return {
project: null, project: null,
version: null, version: null,
stages: null,
stage: null, stage: null,
projects: [], projects: [],
error: null, error: null,
@ -43,7 +44,7 @@ Ractive.DEBUG = false;
if (paths[3]) { if (paths[3]) {
getVersion(paths[2], paths[3]); getVersion(paths[2], paths[3]);
if (paths[4]) { if (paths[4]) {
getStage(paths[2], paths[3], paths[4]); getStage(paths[2], paths[3], paths[4]);
} }
} }
} }
@ -80,9 +81,10 @@ Ractive.DEBUG = false;
} }
function getVersion(id, version) { function getVersion(id, version) {
r.set("version", version);
get("/log/" + id + "/" + version, get("/log/" + id + "/" + version,
function(result) { function(result) {
r.set("version", result.data); r.set("stages", result.data);
}, },
function(result) { function(result) {
r.set("error", err(result).message); r.set("error", err(result).message);