add html class names to table cells for better css formatting options

pull/86/head
gznyirfa 2018-02-25 13:56:58 +01:00 committed by Adrian Perez
parent 9446fd7e4b
commit 60c4338b96
1 changed files with 10 additions and 10 deletions

View File

@ -772,7 +772,7 @@ make_content_buf(
* <td>size</td><td>date</td> * <td>size</td><td>date</td>
* </tr> * </tr>
*/ */
len += ngx_sizeof_ssz("<tr><td><a href=\"") len += ngx_sizeof_ssz("<tr><td class=\"link\"><a href=\"")
+ entry[i].name.len + entry[i].escape /* Escaped URL */ + entry[i].name.len + entry[i].escape /* Escaped URL */
+ ngx_sizeof_ssz("?C=x&amp;O=y") /* URL sorting arguments */ + ngx_sizeof_ssz("?C=x&amp;O=y") /* URL sorting arguments */
+ ngx_sizeof_ssz("\" title=\"") + ngx_sizeof_ssz("\" title=\"")
@ -780,9 +780,9 @@ make_content_buf(
+ ngx_sizeof_ssz("\">") + ngx_sizeof_ssz("\">")
+ entry[i].name.len + entry[i].utf_len + entry[i].name.len + entry[i].utf_len
+ alcf->name_length + ngx_sizeof_ssz("&gt;") + alcf->name_length + ngx_sizeof_ssz("&gt;")
+ ngx_sizeof_ssz("</a></td><td>") + ngx_sizeof_ssz("</a></td><td class=\"size\">")
+ 20 /* File size */ + 20 /* File size */
+ ngx_sizeof_ssz("</td><td>") /* Date prefix */ + ngx_sizeof_ssz("</td><td class=\"date\">") /* Date prefix */
+ ngx_sizeof_ssz("</td></tr>\n") /* Date suffix */ + ngx_sizeof_ssz("</td></tr>\n") /* Date suffix */
+ 2 /* CR LF */ + 2 /* CR LF */
; ;
@ -904,7 +904,7 @@ make_content_buf(
if (r->uri.len > 1) { if (r->uri.len > 1) {
b->last = ngx_cpymem_ssz(b->last, b->last = ngx_cpymem_ssz(b->last,
"<tr>" "<tr>"
"<td><a href=\"../"); "<td class=\"link\"><a href=\"../");
if (*sort_url_args) { if (*sort_url_args) {
b->last = ngx_cpymem(b->last, b->last = ngx_cpymem(b->last,
sort_url_args, sort_url_args,
@ -912,14 +912,14 @@ make_content_buf(
} }
b->last = ngx_cpymem_ssz(b->last, b->last = ngx_cpymem_ssz(b->last,
"\">Parent directory/</a></td>" "\">Parent directory/</a></td>"
"<td>-</td>" "<td class=\"size\">-</td>"
"<td>-</td>" "<td class=\"date\">-</td>"
"</tr>"); "</tr>");
} }
/* Entries for directories and files */ /* Entries for directories and files */
for (i = 0; i < entries.nelts; i++) { for (i = 0; i < entries.nelts; i++) {
b->last = ngx_cpymem_ssz(b->last, "<tr><td><a href=\""); b->last = ngx_cpymem_ssz(b->last, "<tr><td class=\"link\"><a href=\"");
if (entry[i].escape) { if (entry[i].escape) {
ngx_fancyindex_escape_uri(b->last, ngx_fancyindex_escape_uri(b->last,
@ -967,7 +967,7 @@ make_content_buf(
} }
if (len > alcf->name_length) { if (len > alcf->name_length) {
b->last = ngx_cpymem_ssz(last, "..&gt;</a></td><td>"); b->last = ngx_cpymem_ssz(last, "..&gt;</a></td><td class=\"size\">");
} else { } else {
if (entry[i].dir && alcf->name_length - len > 0) { if (entry[i].dir && alcf->name_length - len > 0) {
@ -975,7 +975,7 @@ make_content_buf(
len++; len++;
} }
b->last = ngx_cpymem_ssz(b->last, "</a></td><td>"); b->last = ngx_cpymem_ssz(b->last, "</a></td><td class=\"size\">");
} }
if (alcf->exact_size) { if (alcf->exact_size) {
@ -1005,7 +1005,7 @@ make_content_buf(
} }
ngx_gmtime(entry[i].mtime + tp->gmtoff * 60 * alcf->localtime, &tm); ngx_gmtime(entry[i].mtime + tp->gmtoff * 60 * alcf->localtime, &tm);
b->last = ngx_cpymem_ssz(b->last, "</td><td>"); b->last = ngx_cpymem_ssz(b->last, "</td><td class=\"date\">");
b->last = ngx_fancyindex_timefmt(b->last, &alcf->time_format, &tm); b->last = ngx_fancyindex_timefmt(b->last, &alcf->time_format, &tm);
b->last = ngx_cpymem_ssz(b->last, "</td></tr>"); b->last = ngx_cpymem_ssz(b->last, "</td></tr>");