diff --git a/r2/r2/public/static/css/wiki.less b/r2/r2/public/static/css/wiki.less index a3fc180ef..ccc43dc1b 100644 --- a/r2/r2/public/static/css/wiki.less +++ b/r2/r2/public/static/css/wiki.less @@ -204,4 +204,11 @@ background-color: #5F99CF; } } + .source { + width: 100%; + display: none; + } + .toggle-source { + float: right; + } } diff --git a/r2/r2/public/static/js/wiki.js b/r2/r2/public/static/js/wiki.js index 0d5c4a841..2c22054b4 100644 --- a/r2/r2/public/static/js/wiki.js +++ b/r2/r2/public/static/js/wiki.js @@ -25,6 +25,12 @@ r.wiki = { init: function() { $('body').delegate('.wiki-page .revision_hide', 'click', this.toggleHide) + $('body').delegate('.wiki-page .toggle-source', 'click', this.toggleSource) + }, + + toggleSource: function(event) { + event.preventDefault() + $('.wiki-page .source').toggle('slow') }, toggleHide: function(event) { diff --git a/r2/r2/templates/wikiview.html b/r2/r2/templates/wikiview.html index 770d1f02b..4d2d8a0a0 100644 --- a/r2/r2/templates/wikiview.html +++ b/r2/r2/templates/wikiview.html @@ -24,6 +24,7 @@ <%! from r2.lib.pages import WrappedUser + from r2.lib.filters import SC_OFF, SC_ON %> %if thing.diff: @@ -37,14 +38,18 @@ %else: ${unsafe(thing.page_content)} %endif + ${unsafe(SC_OFF)} + + ${unsafe(SC_ON)}

+
+ %if thing.edit_date: -
- - %if thing.edit_by: - ${unsafe(_("revision by %s") % WrappedUser(thing.edit_by).render())} - —  - %endif - ${unsafe("%(time)s ago" % dict(time=timestamp(thing.edit_date)))} - + %if thing.edit_by: + ${unsafe(_("revision by %s") % WrappedUser(thing.edit_by).render())} + —  + %endif + ${unsafe("%(time)s ago" % dict(time=timestamp(thing.edit_date)))} %endif +${_("view source")} +