Improved wiki layout for sidebar and version sections

* Added new helper function format_datetime_timespec
This commit is contained in:
sandoz 2009-08-22 18:14:56 +02:00
parent f7e24d26b4
commit 7ec5381ca0
7 changed files with 149 additions and 98 deletions

View File

@ -13,6 +13,10 @@ module ApplicationHelper
I18n.l(time) unless time.nil? I18n.l(time) unless time.nil?
end end
def format_datetime_timespec(time, format)
I18n.l(time, :format => format) unless (time.nil? or format.nil?)
end
# Creates ajax-controlled-links for pagination # Creates ajax-controlled-links for pagination
# see also the plugin "will_paginate" # see also the plugin "will_paginate"
def pagination_links_remote(collection, options = {}) def pagination_links_remote(collection, options = {})

View File

@ -3,7 +3,6 @@
#preview= render :partial => 'body' #preview= render :partial => 'body'
#wiki-syntax-help #wiki-syntax-help
%p
.box_title .box_title
%h2 Schnelle Formatierungshilfe %h2 Schnelle Formatierungshilfe
.column_content .column_content
@ -98,3 +97,5 @@
= f.submit "Speichern" = f.submit "Speichern"
| |
= link_to "Abbrechen", @page = link_to "Abbrechen", @page
%div(style="clear:right; height:1px")

View File

@ -17,7 +17,12 @@
#page-versions #page-versions
= link_to "Bearbeiten", edit_page_path(@page) = link_to "Bearbeiten", edit_page_path(@page)
= link_to_function "Versionen (#{@page.versions.count})", "Element.toggle('versions')" = link_to_function "Versionen (#{@page.versions.count})", "Element.toggle('versions')"
- unless @page.children.empty?
= link_to_function "Unterseiten", "Element.toggle('subpages')"
#versions{:style => "display:none"} #versions{:style => "display:none"}
.box_title
%h2 Versionen
.column_content
%ul %ul
- for version in @page.versions.reverse - for version in @page.versions.reverse
%li %li
@ -26,7 +31,9 @@
- unless @page.children.empty? - unless @page.children.empty?
#subpages #subpages
.box_title
%h2 Unterseiten %h2 Unterseiten
.column_content
%ul %ul
- for page in @page.children - for page in @page.children
%li= link_to_wikipage(page) %li= link_to_wikipage(page)

View File

@ -13,11 +13,15 @@
= @page.title = @page.title
#sidebar #sidebar
%b= "Version vom #{format_datetime @version.updated_at}" .box_title
%h2 Version
.column_content
%b= "#{format_datetime_timespec(@version.updated_at, "%a, %d.%m.%Y, %H:%M Uhr") }"
%ul %ul
%li= "Autor: #{User.find(@version.updated_by).nick}" %li= "Autor: #{User.find(@version.updated_by).nick}"
%li= link_to "Aktuelle Version sehen", wiki_page_path(:permalink => @page.permalink) %li= link_to "Aktuelle Version sehen", wiki_page_path(:permalink => @page.permalink)
%li= link_to "Auf diese Version zurücksetzen", revert_page_path(@page, :version => @version.lock_version) %li= link_to "Auf diese Version zurücksetzen", revert_page_path(@page, :version => @version.lock_version)
= wikified_body @version.body = wikified_body @version.body
%div(style="clear:right")

View File

@ -308,7 +308,6 @@ div.box {
border-left: 2px solid #78b74e; border-left: 2px solid #78b74e;
padding-left: 5px; } padding-left: 5px; }
div.single_column { div.single_column {
width: 100%; } width: 100%; }
@ -455,6 +454,8 @@ ul.autocomplete .informal {
padding-left: 0; padding-left: 0;
padding-top: 10px; padding-top: 10px;
border-bottom-style: solid; } border-bottom-style: solid; }
.wiki_show .column_content, .wiki_version .column_content, .wiki_new .column_content, .wiki_edit .column_content, .wiki_all .column_content {
margin-bottom: 0; }
#wiki_content { #wiki_content {
min-height: 400px; } min-height: 400px; }
@ -508,14 +509,24 @@ a.new_wiki_link {
#sidebar { #sidebar {
float: right; float: right;
width: 20%; } width: 290px;
margin-top: -60px; }
#sidebar #page-versions { #sidebar #page-versions {
margin-top: -60px; margin-bottom: 18px;
text-align: right; } text-align: right; }
#sidebar #subpages { #sidebar #subpages {
margin-top: 2em; } border: 1px solid #78b74e;
margin-top: 10px;
padding: 0 0 0 0; }
#sidebar #versions {
margin-top: 10px;
border: 1px solid #78b74e; }
#wiki-syntax-help { #wiki-syntax-help {
float: right; } float: right; }
#wiki-syntax-help table { #wiki-syntax-help table {
border-color: #78b74e; } border-color: #78b74e; }
.wiki_version #sidebar {
margin-top: -23px;
border: 1px solid #78b74e; }

View File

@ -308,7 +308,6 @@ div.box {
border-left: 2px solid #78b74e; border-left: 2px solid #78b74e;
padding-left: 5px; } padding-left: 5px; }
div.single_column { div.single_column {
width: 100%; } width: 100%; }
@ -455,6 +454,8 @@ ul.autocomplete .informal {
padding-left: 0; padding-left: 0;
padding-top: 10px; padding-top: 10px;
border-bottom-style: solid; } border-bottom-style: solid; }
.wiki_show .column_content, .wiki_version .column_content, .wiki_new .column_content, .wiki_edit .column_content, .wiki_all .column_content {
margin-bottom: 0; }
#wiki_content { #wiki_content {
min-height: 400px; } min-height: 400px; }
@ -508,18 +509,28 @@ a.new_wiki_link {
#sidebar { #sidebar {
float: right; float: right;
width: 20%; } width: 290px;
margin-top: -60px; }
#sidebar #page-versions { #sidebar #page-versions {
margin-top: -60px; margin-bottom: 18px;
text-align: right; } text-align: right; }
#sidebar #subpages { #sidebar #subpages {
margin-top: 2em; } border: 1px solid #78b74e;
margin-top: 10px;
padding: 0 0 0 0; }
#sidebar #versions {
margin-top: 10px;
border: 1px solid #78b74e; }
#wiki-syntax-help { #wiki-syntax-help {
float: right; } float: right; }
#wiki-syntax-help table { #wiki-syntax-help table {
border-color: #78b74e; } border-color: #78b74e; }
.wiki_version #sidebar {
margin-top: -23px;
border: 1px solid #78b74e; }
#logininfo, #header, #footer { #logininfo, #header, #footer {
display: none; } display: none; }

View File

@ -503,6 +503,8 @@ ul.autocomplete
padding-top: 10px padding-top: 10px
border-bottom: border-bottom:
:style solid :style solid
.column_content
margin-bottom: 0
#wiki_content #wiki_content
min-height: 400px min-height: 400px
@ -553,14 +555,25 @@ a.new_wiki_link
:text-decoration = underline :text-decoration = underline
#sidebar #sidebar
float: right float: right
width: 20% width: 290px
#page-versions
margin-top: -60px margin-top: -60px
#page-versions
margin-bottom: 18px
text-align: right text-align: right
#subpages #subpages
margin-top: 2em border: 1px solid #78b74e
margin-top: 10px
padding: 0 0 0 0
#versions
margin-top: 10px
border: 1px solid #78b74e
#wiki-syntax-help #wiki-syntax-help
float: right float: right
table table
border-color: #78b74e border-color: #78b74e
.wiki_version
#sidebar
margin-top: -23px
border: 1px solid #78b74e