Project

General

Profile

Feature #2304

special class for directories tr's in directory listing

Added by krdln almost 7 years ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_dirlisting
Target version:
Start date:
2011-03-17
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:
No

Description

Directories tr's should be easily selected in external css. Now it's almost impossible to add custom styling to change style for table rows that contains directories. I think that easiest way is to add class, eg. "d" for these tr's. It could look like:

<tbody>
 <tr class="d"><td class="n"><a href="../">Parent Directory</a>/</td> ...
 ...
 <tr><td class="n">normal file</td> ...
 ...
</tbody>

Associated revisions

Revision c63427c9 (diff)
Added by gstrauss over 1 year ago

[mod_dirlisting] class for dir <tr> (fixes #2304)

x-ref:
"special class for directories tr's in directory listing"
https://redmine.lighttpd.net/issues/2304

History

#1

Updated by gstrauss over 1 year ago

  • Tracker changed from Bug to Feature
  • Status changed from New to Patch Pending
  • Target version set to 1.4.40
diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c
index 717f4e4..e373463 100644
--- a/src/mod_dirlisting.c
+++ b/src/mod_dirlisting.c
@@ -567,7 +567,7 @@ static void http_list_directory_header(server *srv, connection *con, plugin_data
                "</tr>" 
                "</thead>\n" 
                "<tbody>\n" 
-               "<tr>" 
+               "<tr class=\"d\">" 
                        "<td class=\"n\"><a href=\"../\">Parent Directory</a>/</td>" 
                        "<td class=\"m\">&nbsp;</td>" 
                        "<td class=\"s\">- &nbsp;</td>" 
@@ -801,7 +801,7 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
                strftime(datebuf, sizeof(datebuf), "%Y-%b-%d %H:%M:%S", localtime(&(tmp->mtime)));
 #endif

-               buffer_append_string_len(out, CONST_STR_LEN("<tr><td class=\"n\"><a href=\""));
+               buffer_append_string_len(out, CONST_STR_LEN("<tr class=\"d\"><td class=\"n\"><a href=\""));
                buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_REL_URI_PART);
                buffer_append_string_len(out, CONST_STR_LEN("/\">"));
                buffer_append_string_encoded(out, DIRLIST_ENT_NAME(tmp), tmp->namelen, ENCODING_MINIMAL_XML);
#2

Updated by gstrauss over 1 year ago

  • Status changed from Patch Pending to Fixed

committed in c63427c9

Also available in: Atom