]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-summary.c
ui-tree: html/css cleanup
[ps-cgit] / ui-summary.c
index e7158cc954d9bb9b1f0edef58cca5894586f3051..4bda4c2f73f8ed98195e5d0c427c6d85a3a9cb05 100644 (file)
@@ -19,6 +19,9 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
 
        strncpy(buf, refname, sizeof(buf));
        commit = lookup_commit(sha1);
+       // object is not really parsed at this point, because of some fallout
+       // from previous calls to git functions in cgit_print_log()
+       commit->object.parsed = 0;
        if (commit && !parse_commit(commit)){
                info = cgit_parse_commit(commit);
                html("<tr><td>");
@@ -28,7 +31,7 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
                html_txt(buf);
                html_link_close();
                html("</td><td>");
-               cgit_print_date(commit->date);
+               cgit_print_age(commit->date, -1, NULL);
                html("</td><td>");
                html_txt(info->author);
                html("</td><td>");
@@ -76,7 +79,7 @@ static void cgit_print_object_ref(struct object *obj)
 static void print_tag_header()
 {
        html("<tr class='nohover'><th class='left'>Tag</th>"
-            "<th class='left'>Created</th>"
+            "<th class='left'>Age</th>"
             "<th class='left'>Author</th>"
             "<th class='left'>Reference</th></tr>\n");
        header = 1;
@@ -108,7 +111,7 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1,
                html_link_close();
                html("</td><td>");
                if (info->tagger_date > 0)
-                       cgit_print_date(info->tagger_date);
+                       cgit_print_age(info->tagger_date, -1, NULL);
                html("</td><td>");
                if (info->tagger)
                        html(info->tagger);
@@ -153,25 +156,25 @@ static int cgit_print_archive_cb(const char *refname, const unsigned char *sha1,
                hashcpy(fileid, sha1);
        }
        if (!header) {
-               html("<table>");
+               html("<table id='downloads'>");
                html("<tr><th>Downloads</th></tr>");
                header = 1;
        }
        html("<tr><td>");
        url = cgit_pageurl(cgit_query_repo, "blob",
-                          fmt("id=%s&path=%s", sha1_to_hex(fileid),
+                          fmt("id=%s&amp;path=%s", sha1_to_hex(fileid),
                               buf));
        html_link_open(url, NULL, NULL);
        html_txt(buf);
        html_link_close();
-       html("</td><tr>");
+       html("</td></tr>");
        return 0;
 }
 
 static void cgit_print_branches()
 {
        html("<tr class='nohover'><th class='left'>Branch</th>"
-            "<th class='left'>Updated</th>"
+            "<th class='left'>Idle</th>"
             "<th class='left'>Author</th>"
             "<th class='left'>Head commit</th></tr>\n");
        for_each_branch_ref(cgit_print_branch_cb, NULL);
@@ -193,16 +196,21 @@ static void cgit_print_archives()
 
 void cgit_print_summary()
 {
-       html("<table class='list nowrap'>");
-       html("<tr class='nohover'><td id='summary' colspan='3'>");
+       html("<div id='summary'>");
+       cgit_print_archives();
        html("<h2>");
        html_txt(cgit_repo->name);
        html(" - ");
        html_txt(cgit_repo->desc);
        html("</h2>");
-       html("</td><td id='archivelist'>");
-       cgit_print_archives();
-       html("</td></tr>");
+       if (cgit_repo->readme)
+               html_include(cgit_repo->readme);
+       html("</div>");
+       if (cgit_summary_log > 0)
+               cgit_print_log(cgit_query_head, 0, cgit_summary_log, NULL, NULL, 0);
+       html("<table class='list nowrap'>");
+       if (cgit_summary_log > 0)
+               html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
        cgit_print_branches();
        html("<tr class='nohover'><td colspan='4'>&nbsp;</td></tr>");
        cgit_print_tags();