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,82 +3,81 @@
#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 %table(frame="void")
%table(frame="void") %tbody
%tbody %tr
%tr %td(colspan=2)
%td(colspan=2) %b Zeichenformatierung
%b Zeichenformatierung %tr
%tr %td
%td %i kursiv
%i kursiv %td
%td %pre
%pre ''kursiv''<br />
''kursiv''<br /> %tr
%tr %td
%td %b fett
%b fett %td
%td %pre '''Fett'''<br />
%pre '''Fett'''<br /> %tr
%tr %td
%td Keine Wiki-<br/>Formatierung
Keine Wiki-<br/>Formatierung %td
%td %pre &lt;nowiki&gt;text&lt;/nowiki&gt;
%pre &lt;nowiki&gt;text&lt;/nowiki&gt; %tr
%tr %td(colspan=2)
%td(colspan=2) %b Block-Formatierung
%b Block-Formatierung %tr
%tr %td
%td Überschriften
Überschriften %td
%td %pre
%pre \== Ebene 1 ==
\== Ebene 1 == %pre
%pre \=== Ebene 2 ===
\=== Ebene 2 === %pre
%pre \==== Ebene 3 ====
\==== Ebene 3 ==== %tr
%tr %td
%td Listen mit Punkten
Listen mit Punkten %td
%td %pre
%pre * Erster Punkt
* Erster Punkt %pre
%pre ** Zweiter Punkt
** Zweiter Punkt %tr
%tr %td
%td Listen mit Zahlen
Listen mit Zahlen %td
%td %pre
%pre 1. Ersten Punkt
1. Ersten Punkt %pre
%pre 1. Zweiter Punkt
1. Zweiter Punkt %tr
%tr %td(colspan=2)
%td(colspan=2) %b Link-Formatierung
%b Link-Formatierung %tr
%tr %td
%td Wiki-Links
Wiki-Links %td
%td %pre
%pre [[Foodsoft Wiki Seite]]
[[Foodsoft Wiki Seite]] %tr
%tr %td
%td Externe Links
Externe Links %td
%td %pre
%pre [http://addresse.net Externe Seite]
[http://addresse.net Externe Seite] %tr
%tr %td(colspan=2)
%td(colspan=2) %b Tabellenformatierung
%b Tabellenformatierung %tr
%tr %td
%td Siehe
Siehe = link_to "Tabellen", "http://www.mediawiki.org/wiki/Help:Tables", :target => '_blank'
= link_to "Tabellen", "http://www.mediawiki.org/wiki/Help:Tables", :target => '_blank'
- form_for @page do |f| - form_for @page do |f|
= f.error_messages = f.error_messages
@ -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')"
#versions{:style => "display:none"} - unless @page.children.empty?
= link_to_function "Unterseiten", "Element.toggle('subpages')"
#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,10 +31,12 @@
- unless @page.children.empty? - unless @page.children.empty?
#subpages #subpages
%h2 Unterseiten .box_title
%ul %h2 Unterseiten
- for page in @page.children .column_content
%li= link_to_wikipage(page) %ul
- for page in @page.children
%li= link_to_wikipage(page)
= render :partial => 'body' = render :partial => 'body'

View file

@ -13,11 +13,15 @@
= @page.title = @page.title
#sidebar #sidebar
%b= "Version vom #{format_datetime @version.updated_at}" .box_title
%ul %h2 Version
%li= "Autor: #{User.find(@version.updated_by).nick}" .column_content
%li= link_to "Aktuelle Version sehen", wiki_page_path(:permalink => @page.permalink) %b= "#{format_datetime_timespec(@version.updated_at, "%a, %d.%m.%Y, %H:%M Uhr") }"
%li= link_to "Auf diese Version zurücksetzen", revert_page_path(@page, :version => @version.lock_version) %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 = 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
margin-top: -60px
#page-versions #page-versions
margin-top: -60px 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