Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added links to various pages to make revision comparisons easier.

  • Loading branch information...
commit 9fe84e79e5ebcdf22e2ef3b8a266315bb5f380d3 1 parent 8238961
@vsedach authored
View
1  TODO
@@ -1,6 +1,7 @@
* create article button
* fix BS with clhs-lookup pathnames and Symbol-Table.text
* make sure ASDF-Install still works
+* RSS feed items should include diff of changes
* robots.txt for site/ crawling
* expires headers for images
* table colors and formatting
View
8 src/article.lisp
@@ -121,6 +121,11 @@
(defun link-to-edit (revision text)
#?[<a href="$(#/site/edit-article?title={(title (article revision))}&from-revision={(store-object-id revision)})">${text}</a>])
+(defun current-and-history-buttons (revision)
+ (let ((article (article revision)))
+ #H[<li><a href="${(link-to article)}">Current version</a></li>
+ <li><a href="$(#/site/history?title={(title article)})">History</a></li>]))
+
(defun render-revision (revision &optional (content (revision-content revision)))
(generate-html-from-markup content)
(awhen (content-categories content)
@@ -132,8 +137,7 @@
*footer*
(let ((title (title (article revision))))
(with-output-to-string (*html-stream*)
- #H[<li><a href="${(link-to (article revision))}">Current version</a></li>
- <li><a href="$(#/site/history?title={title})">History</a></li>]
+ (current-and-history-buttons revision)
(unless (youre-banned?)
#H[<li>${(link-to-edit revision "Edit")}</li>]
(when *account*
View
9 src/history.lisp
@@ -5,6 +5,9 @@
(unless (youre-banned?)
#H[<form method="post" action="$(#/site/history-special)">(<input type= "hidden" name="r" value="${(store-object-id revision)}"/><input class="undo" type="submit" name="undo" value="undo" />)</form>]))
+(defun output-compare-link (old new text)
+ #H[(<a class="internal" href="$(#/site/compare-revisions?old={(store-object-id old)}&diff={(store-object-id new)})">${text}</a>)])
+
(defpage /site/history () (title)
(awhen (find-article-any title)
(setf *title* #?'History of article: "${title}"')
@@ -22,7 +25,7 @@
#H[<td><input type="radio" name="${x}" value="${(store-object-id revision)}" /></td>]))
#H[<tr><td>]
(awhen (cadr rhead)
- #H[(<a href="$(#/site/compare-revisions?old={(store-object-id it)}&diff={(store-object-id revision)})">prev</a>)])
+ (output-compare-link it revision "prev"))
#H[</td>]
(radio "old") (radio "diff")
#H[<td>] (pprint-revision-link revision)
@@ -43,7 +46,9 @@
(title (title (article oldr))))
(when (> (date oldr) (date diffr))
(rotatef oldr diffr))
- (setf *title* title)
+ (setf *title* title
+ *footer* (with-output-to-string (*html-stream*)
+ (current-and-history-buttons oldr)))
#H[<h1><a class="internal" href="${(link-to title)}">${title}</a></h1>
<table class="diff">
<colgroup>
View
9 src/recent-changes.lisp
@@ -15,6 +15,9 @@
do (funcall f (car x))
finally (when x (setf (cdr x) nil))))
+(defun find-previous-revision (revision)
+ (cadr (member revision (revisions (article revision)))))
+
(defpage /site/recent-changes "CLiki: Recent Changes" ()
(setf *header* #?[<link rel="alternate" type="application/rss+xml" title="recent changes" href="$(#/site/feed/rss.xml)">])
#H[<h1>Recent Changes</h1>
@@ -23,8 +26,10 @@
(lambda (revision)
#H[<li>] (pprint-revision-link revision)
#H[ <a class="internal" href="${(link-to (article revision))}">${(title (article revision))}</a>
- - ${(summary revision)} ${(format-account-link (author revision))}
- </li>]))
+ - ${(summary revision)} ${(format-account-link (author revision))} ]
+ (awhen (find-previous-revision revision)
+ (output-compare-link it revision "diff"))
+ #H[</li>]))
#H[</ul>])
;;; RSS feed
View
2  static/css/style.css
@@ -226,9 +226,9 @@
padding-top: 15px;
}
+.internal { text-decoration: none; }
#content a { color: #0645ad; }
#content a:visited { color:#1c0080; }
-#content a.internal { text-decoration: none; }
#content a.new { color: #BA0000; text-decoration: none; }
#content a.category { color:#6c6591; text-decoration: none; }
#content a.hyperspec { color: #4040f2;}
Please sign in to comment.
Something went wrong with that request. Please try again.