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

@ -12,6 +12,10 @@ module ApplicationHelper
def format_datetime(time = Time.now)
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"

View file

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

View file

@ -13,11 +13,15 @@
= @page.title
#sidebar
%b= "Version vom #{format_datetime @version.updated_at}"
%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)
.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%
width: 290px
margin-top: -60px
#page-versions
margin-top: -60px
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