foodcoop-adam/foodsoft

View on GitHub
lib/foodsoft_wiki/app/views/pages/_form.html.haml

Summary

Maintainability
Test Coverage
- 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 &lt;nowiki&gt;#{t '.help.text'}&lt;/nowiki&gt;
        %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')