Project

General

Profile

Actions

Feature #2304

closed

special class for directories tr's in directory listing

Added by krdln over 13 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_dirlisting
Target version:
ASK QUESTIONS IN Forums:

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>

Actions #1

Updated by gstrauss over 8 years 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);
Actions #2

Updated by gstrauss over 8 years ago

  • Status changed from Patch Pending to Fixed

committed in c63427c9

Actions

Also available in: Atom