Source

abw / apps / autobuild / templates / builds_view.html

Full commit
{{extend "layout.html"}}

{{block userinfo}}{{end}}

{{block menu}}
{{menu(current_menu)}}
{{end}}

{{block content}}
<div class="container">
{{
table_begin = '''
<table class="table table-striped">
<tbody>
<tr>
<th>board</th><th>branch</th><th>build type</th><th>manifest xml</th><th>file download</th><th>info</th>
</tr>
'''

table_end = '''</tbody>
</table>
'''

from uliweb.utils.textconvert import text2html

c = 1
for d in view_data:
    if len(d["list"])!=0:
        out.write('<li><a href="#time%d">%s(%d)</a></li>'%(c,d["name"],len(d["list"])), escape=False)
        c+=1
    pass
pass
out.write('<br />'*2, escape=False)

c = 1
for d in view_data:
    if len(d["list"])!=0:
        if header_diminish:
            h = c
        else:
            h = 1
        pass
        out.write('<a name="time%d"><h%d>%s(%d)</h%d><hr /></a>'%(c,h,d["name"],len(d["list"]),h), escape=False)
        
        out.write(table_begin, escape=False)
        for f in d["list"]:
            out.write("<tr>", escape=False)
            out.write("<td>%s</td>"%(f["board"]), escape=False)
            out.write("<td>%s</td>"%(f["branch"]), escape=False)
            l = f["btype"].split("_")
            btype = l[0]
            if len(l)>1:
                btype+=" %s"%("_".join(l[1:]))
            pass
            out.write("<td>%s</td>"%(btype), escape=False)
            out.write("<td>%s.xml</td>"%(f["manifest"]), escape=False)
            s = "<td>"
            if f.has_key("title"):
                s+="%s<br />"%(f["title"])
                pass
            for item in f["download"]:
                s+='<a href="/builds_dl/%s">%s</a>(%s) '%(item["path"],item["fn"],item["size"])
                pass
            s += "</td>"
            s += "<td>"
            if f["info"]!=None:
                txt = ""
                for k in f["info"]:
                    txt += "%s:%s\n"%(k,f["info"][k])
                pass
                s += "<strong>"
                s += text2html(txt)
                s += "</strong>"
            pass
            
            s += '<a href="/editinfo/%s?next=%s&vtype=%s&anchor=%s">edit</a>'%(f["title"],request.path,vtype,"time%d"%(c))
            s += "</td>"
            out.write(s,escape=False)
            out.write("</tr>\n", escape=False)
        pass
        out.write(table_end, escape=False)
        out.write("<br />\n", escape=False)
        c+=1
    pass
pass

out.write("<hr />unkown files:<br />", escape=False)

for item in unknown_files:
    out.write("%s<br />"%(item), escape=False)
    pass

out.write("<hr />", escape=False)

out.write(df,escape=False)

}}
</div>
{{end content}}

{{block footer}}{{end}}