diff options
author | Arun Isaac | 2022-07-14 15:54:08 +0530 |
---|---|---|
committer | Arun Isaac | 2022-07-19 17:37:07 +0530 |
commit | 5caa3518d32826a0383b7720905f7b494293071d (patch) | |
tree | 372ca34187a1abf10ddb6b2677f05f33f449cab2 | |
parent | 759ccc92f9b8f9f3c19fab895ca746b8b3a52c18 (diff) | |
download | tissue-5caa3518d32826a0383b7720905f7b494293071d.tar.gz tissue-5caa3518d32826a0383b7720905f7b494293071d.tar.lz tissue-5caa3518d32826a0383b7720905f7b494293071d.zip |
file-document: Show created and last updated dates in listings.
* tissue/file-document.scm (print, document->sxml): Show created and
last updated dates in listings.
* tissue/web/server.scm (%css): Put DOC identifier before metadata,
not before title.
-rw-r--r-- | tissue/file-document.scm | 30 | ||||
-rw-r--r-- | tissue/web/server.scm | 4 |
2 files changed, 32 insertions, 2 deletions
diff --git a/tissue/file-document.scm b/tissue/file-document.scm index 1265660..72d83a2 100644 --- a/tissue/file-document.scm +++ b/tissue/file-document.scm @@ -91,6 +91,25 @@ MSet object representing a list of search results." (display (colorize-string (file-document-path document) 'YELLOW) port) (newline port) + (display (string-append + "created " + (colorize-string (human-date-string + (file-document-created-date document)) + 'CYAN) + " by " + (colorize-string (file-document-creator document) 'CYAN)) + port) + (when (> (length (file-document-commits document)) 1) + (display (string-append (colorize-string "," 'CYAN) + " last updated " + (colorize-string (human-date-string + (file-document-last-updated-date document)) + 'CYAN) + " by " + (colorize-string (file-document-last-updater document) + 'CYAN)) + port)) + (newline port) (let ((snippet (document-snippet document mset))) (unless (string-null? snippet) (display snippet port) @@ -104,6 +123,17 @@ a list of search results." (a (@ (href ,(document-web-uri document)) (class "search-result-title")) ,(document-title document)) + (div (@ (class "search-result-metadata")) + ,(string-append + (format #f "created ~a by ~a" + (human-date-string (file-document-created-date document)) + (file-document-creator document)) + (if (> (length (file-document-commits document)) + 1) + (format #f ", last updated ~a by ~a" + (human-date-string (file-document-last-updated-date document)) + (file-document-last-updater document)) + ""))) ,@(let ((snippet (document-sxml-snippet document mset))) (if snippet (list `(div (@ (class "search-result-snippet")) diff --git a/tissue/web/server.scm b/tissue/web/server.scm index a7cacb7..453b54a 100644 --- a/tissue/web/server.scm +++ b/tissue/web/server.scm @@ -82,7 +82,7 @@ form { text-align: center; } } .search-result-title, .search-result-title:before { vertical-align: middle; } .search-result-commit .search-result-metadata:before, -.search-result-document .search-result-title:before, +.search-result-document .search-result-metadata:before, .search-result-issue .search-result-metadata:before { font-size: xx-small; font-weight: bold; @@ -92,7 +92,7 @@ form { text-align: center; } color: white; } .search-result-commit .search-result-metadata:before { content: \"COMMIT\"; } -.search-result-document .search-result-title:before { content: \"DOC\"; } +.search-result-document .search-result-metadata:before { content: \"DOC\"; } .search-result-open-issue .search-result-metadata:before { content: \"ISSUE\"; background-color: green; |