Merge branch 'master' into allow-no-nickname
Conflicts: app/views/home/ordergroup.html.haml app/views/login/new_password.html.haml app/views/shared/_auto_complete_users.rhtml app/views/shared/memberships/_current_members.rhtml app/views/shared/memberships/_non_members.rhtml
This commit is contained in:
commit
66ac3be81f
63 changed files with 428 additions and 438 deletions
9
lib/foodsoft_wiki/app/views/pages/_body.html.haml
Normal file
9
lib/foodsoft_wiki/app/views/pages/_body.html.haml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
- content = wikified_body @page.body, @page.title
|
||||
- toc = generate_toc @page.body
|
||||
|
||||
- unless toc.blank? or params[:preview]
|
||||
- content_for :sidebar do
|
||||
#wikitoc.well.well-small
|
||||
%h3= t '.title_toc'
|
||||
= toc
|
||||
= content
|
||||
85
lib/foodsoft_wiki/app/views/pages/_form.html.haml
Normal file
85
lib/foodsoft_wiki/app/views/pages/_form.html.haml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
- if params[:preview]
|
||||
%section#wikiContent
|
||||
= render 'body'
|
||||
|
||||
.row-fluid
|
||||
.span8
|
||||
= simple_form_for @page do |f|
|
||||
= f.hidden_field :lock_version
|
||||
= f.input :title, input_html: {class: 'input-xxlarge'}
|
||||
= f.input :body, input_html: {class: 'input-xxlarge'}
|
||||
= f.input :parent_id, as: :select, collection: parent_pages_to_select(@page)
|
||||
.form-actions
|
||||
= button_tag :name => 'preview', class: 'btn' do
|
||||
%i.icon-search= t '.preview'
|
||||
= button_tag class: 'btn' do
|
||||
%i.icon-save= t 'ui.save'
|
||||
= link_to t('ui.or_cancel'), @page
|
||||
|
||||
.span4
|
||||
%h3= t '.help.title'
|
||||
%table.table
|
||||
%tbody
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_character'
|
||||
%tr
|
||||
%td
|
||||
%i= t '.help.italic'
|
||||
%td
|
||||
%pre
|
||||
''#{t '.help.italic'}''<br />
|
||||
%tr
|
||||
%td
|
||||
%b= t '.help.bold'
|
||||
%td
|
||||
%pre '''#{t '.help.bold'}'''<br />
|
||||
%tr
|
||||
%td= t '.help.noformat'
|
||||
%td
|
||||
%pre <nowiki>#{t '.help.text'}</nowiki>
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_block'
|
||||
%tr
|
||||
%td= t '.help.headings'
|
||||
%td
|
||||
%pre
|
||||
\== #{t '.help.heading', level: 1} ==
|
||||
%pre
|
||||
\=== #{t '.help.heading', level: 2} ===
|
||||
%pre
|
||||
\==== #{t '.help.heading', level: 3} ====
|
||||
%tr
|
||||
%td= t '.help.unordered_list'
|
||||
%td
|
||||
%pre
|
||||
* #{t '.help.list_item_1'}
|
||||
%pre
|
||||
** #{t '.help.list_item_2'}
|
||||
%tr
|
||||
%td= t '.help.ordered_list'
|
||||
%td
|
||||
%pre
|
||||
\# #{t '.help.list_item_1'}
|
||||
%pre
|
||||
\# #{t '.help.list_item_2'}
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_link'
|
||||
%tr
|
||||
%td= t '.help.wiki_links'
|
||||
%td
|
||||
%pre
|
||||
[[#{t '.help.wiki_link_ex'}]]
|
||||
%tr
|
||||
%td= t '.help.external_links'
|
||||
%td
|
||||
%pre
|
||||
[http://example.net #{t '.help.external_link_ex'}]
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_table'
|
||||
%tr
|
||||
%td!= t '.help.see_tables', tables_link: link_to(t('.help.tables_link'), "http://www.mediawiki.org/wiki/Help:Tables", :target => '_blank')
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
-ident = 20 * level
|
||||
%tr
|
||||
%td{:style => "padding-left: #{ident}px"}
|
||||
= link_to page.title, wiki_page_path(page.permalink)
|
||||
%td #{show_user page.user} (#{format_datetime_timespec(page.updated_at, t('.date_format'))})
|
||||
-if siteMap == 1
|
||||
-for child in page.children.all
|
||||
= render :partial => 'page_list_item', :locals => {:page => child, :level => level+1, :siteMap => 1}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
%tbody
|
||||
- for page in @pages
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
12
lib/foodsoft_wiki/app/views/pages/_site_map.html.haml
Normal file
12
lib/foodsoft_wiki/app/views/pages/_site_map.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
- homepage = Page.find_by_permalink('Home')
|
||||
- unless homepage.nil?
|
||||
= render :partial => 'page_list_item', :locals => {:page => homepage, :level => 0, :siteMap => 1}
|
||||
%tbody
|
||||
- for page in @pages
|
||||
- if page.id != homepage.try(:id)
|
||||
= render :partial => 'page_list_item', :locals => {:page => page, :level => 0, :siteMap => 1}
|
||||
8
lib/foodsoft_wiki/app/views/pages/_title_list.html.haml
Normal file
8
lib/foodsoft_wiki/app/views/pages/_title_list.html.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
%tbody
|
||||
- for page in @pages
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
17
lib/foodsoft_wiki/app/views/pages/all.html.haml
Normal file
17
lib/foodsoft_wiki/app/views/pages/all.html.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
- title t('.title'), false
|
||||
|
||||
- content_for :sidebar do
|
||||
= link_to t('.new_page'), new_page_path, class: 'btn btn-primary'
|
||||
|
||||
.navbar
|
||||
.navbar-inner
|
||||
%ul.nav
|
||||
%li= link_to t('.recent_changes'), all_pages_path(:view => 'recent_changes')
|
||||
%li= link_to t('.title_list'), all_pages_path(:view => 'title_list')
|
||||
%li= link_to t('.site_map'), all_pages_path(:view => 'site_map')
|
||||
= form_tag all_pages_path, method: :get, class: 'form-search pull-right' do
|
||||
= text_field_tag :name, params[:name], class: 'input-medium search-query',
|
||||
placeholder: t('.search.placeholder')
|
||||
= submit_tag t('.search.action'), class: 'btn'
|
||||
|
||||
= render @partial
|
||||
3
lib/foodsoft_wiki/app/views/pages/edit.html.haml
Normal file
3
lib/foodsoft_wiki/app/views/pages/edit.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
- title t('.title')
|
||||
|
||||
= render 'form'
|
||||
3
lib/foodsoft_wiki/app/views/pages/new.html.haml
Normal file
3
lib/foodsoft_wiki/app/views/pages/new.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
- title t('.title')
|
||||
|
||||
= render 'form'
|
||||
51
lib/foodsoft_wiki/app/views/pages/show.html.haml
Normal file
51
lib/foodsoft_wiki/app/views/pages/show.html.haml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
- title @page.title, false
|
||||
|
||||
- content_for :sidebar do
|
||||
%p
|
||||
= link_to edit_page_path(@page), class: 'btn btn-primary' do
|
||||
%i.icon-edit= t '.edit'
|
||||
.well.well-small
|
||||
%ul.nav.nav-list
|
||||
%li
|
||||
%li= link_to t('.versions', count: @page.versions.count), "#versions", 'data-toggle-this' => '#versions'
|
||||
- unless @page.children.empty?
|
||||
%li= link_to t('.subpages'), "#subpages", 'data-toggle-this' => '#subpages'
|
||||
|
||||
#versions.well.well-small{:style => "display:none"}
|
||||
%h3= t '.title_versions'
|
||||
%ul.unstyled
|
||||
- @page.versions.reverse.each do |version|
|
||||
%li
|
||||
= link_to I18n.l(version.updated_at, :format => t('.date_format')), version_page_path(@page, :version => version.lock_version)
|
||||
= "(#{show_user(User.find_by_id(version.updated_by))})"
|
||||
|
||||
- unless @page.children.empty?
|
||||
#subpages.well.well-small{:style => "display:none"}
|
||||
%h3= t '.subpages'
|
||||
%ul.unstyled
|
||||
- @page.children.each do |page|
|
||||
%li= link_to_wikipage(page)
|
||||
|
||||
%ul.breadcrumb
|
||||
%li
|
||||
= link_to_wikipage_by_permalink("Home", "Foodcoop-Wiki")
|
||||
%span.divider /
|
||||
- for page in @page.ancestors.reverse
|
||||
%li
|
||||
= link_to_wikipage(page)
|
||||
%span.divider /
|
||||
%li.active= @page.title
|
||||
|
||||
|
||||
#wikiContent
|
||||
.page-header
|
||||
%h1= @page.title
|
||||
= render :partial => 'body'
|
||||
|
||||
%hr.clear/
|
||||
%p
|
||||
= link_to edit_page_path(@page), class: 'btn btn-primary' do
|
||||
%i.icon-edit= t '.edit'
|
||||
= link_to t('.delete'), @page, class: 'btn btn-danger', :method => :delete,
|
||||
:confirm => t('.delete_confirm')
|
||||
!= '| ' + t('.last_updated', user: show_user(@page.user), when: format_datetime(@page.updated_at))
|
||||
11
lib/foodsoft_wiki/app/views/pages/version.html.haml
Normal file
11
lib/foodsoft_wiki/app/views/pages/version.html.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
- title t('.title', title: @page.title, version: @version.lock_version)
|
||||
|
||||
- content_for :sidebar do
|
||||
%h3= t '.title_version'
|
||||
%b= "#{format_datetime_timespec(@version.updated_at, t('.date_format'))}"
|
||||
%ul
|
||||
%li= t '.author', user: show_user(User.find(@version.updated_by))
|
||||
%li= link_to t('.view_current'), wiki_page_path(:permalink => @page.permalink)
|
||||
%li= link_to t('.revert'), revert_page_path(@page, :version => @version.lock_version)
|
||||
|
||||
= wikified_body @version.body
|
||||
Loading…
Add table
Add a link
Reference in a new issue