Neues Breadcrump-Layout
* Die Breadcrump-Links sind jetzt überdem Seiten-Titel. * Breadcrumps sind jetzt auf allen Wiki-Ansichten: edit, show, new, versions, all * Bei edit und version ist der Breadcrump-Teil zur aktuellen Seite auch eine Link. * Bei all wird nur der Foodcoop-Wiki-Teil angezeigt.
This commit is contained in:
parent
b46d7ca19c
commit
57023cd018
9 changed files with 143 additions and 58 deletions
|
@ -13,8 +13,12 @@ module PagesHelper
|
||||||
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html
|
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_to_wikipage(page)
|
def link_to_wikipage(page, text = nil)
|
||||||
link_to page.title, "/wiki/#{page.title}"
|
if text == nil
|
||||||
|
link_to page.title, "/wiki/#{page.title}"
|
||||||
|
else
|
||||||
|
link_to text, "/wiki/#{page.title}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# def generate_toc(body)
|
# def generate_toc(body)
|
||||||
# toc = ""
|
# toc = ""
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
- title "Alle Wikiseiten"
|
- title "Alle Wikiseiten", false
|
||||||
|
|
||||||
%p= link_to "Neue Seite anlegen", new_page_path
|
.wiki_all
|
||||||
|
#breadcrump
|
||||||
|
= link_to_wikipage(Page.find_by_permalink("Home"), "Foodcoop-Wiki")
|
||||||
|
|
||||||
%table
|
%h1 Alle Wikiseite
|
||||||
%tr
|
|
||||||
%th Titel
|
%p= link_to "Neue Seite anlegen", new_page_path
|
||||||
%th zuletzt aktualisiert
|
|
||||||
- for page in @pages
|
%table
|
||||||
%tr
|
%tr
|
||||||
%td= link_to page.title, wiki_page_path(page.permalink)
|
%th Titel
|
||||||
%td= format_date page.updated_at
|
%th Zuletzt aktualisiert
|
||||||
|
- for page in @pages
|
||||||
|
%tr
|
||||||
|
%td= link_to page.title, wiki_page_path(page.permalink)
|
||||||
|
%td= format_date page.updated_at
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
- title "#{@page.title} bearbeiten"
|
- title "#{@page.title} bearbeiten", false
|
||||||
|
|
||||||
= render :partial => 'form'
|
.wiki_edit
|
||||||
|
#breadcrump
|
||||||
|
= link_to_wikipage(Page.find_by_permalink("Home"), "Foodcoop-Wiki")
|
||||||
|
- for page in @page.ancestors.reverse
|
||||||
|
%span.wikiSeparator >
|
||||||
|
= link_to_wikipage(page)
|
||||||
|
%span.wikiSeparator >
|
||||||
|
= link_to_wikipage(@page)
|
||||||
|
|
||||||
|
%h1 #{@page.title} bearbeiten
|
||||||
|
|
||||||
|
= render :partial => 'form'
|
|
@ -1,3 +1,16 @@
|
||||||
- title "Neue Wikiseite anlegen"
|
- title "Neue Wikiseite anlegen", false
|
||||||
|
|
||||||
= render :partial => 'form'
|
.wiki_new
|
||||||
|
#breadcrump
|
||||||
|
= link_to_wikipage(Page.find_by_permalink("Home"), "Foodcoop-Wiki")
|
||||||
|
- parent_page = Page.find_by_permalink(params[:parent])
|
||||||
|
- if parent_page != nil
|
||||||
|
- for page in parent_page.ancestors.reverse
|
||||||
|
%span.wikiSeparator >
|
||||||
|
= link_to_wikipage(page)
|
||||||
|
%span.wikiSeparator >
|
||||||
|
= @page.title
|
||||||
|
|
||||||
|
%h1 Neue Wikiseite anlegen
|
||||||
|
|
||||||
|
= render :partial => 'form'
|
|
@ -1,36 +1,42 @@
|
||||||
- title @page.title, false
|
- title @page.title, false
|
||||||
|
|
||||||
%h1
|
.wiki_show
|
||||||
%span#breadcrump
|
|
||||||
|
#breadcrump
|
||||||
|
= link_to_wikipage(Page.find_by_permalink("Home"), "Foodcoop-Wiki")
|
||||||
- for page in @page.ancestors.reverse
|
- for page in @page.ancestors.reverse
|
||||||
|
%span.wikiSeparator >
|
||||||
= link_to_wikipage(page)
|
= link_to_wikipage(page)
|
||||||
>>
|
%span.wikiSeparator >
|
||||||
= @page.title
|
= @page.title
|
||||||
|
|
||||||
#sidebar
|
%h1
|
||||||
#page-versions
|
= @page.title
|
||||||
= link_to "Bearbeiten", edit_page_path(@page)
|
|
||||||
= link_to_function "Versionen (#{@page.versions.count})", "Element.toggle('versions')"
|
|
||||||
#versions{:style => "display:none"}
|
|
||||||
%ul
|
|
||||||
- for version in @page.versions.reverse
|
|
||||||
%li
|
|
||||||
= link_to I18n.l(version.updated_at, :format => "%d.%m.%y %H:%M"), version_page_path(@page, :version => version.lock_version)
|
|
||||||
= "(#{User.find(version.updated_by).nick})"
|
|
||||||
|
|
||||||
- unless @page.children.empty?
|
#sidebar
|
||||||
#subpages
|
#page-versions
|
||||||
%h2 Unterseiten
|
= link_to "Bearbeiten", edit_page_path(@page)
|
||||||
%ul
|
= link_to_function "Versionen (#{@page.versions.count})", "Element.toggle('versions')"
|
||||||
- for page in @page.children
|
#versions{:style => "display:none"}
|
||||||
%li= link_to_wikipage(page)
|
%ul
|
||||||
|
- for version in @page.versions.reverse
|
||||||
|
%li
|
||||||
|
= link_to I18n.l(version.updated_at, :format => "%d.%m.%y %H:%M"), version_page_path(@page, :version => version.lock_version)
|
||||||
|
= "(#{User.find(version.updated_by).nick})"
|
||||||
|
|
||||||
= render :partial => 'body'
|
- unless @page.children.empty?
|
||||||
|
#subpages
|
||||||
|
%h2 Unterseiten
|
||||||
|
%ul
|
||||||
|
- for page in @page.children
|
||||||
|
%li= link_to_wikipage(page)
|
||||||
|
|
||||||
%hr.clear/
|
= render :partial => 'body'
|
||||||
%p
|
|
||||||
= link_to "Seite bearbeiten", edit_page_path(@page)
|
%hr.clear/
|
||||||
|
|
%p
|
||||||
= link_to "Seite löschen", @page, :method => :delete, :confirm => "Achtung, auch alle Unterseiten werden gelöscht. Bist Du sicher?"
|
= link_to "Seite bearbeiten", edit_page_path(@page)
|
||||||
|
|
|
|
||||||
= "Zuletzt bearbeitet am #{format_datetime @page.updated_at} (#{@page.user.nick})"
|
= link_to "Seite löschen", @page, :method => :delete, :confirm => "Achtung, auch alle Unterseiten werden gelöscht. Bist Du sicher?"
|
||||||
|
|
|
||||||
|
= "Zuletzt bearbeitet am #{format_datetime @page.updated_at} (#{@page.user.nick})"
|
||||||
|
|
|
@ -1,11 +1,23 @@
|
||||||
- title @page.title
|
- title @page.title, false
|
||||||
|
|
||||||
#sidebar
|
.wiki_version
|
||||||
%b= "Version vom #{format_datetime @version.updated_at}"
|
#breadcrump
|
||||||
%ul
|
= link_to_wikipage(Page.find_by_permalink("Home"), "Foodcoop-Wiki")
|
||||||
%li= "Autor: #{User.find(@version.updated_by).nick}"
|
- for page in @page.ancestors.reverse
|
||||||
%li= link_to "Aktuelle Version sehen", wiki_page_path(:permalink => @page.permalink)
|
%span.wikiSeparator >
|
||||||
%li= link_to "Auf diese Version zurücksetzen", revert_page_path(@page, :version => @version.lock_version)
|
= link_to_wikipage(page)
|
||||||
|
%span.wikiSeparator >
|
||||||
|
= link_to_wikipage(@page)
|
||||||
|
|
||||||
= wikified_body @version.body
|
%h1
|
||||||
|
= @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)
|
||||||
|
|
||||||
|
= wikified_body @version.body
|
||||||
|
|
||||||
|
|
|
@ -438,6 +438,10 @@ ul.autocomplete .informal {
|
||||||
top: -1em;
|
top: -1em;
|
||||||
left: 5%; }
|
left: 5%; }
|
||||||
|
|
||||||
|
.wiki_show h1, .wiki_version h1, .wiki_new h1, .wiki_edit h1, .wiki_all h1 {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-top: 10px; }
|
||||||
|
|
||||||
a.new_wiki_link {
|
a.new_wiki_link {
|
||||||
color: grey; }
|
color: grey; }
|
||||||
|
|
||||||
|
@ -449,15 +453,22 @@ a.new_wiki_link {
|
||||||
float: right; }
|
float: right; }
|
||||||
|
|
||||||
#breadcrump {
|
#breadcrump {
|
||||||
font-size: 0.5em; }
|
font-size: 0.5em;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-top: 30px;
|
||||||
|
height: 1em;
|
||||||
|
color: #ED0606; }
|
||||||
#breadcrump a {
|
#breadcrump a {
|
||||||
color: #ed0606; }
|
color: #ed0606;
|
||||||
|
text-decoration: none; }
|
||||||
|
#breadcrump a:hover {
|
||||||
|
text-decoration: underline; }
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
float: right;
|
float: right;
|
||||||
width: 20%; }
|
width: 20%; }
|
||||||
#sidebar #page-versions {
|
#sidebar #page-versions {
|
||||||
margin-top: -4em;
|
margin-top: -60px;
|
||||||
text-align: right; }
|
text-align: right; }
|
||||||
#sidebar #subpages {
|
#sidebar #subpages {
|
||||||
margin-top: 2em; }
|
margin-top: 2em; }
|
||||||
|
|
|
@ -438,6 +438,10 @@ ul.autocomplete .informal {
|
||||||
top: -1em;
|
top: -1em;
|
||||||
left: 5%; }
|
left: 5%; }
|
||||||
|
|
||||||
|
.wiki_show h1, .wiki_version h1, .wiki_new h1, .wiki_edit h1, .wiki_all h1 {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-top: 10px; }
|
||||||
|
|
||||||
a.new_wiki_link {
|
a.new_wiki_link {
|
||||||
color: grey; }
|
color: grey; }
|
||||||
|
|
||||||
|
@ -449,15 +453,22 @@ a.new_wiki_link {
|
||||||
float: right; }
|
float: right; }
|
||||||
|
|
||||||
#breadcrump {
|
#breadcrump {
|
||||||
font-size: 0.5em; }
|
font-size: 0.5em;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-top: 30px;
|
||||||
|
height: 1em;
|
||||||
|
color: #ED0606; }
|
||||||
#breadcrump a {
|
#breadcrump a {
|
||||||
color: #ed0606; }
|
color: #ed0606;
|
||||||
|
text-decoration: none; }
|
||||||
|
#breadcrump a:hover {
|
||||||
|
text-decoration: underline; }
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
float: right;
|
float: right;
|
||||||
width: 20%; }
|
width: 20%; }
|
||||||
#sidebar #page-versions {
|
#sidebar #page-versions {
|
||||||
margin-top: -4em;
|
margin-top: -60px;
|
||||||
text-align: right; }
|
text-align: right; }
|
||||||
#sidebar #subpages {
|
#sidebar #subpages {
|
||||||
margin-top: 2em; }
|
margin-top: 2em; }
|
||||||
|
|
|
@ -486,6 +486,10 @@ ul.autocomplete
|
||||||
left: 5%
|
left: 5%
|
||||||
|
|
||||||
// *** wiki
|
// *** wiki
|
||||||
|
.wiki_show, .wiki_version, .wiki_new, .wiki_edit, .wiki_all
|
||||||
|
h1
|
||||||
|
padding-left: 0
|
||||||
|
padding-top: 10px
|
||||||
a.new_wiki_link
|
a.new_wiki_link
|
||||||
color: grey
|
color: grey
|
||||||
#preview
|
#preview
|
||||||
|
@ -495,13 +499,20 @@ a.new_wiki_link
|
||||||
float: right
|
float: right
|
||||||
#breadcrump
|
#breadcrump
|
||||||
font-size: 0.5em
|
font-size: 0.5em
|
||||||
|
margin-bottom: 5px
|
||||||
|
margin-top: 30px
|
||||||
|
height: 1em
|
||||||
|
color: #ED0606
|
||||||
a
|
a
|
||||||
:color = !main_red
|
:color = !main_red
|
||||||
|
:text-decoration = none
|
||||||
|
a:hover
|
||||||
|
:text-decoration = underline
|
||||||
#sidebar
|
#sidebar
|
||||||
float: right
|
float: right
|
||||||
width: 20%
|
width: 20%
|
||||||
#page-versions
|
#page-versions
|
||||||
margin-top: -4em
|
margin-top: -60px
|
||||||
text-align: right
|
text-align: right
|
||||||
#subpages
|
#subpages
|
||||||
margin-top: 2em
|
margin-top: 2em
|
||||||
|
|
Loading…
Reference in a new issue