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?
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
# see also the plugin "will_paginate"
def pagination_links_remote(collection, options = {})

View file

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

View file

@ -17,7 +17,12 @@
#page-versions
= link_to "Bearbeiten", edit_page_path(@page)
= 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"}
.box_title
%h2 Versionen
.column_content
%ul
- for version in @page.versions.reverse
%li
@ -26,7 +31,9 @@
- unless @page.children.empty?
#subpages
.box_title
%h2 Unterseiten
.column_content
%ul
- for page in @page.children
%li= link_to_wikipage(page)

View file

@ -13,11 +13,15 @@
= @page.title
#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
%li= "Autor: #{User.find(@version.updated_by).nick}"
%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)
= wikified_body @version.body
%div(style="clear:right")

View file

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

View file

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