diff --git a/Gemfile b/Gemfile index 866a715..3905133 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source "http://rubygems.org" # development dependencies will be added by default to the :development group. gemspec -gem "rails", "4.2.0.beta4" +gem "rails", "4.2.0.rc2" group :assets do gem 'sass-rails', '5.0.0.beta1' gem 'bourbon' @@ -21,7 +21,6 @@ gem 'orm_adapter', github: 'bterkuile/orm_adapter' gem 'devise' gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored' gem 'tinymce-rails' -gem 'haml-rails' gem 'slim-rails' gem 'paperclip' gem 'email_validator' diff --git a/Gemfile.lock b/Gemfile.lock index 384122a..77246e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,7 +22,7 @@ GIT GIT remote: git://github.com/bterkuile/simply_stored.git - revision: 354fde89a88c1384ccc9d82989e3f05ac6977bd1 + revision: 8f00644f7a8e82dba057c01f86dbb8bc3154d5d8 specs: simply_stored (1.0.0) activesupport @@ -35,52 +35,52 @@ PATH cmtool (1.0.0) bourbon email_validator - haml-rails jquery-rails + paperclip slim-rails tinymce-rails GEM remote: http://rubygems.org/ specs: - actionmailer (4.2.0.beta4) - actionpack (= 4.2.0.beta4) - actionview (= 4.2.0.beta4) - activejob (= 4.2.0.beta4) + actionmailer (4.2.0.rc2) + actionpack (= 4.2.0.rc2) + actionview (= 4.2.0.rc2) + activejob (= 4.2.0.rc2) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.4) - actionpack (4.2.0.beta4) - actionview (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - rack (~> 1.6.0.beta) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.0.rc2) + actionview (= 4.2.0.rc2) + activesupport (= 4.2.0.rc2) + rack (~> 1.6.0.beta2) rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.4) + rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.1) actionpack-page_caching (1.0.2) actionpack (>= 4.0.0, < 5) - actionview (4.2.0.beta4) - activesupport (= 4.2.0.beta4) + actionview (4.2.0.rc2) + activesupport (= 4.2.0.rc2) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.4) + rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.1) - activejob (4.2.0.beta4) - activesupport (= 4.2.0.beta4) + activejob (4.2.0.rc2) + activesupport (= 4.2.0.rc2) globalid (>= 0.3.0) - activemodel (4.2.0.beta4) - activesupport (= 4.2.0.beta4) + activemodel (4.2.0.rc2) + activesupport (= 4.2.0.rc2) builder (~> 3.1) - activerecord (4.2.0.beta4) - activemodel (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - arel (>= 6.0.0.beta2, < 6.1) - activesupport (4.2.0.beta4) + activerecord (4.2.0.rc2) + activemodel (= 4.2.0.rc2) + activesupport (= 4.2.0.rc2) + arel (~> 6.0) + activesupport (4.2.0.rc2) i18n (>= 0.7.0.beta1, < 0.8) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.1) tzinfo (~> 1.1) - arel (6.0.0.beta2) + arel (6.0.0) bcrypt (3.1.9) bootstrap-sass (2.3.2.2) sass (~> 3.2) @@ -96,7 +96,7 @@ GEM xpath (~> 2.0) climate_control (0.0.3) activesupport (>= 3.0) - cocaine (0.5.4) + cocaine (0.5.5) climate_control (>= 0.0.3, < 1.0) coderay (1.1.0) coffee-script (2.3.0) @@ -116,7 +116,7 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.2.5) - email_validator (1.4.0) + email_validator (1.5.0) activemodel erubis (2.7.0) eventmachine (1.0.3) @@ -128,19 +128,13 @@ GEM railties (>= 3.0.0) globalid (0.3.0) activesupport (>= 4.1.0) - haml (4.0.5) - tilt - haml-rails (0.5.3) - actionpack (>= 4.0.1) - activesupport (>= 4.0.1) - haml (>= 3.1, < 5.0) - railties (>= 4.0.1) hike (1.2.3) i18n (0.7.0.beta1) - jquery-rails (3.1.2) - railties (>= 3.0, < 5.0) + jquery-rails (4.0.0) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0.beta, < 5.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (5.0.2) + jquery-ui-rails (5.0.3) railties (>= 3.2.16) json (1.8.1) loofah (2.0.1) @@ -150,11 +144,11 @@ GEM method_source (0.8.2) mime-types (1.25.1) mini_portile (0.6.1) - minitest (5.4.2) + minitest (5.4.3) multi_json (1.10.1) - nokogiri (1.6.4) + nokogiri (1.6.5) mini_portile (~> 0.6.0) - paperclip (4.2.0) + paperclip (4.2.1) activemodel (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.3) @@ -165,37 +159,37 @@ GEM slop (~> 3.4) pry-rails (0.3.2) pry (>= 0.9.10) - rack (1.6.0.beta) + rack (1.6.0.beta2) rack-test (0.6.2) rack (>= 1.0) - rails (4.2.0.beta4) - actionmailer (= 4.2.0.beta4) - actionpack (= 4.2.0.beta4) - actionview (= 4.2.0.beta4) - activejob (= 4.2.0.beta4) - activemodel (= 4.2.0.beta4) - activerecord (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) + rails (4.2.0.rc2) + actionmailer (= 4.2.0.rc2) + actionpack (= 4.2.0.rc2) + actionview (= 4.2.0.rc2) + activejob (= 4.2.0.rc2) + activemodel (= 4.2.0.rc2) + activerecord (= 4.2.0.rc2) + activesupport (= 4.2.0.rc2) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.0.beta4) - sprockets-rails (~> 3.0.0.beta1) + railties (= 4.2.0.rc2) + sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.4) + rails-dom-testing (1.0.5) activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.1) loofah (~> 2.0) - railties (4.2.0.beta4) - actionpack (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) + railties (4.2.0.rc2) + actionpack (= 4.2.0.rc2) + activesupport (= 4.2.0.rc2) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.3.2) - rdoc (4.1.2) + rake (10.4.2) + rdoc (4.2.0) json (~> 1.4) - responders (2.0.1) + responders (2.0.2) railties (>= 4.2.0.alpha, < 5) rest-client (1.6.8) mime-types (~> 1.16) @@ -219,7 +213,7 @@ GEM rspec-mocks (~> 3.1.0) rspec-support (~> 3.1.0) rspec-support (3.1.2) - sass (3.4.7) + sass (3.4.9) sass-rails (5.0.0.beta1) railties (>= 4.0.0, < 5.0) sass (~> 3.2) @@ -239,10 +233,10 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sprockets-rails (3.0.0.beta1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (~> 2.8) + sprockets-rails (2.2.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) steak (2.0.0) capybara (>= 1.0.0) rspec-rails (>= 2.5.0) @@ -277,13 +271,12 @@ DEPENDENCIES devise_simply_stored! email_validator factory_girl_rails - haml-rails jquery-rails jquery-ui-rails orm_adapter! paperclip pry-rails - rails (= 4.2.0.beta4) + rails (= 4.2.0.rc2) rspec-its sass-rails (= 5.0.0.beta1) simply_stored! diff --git a/README.md b/README.md index b94200e..9e572f2 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ This will add some gems you might like anyway, here a list: * jquery-rails * tinymce-rails * sass-rails -* haml-rails * paperclip * email_validator (validates :email, email: true) @@ -41,22 +40,11 @@ This will add some gems you might like anyway, here a list: in `app/controllers/pages_controller.rb`: ```ruby -class PagesController +class PagesController < ApplicationController include Cmtool::Includes::PagesController end ``` -in `app/models/page.rb`: -```ruby -class Page - include Cmtool::Includes::Page - - def self.layouts - %w[home application contact] - end -end -``` - ### Securing Cmtool is looking for an authorize_cmtool method present in the application @@ -102,22 +90,18 @@ goodies of your own. Remember that this is a SimplyStored model with almost all the ActiveModel features. ### Page model -The page model allows you to control some interesting things. To create it -(app/models/page.rb): +The page model allows you to control some interesting things. + +in `app/models/page.rb`: ```ruby class Page - include Cmtool::Page - - # Define the locales you want to use in your website - def self.locales - [:en] - end + include Cmtool::Includes::Page # Define the layouts you want to use in your website. Be sure to create them in # app/views/layouts/... # The first specified layout will become the default def self.layouts - [:application, :home, :contact] + %w[application home contact] end end ``` @@ -148,8 +132,9 @@ and changing this file will change all displayed pages without their own specific page. To create a specific page, create a page with the name of the page you created in the Admin section. If for example you have created a page with the name: about Then you can give this page a custom look using the view: -`app/views/about.html.haml` You can also use erb, slim or your choice of -templating engine +`app/views/about.html.slim` + +### The menu and getting pages ### Customize your 404 You can customize what is shown when a page cannot be found. There is a diff --git a/app/views/cmtool/application/_alerts.html.haml b/app/views/cmtool/application/_alerts.html.slim similarity index 69% rename from app/views/cmtool/application/_alerts.html.haml rename to app/views/cmtool/application/_alerts.html.slim index c4c8abf..de75123 100644 --- a/app/views/cmtool/application/_alerts.html.haml +++ b/app/views/cmtool/application/_alerts.html.slim @@ -12,9 +12,9 @@ .message.warning.ui-state-highlight .icon .text - %ul + ul - for warning in warnings - if warning.is_a?(Hash) - %li.warning= t("cmtool.warnings.#{warning.delete(:message)}", warning) + li.warning= t("cmtool.warnings.# warning.delete(:message) ", warning) - else - %li.warning= t("cmtool.warnings.#{warning}") + li.warning= t("cmtool.warnings.# warning ") diff --git a/app/views/cmtool/application/_error_messages.html.haml b/app/views/cmtool/application/_error_messages.html.haml deleted file mode 100644 index 76a5d9b..0000000 --- a/app/views/cmtool/application/_error_messages.html.haml +++ /dev/null @@ -1,6 +0,0 @@ --if target.errors.any? - #errorExplanation - %h2= t('cmtool.errors.form.title', :count => target.errors.count) - %ul - - target.errors.full_messages.each do |msg| - %li= msg diff --git a/app/views/cmtool/application/_error_messages.html.slim b/app/views/cmtool/application/_error_messages.html.slim new file mode 100644 index 0000000..e8c78ad --- /dev/null +++ b/app/views/cmtool/application/_error_messages.html.slim @@ -0,0 +1,6 @@ +-if target.errors.any? + #errorExplanation + h2= t('cmtool.errors.form.title', :count => target.errors.count) + ul + - target.errors.full_messages.each do |msg| + li= msg diff --git a/app/views/cmtool/application/_user_info.html.haml b/app/views/cmtool/application/_user_info.html.slim similarity index 77% rename from app/views/cmtool/application/_user_info.html.haml rename to app/views/cmtool/application/_user_info.html.slim index 230da63..d187e98 100644 --- a/app/views/cmtool/application/_user_info.html.haml +++ b/app/views/cmtool/application/_user_info.html.slim @@ -1,6 +1,6 @@ #user-info #user-info-email= link_to current_user.email, cmtool.user_path(current_user) - #user-info-sign-in-out{class: user_signed_in? ? 'signed-in' : 'signed-out'} + #user-info-sign-in-out class: user_signed_in? ? 'signed-in' : 'signed-out' - if user_signed_in? = link_to t('devise.sessions.sign_out'), cmtool.destroy_user_session_path - else diff --git a/app/views/cmtool/contact_forms/_form.html.haml b/app/views/cmtool/contact_forms/_form.html.slim similarity index 100% rename from app/views/cmtool/contact_forms/_form.html.haml rename to app/views/cmtool/contact_forms/_form.html.slim diff --git a/app/views/cmtool/contact_forms/edit.html.haml b/app/views/cmtool/contact_forms/edit.html.haml deleted file mode 100644 index ce93b37..0000000 --- a/app/views/cmtool/contact_forms/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, Cmtool::ContactForm -= render 'form', :submit => update_button_text(@contact_form) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@contact_form), cmtool.contact_form_path(@contact_form), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path, class: [:btn] diff --git a/app/views/cmtool/contact_forms/edit.html.slim b/app/views/cmtool/contact_forms/edit.html.slim new file mode 100644 index 0000000..6fcb5c8 --- /dev/null +++ b/app/views/cmtool/contact_forms/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, Cmtool::ContactForm += render 'form', :submit => update_button_text(@contact_form) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@contact_form), cmtool.contact_form_path(@contact_form), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path, class: [:btn] diff --git a/app/views/cmtool/contact_forms/index.html.haml b/app/views/cmtool/contact_forms/index.html.haml deleted file mode 100644 index 251726e..0000000 --- a/app/views/cmtool/contact_forms/index.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- title :index, Cmtool::ContactForm -- if @contact_forms.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::ContactForm.human_attribute_name(:gender) - %th= Cmtool::ContactForm.human_attribute_name(:name) - %th= Cmtool::ContactForm.human_attribute_name(:email) - %th= Cmtool::ContactForm.human_attribute_name(:phone) - %th - %th - %tbody - - @contact_forms.each do |contact_form| - %tr - %td= contact_form.gender - %td= link_to contact_form.name, cmtool.contact_form_path(contact_form) - %td= contact_form.email - %td= contact_form.phone - = edit_td contact_form - = destroy_td contact_form -- else - = empty_result(Cmtool::ContactForm) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::ContactForm), cmtool.new_contact_form_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/contact_forms/index.html.slim b/app/views/cmtool/contact_forms/index.html.slim new file mode 100644 index 0000000..6c0b264 --- /dev/null +++ b/app/views/cmtool/contact_forms/index.html.slim @@ -0,0 +1,26 @@ +- title :index, Cmtool::ContactForm +- if @contact_forms.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::ContactForm.human_attribute_name(:gender) + th= Cmtool::ContactForm.human_attribute_name(:name) + th= Cmtool::ContactForm.human_attribute_name(:email) + th= Cmtool::ContactForm.human_attribute_name(:phone) + th + th + tbody + - @contact_forms.each do |contact_form| + tr + td= contact_form.gender + td= link_to contact_form.name, cmtool.contact_form_path(contact_form) + td= contact_form.email + td= contact_form.phone + = edit_td contact_form + = destroy_td contact_form +- else + = empty_result(Cmtool::ContactForm) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::ContactForm), cmtool.new_contact_form_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/contact_forms/new.html.haml b/app/views/cmtool/contact_forms/new.html.slim similarity index 53% rename from app/views/cmtool/contact_forms/new.html.haml rename to app/views/cmtool/contact_forms/new.html.slim index 8053acc..bf6da82 100644 --- a/app/views/cmtool/contact_forms/new.html.haml +++ b/app/views/cmtool/contact_forms/new.html.slim @@ -1,5 +1,5 @@ - title :new, Cmtool::ContactForm = render 'form', :submit => create_button_text(@contact_form) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path, class: [:btn] diff --git a/app/views/cmtool/contact_forms/show.html.haml b/app/views/cmtool/contact_forms/show.html.haml deleted file mode 100644 index bcabac2..0000000 --- a/app/views/cmtool/contact_forms/show.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -- title :show, Cmtool::ContactForm -.show_field - %strong= Cmtool::ContactForm.human_attribute_name(:gender) - = @contact_form.gender -.show_field - %strong= Cmtool::ContactForm.human_attribute_name(:name) - = @contact_form.name -.show_field - %strong= Cmtool::ContactForm.human_attribute_name(:email) - = @contact_form.email -.show_field - %strong= Cmtool::ContactForm.human_attribute_name(:phone) - = @contact_form.phone -.show_field - %strong= Cmtool::ContactForm.human_attribute_name(:body) - =raw @contact_form.body - -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@contact_form), cmtool.edit_contact_form_path(@contact_form), class: ['btn', 'btn-warning'] - %li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path, class: [:btn] diff --git a/app/views/cmtool/contact_forms/show.html.slim b/app/views/cmtool/contact_forms/show.html.slim new file mode 100644 index 0000000..0facd84 --- /dev/null +++ b/app/views/cmtool/contact_forms/show.html.slim @@ -0,0 +1,21 @@ +- title :show, Cmtool::ContactForm +.show_field + strong= Cmtool::ContactForm.human_attribute_name(:gender) + = @contact_form.gender +.show_field + strong= Cmtool::ContactForm.human_attribute_name(:name) + = @contact_form.name +.show_field + strong= Cmtool::ContactForm.human_attribute_name(:email) + = @contact_form.email +.show_field + strong= Cmtool::ContactForm.human_attribute_name(:phone) + = @contact_form.phone +.show_field + strong= Cmtool::ContactForm.human_attribute_name(:body) + =raw @contact_form.body + +- content_for :page_links do + ul + li= link_to link_to_edit_content(@contact_form), cmtool.edit_contact_form_path(@contact_form), class: ['btn', 'btn-warning'] + li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path, class: [:btn] diff --git a/app/views/cmtool/dashboard/index.html.haml b/app/views/cmtool/dashboard/index.html.haml deleted file mode 100644 index 1e04429..0000000 --- a/app/views/cmtool/dashboard/index.html.haml +++ /dev/null @@ -1 +0,0 @@ -Ik ben een klant diff --git a/app/views/cmtool/dashboard/index.html.slim b/app/views/cmtool/dashboard/index.html.slim new file mode 100644 index 0000000..e9c024a --- /dev/null +++ b/app/views/cmtool/dashboard/index.html.slim @@ -0,0 +1 @@ +| Ik ben een klant diff --git a/app/views/cmtool/directories/_form.html.haml b/app/views/cmtool/directories/_form.html.slim similarity index 100% rename from app/views/cmtool/directories/_form.html.haml rename to app/views/cmtool/directories/_form.html.slim diff --git a/app/views/cmtool/directories/_image.html.haml b/app/views/cmtool/directories/_image.html.haml deleted file mode 100644 index 48dc2a3..0000000 --- a/app/views/cmtool/directories/_image.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%tr - %td.image.thumb= link_to(image_tag(image.file.url(:thumb)), cmtool.image_path(image)) - %td= link_to image.clean_name, cmtool.image_path(image) - %td - %td.action.destroy.directory= link_to link_to_destroy_content(image), cmtool.image_path(image), :method => :delete, :confirm => are_you_sure(image) diff --git a/app/views/cmtool/directories/_image.html.slim b/app/views/cmtool/directories/_image.html.slim new file mode 100644 index 0000000..7158db8 --- /dev/null +++ b/app/views/cmtool/directories/_image.html.slim @@ -0,0 +1,5 @@ +tr + td.image.thumb= link_to(image_tag(image.file.url(:thumb)), cmtool.image_path(image)) + td= link_to image.clean_name, cmtool.image_path(image) + td + td.action.destroy.directory= link_to link_to_destroy_content(image), cmtool.image_path(image), :method => :delete, :confirm => are_you_sure(image) diff --git a/app/views/cmtool/directories/edit.html.haml b/app/views/cmtool/directories/edit.html.haml deleted file mode 100644 index 5c43f93..0000000 --- a/app/views/cmtool/directories/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, Cmtool::Directory -= render 'form', :submit => update_button_text(@directory) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@directory), cmtool.directory_path(@directory), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path, class: [:btn] diff --git a/app/views/cmtool/directories/edit.html.slim b/app/views/cmtool/directories/edit.html.slim new file mode 100644 index 0000000..0f6749a --- /dev/null +++ b/app/views/cmtool/directories/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, Cmtool::Directory += render 'form', :submit => update_button_text(@directory) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@directory), cmtool.directory_path(@directory), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path, class: [:btn] diff --git a/app/views/cmtool/directories/index.html.haml b/app/views/cmtool/directories/index.html.haml deleted file mode 100644 index 00950ea..0000000 --- a/app/views/cmtool/directories/index.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- title :index, Cmtool::Directory -- if @directories.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::Directory.human_attribute_name(:name) - %th - %th - %tbody - - @directories.each do |directory| - %tr - %td= link_to directory.name, cmtool.directory_path(directory) - = edit_td directory - = destroy_td directory -- else - = empty_result(Cmtool::Directory) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::Directory), cmtool.new_directory_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/directories/index.html.slim b/app/views/cmtool/directories/index.html.slim new file mode 100644 index 0000000..bfc5515 --- /dev/null +++ b/app/views/cmtool/directories/index.html.slim @@ -0,0 +1,20 @@ +- title :index, Cmtool::Directory +- if @directories.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::Directory.human_attribute_name(:name) + th + th + tbody + - @directories.each do |directory| + tr + td= link_to directory.name, cmtool.directory_path(directory) + = edit_td directory + = destroy_td directory +- else + = empty_result(Cmtool::Directory) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::Directory), cmtool.new_directory_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/directories/new.html.haml b/app/views/cmtool/directories/new.html.slim similarity index 53% rename from app/views/cmtool/directories/new.html.haml rename to app/views/cmtool/directories/new.html.slim index 849a10e..84cb21c 100644 --- a/app/views/cmtool/directories/new.html.haml +++ b/app/views/cmtool/directories/new.html.slim @@ -3,5 +3,5 @@ = render 'form', :submit => create_button_text(@directory) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path, class: [:btn] diff --git a/app/views/cmtool/directories/show.html.haml b/app/views/cmtool/directories/show.html.haml deleted file mode 100644 index 3f04d73..0000000 --- a/app/views/cmtool/directories/show.html.haml +++ /dev/null @@ -1,36 +0,0 @@ -- title :show, Cmtool::Directory -- content_for :onload_javascript do - $('.add-image-container').dialog({modal: true, autoOpen: false, width: 400}) -#add-image-container.modal.hide.fade - .modal-header= t('cmtool.directory.add_file') - = form_for [cmtool, Cmtool::Image.new(directory_id: @directory.id)], :html => { :multipart => true, :id => 'add_image_form' } do |f| - .modal-body - = f.hidden_field :directory_id - = f.file_field :file - .modal-footer - %a.btn.btn-inverse{href: '#', role: :button, data: {dismiss: :modal}, 'aria-hidden' => true} x - = f.submit t('cmtool.directory.add_image.label', image: Cmtool::Image.model_name.human), class: ['btn', 'btn-success'] -.directory.caption= "/#{@directory.tree_path.map{|d| link_to(d.name, cmtool.directory_path(d))}.join('/')}".html_safe -%table#directory-view.table.table-striped.table-hover - %thead - %tbody - %tr - %td.directory.parent= link_to '..', (@directory.parent ? cmtool.directory_path(@directory.parent) : cmtool.directories_path) - %td - %td - %td - - for child in @directory.children - %tr - %td.directory.child= link_to child.name, cmtool.directory_path(child) - %td - %td - %td.action.destroy.directory= link_to link_to_destroy_content(child), cmtool.directory_path(child), :method => :delete, :confirm => are_you_sure(child) - - for image in @directory.images - = render 'image', :image => image -- content_for :page_links do - %ul - - if @directory.parent - %li= link_to '..', cmtool.directory_path(@directory.parent) - %li= link_to link_to_edit_content(@directory), cmtool.edit_directory_path(@directory), class: ['btn', 'btn-warning'] - %li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path, class: [:btn] - %li= link_to t('cmtool.directory.add_file'), '#add-image-container', class: ['btn', 'btn-success'], role: :button, data: {toggle: :modal} diff --git a/app/views/cmtool/directories/show.html.slim b/app/views/cmtool/directories/show.html.slim new file mode 100644 index 0000000..198cea2 --- /dev/null +++ b/app/views/cmtool/directories/show.html.slim @@ -0,0 +1,36 @@ +- title :show, Cmtool::Directory +- content_for :onload_javascript do + | $('.add-image-container').dialog({modal: true, autoOpen: false, width: 400}) +#add-image-container.modal.hide.fade + .modal-header= t('cmtool.directory.add_file') + = form_for [cmtool, Cmtool::Image.new(directory_id: @directory.id)], :html => { :multipart => true, :id => 'add_image_form' } do |f| + .modal-body + = f.hidden_field :directory_id + = f.file_field :file + .modal-footer + a.btn.btn-inverse href: '#', role: :button, data: {dismiss: :modal}, 'aria-hidden' => true x + = f.submit t('cmtool.directory.add_image.label', image: Cmtool::Image.model_name.human), class: ['btn', 'btn-success'] +.directory.caption= "/# @directory.tree_path.map{|d| link_to(d.name, cmtool.directory_path(d))}.join('/') ".html_safe +table#directory-view.table.table-striped.table-hover + thead + tbody + tr + td.directory.parent= link_to '..', (@directory.parent ? cmtool.directory_path(@directory.parent) : cmtool.directories_path) + td + td + td + - for child in @directory.children + tr + td.directory.child= link_to child.name, cmtool.directory_path(child) + td + td + td.action.destroy.directory= link_to link_to_destroy_content(child), cmtool.directory_path(child), :method => :delete, :confirm => are_you_sure(child) + - for image in @directory.images + = render 'image', :image => image +- content_for :page_links do + ul + - if @directory.parent + li= link_to '..', cmtool.directory_path(@directory.parent) + li= link_to link_to_edit_content(@directory), cmtool.edit_directory_path(@directory), class: ['btn', 'btn-warning'] + li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path, class: [:btn] + li= link_to t('cmtool.directory.add_file'), '#add-image-container', class: ['btn', 'btn-success'], role: :button, data: toggle: :modal diff --git a/app/views/cmtool/faqs/_form.html.haml b/app/views/cmtool/faqs/_form.html.slim similarity index 100% rename from app/views/cmtool/faqs/_form.html.haml rename to app/views/cmtool/faqs/_form.html.slim diff --git a/app/views/cmtool/faqs/edit.html.haml b/app/views/cmtool/faqs/edit.html.haml deleted file mode 100644 index 194d418..0000000 --- a/app/views/cmtool/faqs/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, @faq -= render 'form', :submit => update_button_text(@faq) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@faq), cmtool.faq_path(@faq), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] diff --git a/app/views/cmtool/faqs/edit.html.slim b/app/views/cmtool/faqs/edit.html.slim new file mode 100644 index 0000000..9ae7a3a --- /dev/null +++ b/app/views/cmtool/faqs/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, @faq += render 'form', :submit => update_button_text(@faq) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@faq), cmtool.faq_path(@faq), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] diff --git a/app/views/cmtool/faqs/index.html.haml b/app/views/cmtool/faqs/index.html.haml deleted file mode 100644 index 1f8ff1c..0000000 --- a/app/views/cmtool/faqs/index.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -- title :index, Cmtool::Faq -- if @faqs.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::Faq.human_attribute_name(:question) - %th= Cmtool::Faq.human_attribute_name(:answer) - %th - %th - %tbody - - @faqs.each do |faq| - %tr - %td= link_to raw(truncate(faq.question, :length => 40)), cmtool.faq_path(faq) - %td= link_to raw(truncate(faq.answer, :length => 40)), cmtool.faq_path(faq) - = edit_td faq - = destroy_td faq -- else - = empty_result(Cmtool::Faq) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::Faq), cmtool.new_faq_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/faqs/index.html.slim b/app/views/cmtool/faqs/index.html.slim new file mode 100644 index 0000000..4557c9e --- /dev/null +++ b/app/views/cmtool/faqs/index.html.slim @@ -0,0 +1,22 @@ +- title :index, Cmtool::Faq +- if @faqs.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::Faq.human_attribute_name(:question) + th= Cmtool::Faq.human_attribute_name(:answer) + th + th + tbody + - @faqs.each do |faq| + tr + td= link_to raw(truncate(faq.question, :length => 40)), cmtool.faq_path(faq) + td= link_to raw(truncate(faq.answer, :length => 40)), cmtool.faq_path(faq) + = edit_td faq + = destroy_td faq +- else + = empty_result(Cmtool::Faq) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::Faq), cmtool.new_faq_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/faqs/new.html.haml b/app/views/cmtool/faqs/new.html.slim similarity index 54% rename from app/views/cmtool/faqs/new.html.haml rename to app/views/cmtool/faqs/new.html.slim index 6fea2af..852e3ab 100644 --- a/app/views/cmtool/faqs/new.html.haml +++ b/app/views/cmtool/faqs/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@faq) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] diff --git a/app/views/cmtool/faqs/show.html.haml b/app/views/cmtool/faqs/show.html.haml deleted file mode 100644 index ab71a14..0000000 --- a/app/views/cmtool/faqs/show.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -- title :show, Cmtool::Faq -.show_field - %strong= Cmtool::Faq.human_attribute_name(:question) - =raw @faq.question -.show_field - %strong= Cmtool::Faq.human_attribute_name(:answer) - =raw @faq.answer - -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@faq), cmtool.edit_faq_path(@faq), class: ['btn', 'btn-warning'] - - %li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] diff --git a/app/views/cmtool/faqs/show.html.slim b/app/views/cmtool/faqs/show.html.slim new file mode 100644 index 0000000..9364de0 --- /dev/null +++ b/app/views/cmtool/faqs/show.html.slim @@ -0,0 +1,13 @@ +- title :show, Cmtool::Faq +.show_field + strong= Cmtool::Faq.human_attribute_name(:question) + =raw @faq.question +.show_field + strong= Cmtool::Faq.human_attribute_name(:answer) + =raw @faq.answer + +- content_for :page_links do + ul + li= link_to link_to_edit_content(@faq), cmtool.edit_faq_path(@faq), class: ['btn', 'btn-warning'] + + li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] diff --git a/app/views/cmtool/images/_form.html.haml b/app/views/cmtool/images/_form.html.slim similarity index 100% rename from app/views/cmtool/images/_form.html.haml rename to app/views/cmtool/images/_form.html.slim diff --git a/app/views/cmtool/images/edit.html.haml b/app/views/cmtool/images/edit.html.haml deleted file mode 100644 index ddf6e59..0000000 --- a/app/views/cmtool/images/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, Cmtool::Image -= render 'form', :submit => update_button_text(@image) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@image), cmtool.image_path(@image), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path, class: [:btn] diff --git a/app/views/cmtool/images/edit.html.slim b/app/views/cmtool/images/edit.html.slim new file mode 100644 index 0000000..57e9ab6 --- /dev/null +++ b/app/views/cmtool/images/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, Cmtool::Image += render 'form', :submit => update_button_text(@image) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@image), cmtool.image_path(@image), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path, class: [:btn] diff --git a/app/views/cmtool/images/index.html.haml b/app/views/cmtool/images/index.html.haml deleted file mode 100644 index 0b5668e..0000000 --- a/app/views/cmtool/images/index.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -- title :index, Cmtool::Image -- if @images.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::Image.model_name.human - %th= Cmtool::Image.human_attribute_name(:file_file_name) - %th= Cmtool::Image.human_attribute_name(:file_content_type) - %th= Cmtool::Image.human_attribute_name(:file_file_size) - %th= Cmtool::Image.human_attribute_name(:file_updated_at) - %th - %th - %tbody - - @images.each do |image| - %tr - %td - - if image.file? - = link_to(image_tag(image.file.url(:thumb)), cmtool.image_path(image)) - %td= link_to image.file_file_name, cmtool.image_path(image) - %td= image.file_content_type - %td= human_size image.file_file_size - %td= l image.file_updated_at, :format => :short - = edit_td image - = destroy_td image -- else - = empty_result(Cmtool::Image) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::Image), cmtool.new_image_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/images/index.html.slim b/app/views/cmtool/images/index.html.slim new file mode 100644 index 0000000..0d73881 --- /dev/null +++ b/app/views/cmtool/images/index.html.slim @@ -0,0 +1,30 @@ +- title :index, Cmtool::Image +- if @images.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::Image.model_name.human + th= Cmtool::Image.human_attribute_name(:file_file_name) + th= Cmtool::Image.human_attribute_name(:file_content_type) + th= Cmtool::Image.human_attribute_name(:file_file_size) + th= Cmtool::Image.human_attribute_name(:file_updated_at) + th + th + tbody + - @images.each do |image| + tr + td + - if image.file? + = link_to(image_tag(image.file.url(:thumb)), cmtool.image_path(image)) + td= link_to image.file_file_name, cmtool.image_path(image) + td= image.file_content_type + td= human_size image.file_file_size + td= l image.file_updated_at, :format => :short + = edit_td image + = destroy_td image +- else + = empty_result(Cmtool::Image) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::Image), cmtool.new_image_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/images/new.html.haml b/app/views/cmtool/images/new.html.slim similarity index 54% rename from app/views/cmtool/images/new.html.haml rename to app/views/cmtool/images/new.html.slim index 86ea208..2620c84 100644 --- a/app/views/cmtool/images/new.html.haml +++ b/app/views/cmtool/images/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@image) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path, class: [:btn] diff --git a/app/views/cmtool/images/show.html.haml b/app/views/cmtool/images/show.html.haml deleted file mode 100644 index b49dd6b..0000000 --- a/app/views/cmtool/images/show.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -- title :show, Cmtool::Image -.show_field - - if @image.file? - = image_tag @image.file.url(:page) -.show_field - %strong= Cmtool::Image.human_attribute_name(:file_file_name) - = @image.file_file_name -.show_field - %strong= Cmtool::Image.human_attribute_name(:file_content_type) - = @image.file_content_type -.show_field - %strong= Cmtool::Image.human_attribute_name(:file_file_size) - = human_size @image.file_file_size -.show_field - %strong= Cmtool::Image.human_attribute_name(:file_updated_at) - = @image.file_updated_at - -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@image), cmtool.edit_image_path(@image), class: ['btn', 'btn-warning'] - %li= link_to link_to_new_content(Cmtool::Image), cmtool.new_image_path, class: ['btn', 'btn-primary'] - %li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path, class: [:btn] diff --git a/app/views/cmtool/images/show.html.slim b/app/views/cmtool/images/show.html.slim new file mode 100644 index 0000000..ffa4e11 --- /dev/null +++ b/app/views/cmtool/images/show.html.slim @@ -0,0 +1,22 @@ +- title :show, Cmtool::Image +.show_field + - if @image.file? + = image_tag @image.file.url(:page) +.show_field + strong= Cmtool::Image.human_attribute_name(:file_file_name) + = @image.file_file_name +.show_field + strong= Cmtool::Image.human_attribute_name(:file_content_type) + = @image.file_content_type +.show_field + strong= Cmtool::Image.human_attribute_name(:file_file_size) + = human_size @image.file_file_size +.show_field + strong= Cmtool::Image.human_attribute_name(:file_updated_at) + = @image.file_updated_at + +- content_for :page_links do + ul + li= link_to link_to_edit_content(@image), cmtool.edit_image_path(@image), class: ['btn', 'btn-warning'] + li= link_to link_to_new_content(Cmtool::Image), cmtool.new_image_path, class: ['btn', 'btn-primary'] + li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path, class: [:btn] diff --git a/app/views/cmtool/keywords/_form.html.haml b/app/views/cmtool/keywords/_form.html.slim similarity index 100% rename from app/views/cmtool/keywords/_form.html.haml rename to app/views/cmtool/keywords/_form.html.slim diff --git a/app/views/cmtool/keywords/_habtm.html.haml b/app/views/cmtool/keywords/_habtm.html.slim similarity index 88% rename from app/views/cmtool/keywords/_habtm.html.haml rename to app/views/cmtool/keywords/_habtm.html.slim index d218c62..664823d 100644 --- a/app/views/cmtool/keywords/_habtm.html.haml +++ b/app/views/cmtool/keywords/_habtm.html.slim @@ -1,4 +1,4 @@ -%h4= Cmtool::Keyword.model_name.human.pluralize +h4= Cmtool::Keyword.model_name.human.pluralize = hidden_field_tag "#{subject.class.name.underscore.sub(/.*\//, '')}[keyword_ids][]", nil - for keyword in Cmtool::Keyword.all .keyword_container diff --git a/app/views/cmtool/keywords/edit.html.haml b/app/views/cmtool/keywords/edit.html.haml deleted file mode 100644 index 61041b2..0000000 --- a/app/views/cmtool/keywords/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, Cmtool::Keyword -= render 'form', :submit => update_button_text(@keyword) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@keyword), cmtool.keyword_path(@keyword), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path, class: [:btn] diff --git a/app/views/cmtool/keywords/edit.html.slim b/app/views/cmtool/keywords/edit.html.slim new file mode 100644 index 0000000..1264efa --- /dev/null +++ b/app/views/cmtool/keywords/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, Cmtool::Keyword += render 'form', :submit => update_button_text(@keyword) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@keyword), cmtool.keyword_path(@keyword), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path, class: [:btn] diff --git a/app/views/cmtool/keywords/index.html.haml b/app/views/cmtool/keywords/index.html.haml deleted file mode 100644 index 83a9614..0000000 --- a/app/views/cmtool/keywords/index.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- title :index, Cmtool::Keyword -- if @keywords.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::Keyword.human_attribute_name(:name) - %th - %th - %tbody - - @keywords.each do |keyword| - %tr - %td= link_to keyword.name, cmtool.keyword_path(keyword) - = edit_td keyword - = destroy_td keyword -- else - = empty_result(Cmtool::Keyword) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::Keyword), cmtool.new_keyword_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/keywords/index.html.slim b/app/views/cmtool/keywords/index.html.slim new file mode 100644 index 0000000..a6f3c8e --- /dev/null +++ b/app/views/cmtool/keywords/index.html.slim @@ -0,0 +1,20 @@ +- title :index, Cmtool::Keyword +- if @keywords.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::Keyword.human_attribute_name(:name) + th + th + tbody + - @keywords.each do |keyword| + tr + td= link_to keyword.name, cmtool.keyword_path(keyword) + = edit_td keyword + = destroy_td keyword +- else + = empty_result(Cmtool::Keyword) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::Keyword), cmtool.new_keyword_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/keywords/new.html.haml b/app/views/cmtool/keywords/new.html.slim similarity index 50% rename from app/views/cmtool/keywords/new.html.haml rename to app/views/cmtool/keywords/new.html.slim index bc0941a..a52d2cb 100644 --- a/app/views/cmtool/keywords/new.html.haml +++ b/app/views/cmtool/keywords/new.html.slim @@ -3,5 +3,5 @@ = render 'form', :submit => create_button_text(@keyword) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path, class: ['btn', 'btn-warning'] + ul + li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path, class: ['btn', 'btn-warning'] diff --git a/app/views/cmtool/keywords/show.html.haml b/app/views/cmtool/keywords/show.html.haml deleted file mode 100644 index e9a7c34..0000000 --- a/app/views/cmtool/keywords/show.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- title :show, Cmtool::Keyword -.show_field - %strong= Cmtool::Keyword.human_attribute_name(:name) - = @keyword.name - -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@keyword), cmtool.edit_keyword_path(@keyword), class: ['btn', 'btn-warning'] - %li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path, class: [:btn] diff --git a/app/views/cmtool/keywords/show.html.slim b/app/views/cmtool/keywords/show.html.slim new file mode 100644 index 0000000..1b27665 --- /dev/null +++ b/app/views/cmtool/keywords/show.html.slim @@ -0,0 +1,9 @@ +- title :show, Cmtool::Keyword +.show_field + strong= Cmtool::Keyword.human_attribute_name(:name) + = @keyword.name + +- content_for :page_links do + ul + li= link_to link_to_edit_content(@keyword), cmtool.edit_keyword_path(@keyword), class: ['btn', 'btn-warning'] + li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path, class: [:btn] diff --git a/app/views/cmtool/news/_form.html.haml b/app/views/cmtool/news/_form.html.slim similarity index 96% rename from app/views/cmtool/news/_form.html.haml rename to app/views/cmtool/news/_form.html.slim index 6477be1..980a897 100644 --- a/app/views/cmtool/news/_form.html.haml +++ b/app/views/cmtool/news/_form.html.slim @@ -9,7 +9,7 @@ .field = f.label :date = f.text_field :date - (yyyy-mm-dd) + | (yyyy-mm-dd) .field = f.label :body = f.text_area :body, :class => 'editor_full' diff --git a/app/views/cmtool/news/edit.html.haml b/app/views/cmtool/news/edit.html.haml deleted file mode 100644 index 4ddd938..0000000 --- a/app/views/cmtool/news/edit.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- title :edit, Cmtool::News -- if @news.image? - = link_to image_tag(@news.image.url(:thumb)), @news.image.url -= render 'form', :submit => update_button_text(@news) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@news), cmtool.news_path(@news), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path, class: [:btn] diff --git a/app/views/cmtool/news/edit.html.slim b/app/views/cmtool/news/edit.html.slim new file mode 100644 index 0000000..c169dda --- /dev/null +++ b/app/views/cmtool/news/edit.html.slim @@ -0,0 +1,9 @@ +- title :edit, Cmtool::News +- if @news.image? + = link_to image_tag(@news.image.url(:thumb)), @news.image.url += render 'form', :submit => update_button_text(@news) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@news), cmtool.news_path(@news), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path, class: [:btn] diff --git a/app/views/cmtool/news/index.html.haml b/app/views/cmtool/news/index.html.haml deleted file mode 100644 index 889e378..0000000 --- a/app/views/cmtool/news/index.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -- title :index, Cmtool::News -- if @news.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::News.human_attribute_name(:title) - %th= Cmtool::News.human_attribute_name(:active) - %th= Cmtool::News.human_attribute_name(:date) - %th - %th - %tbody - - @news.each do |news| - %tr - %td= link_to news.title, cmtool.news_path(news) - %td= boolean_text news.active? - %td=l news.date - = edit_td news - = destroy_td news -- else - = empty_result(Cmtool::News) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::News), cmtool.new_news_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/news/index.html.slim b/app/views/cmtool/news/index.html.slim new file mode 100644 index 0000000..02dbc69 --- /dev/null +++ b/app/views/cmtool/news/index.html.slim @@ -0,0 +1,24 @@ +- title :index, Cmtool::News +- if @news.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::News.human_attribute_name(:title) + th= Cmtool::News.human_attribute_name(:active) + th= Cmtool::News.human_attribute_name(:date) + th + th + tbody + - @news.each do |news| + tr + td= link_to news.title, cmtool.news_path(news) + td= boolean_text news.active? + td=l news.date + = edit_td news + = destroy_td news +- else + = empty_result(Cmtool::News) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::News), cmtool.new_news_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/news/new.html.haml b/app/views/cmtool/news/new.html.slim similarity index 53% rename from app/views/cmtool/news/new.html.haml rename to app/views/cmtool/news/new.html.slim index 508588b..a42b1d4 100644 --- a/app/views/cmtool/news/new.html.haml +++ b/app/views/cmtool/news/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@news) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path, class: [:btn] diff --git a/app/views/cmtool/news/show.html.haml b/app/views/cmtool/news/show.html.haml deleted file mode 100644 index 842d2e3..0000000 --- a/app/views/cmtool/news/show.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -- title :show, Cmtool::News -- if @news.image? - #news-image-container - = link_to image_tag(@news.image.url(:thumb)), @news.image.url - = link_to t('cmtool.news.remove_image'), cmtool.remove_image_news_path(@news), :method => :delete, :confirm => are_you_sure(), :remote => true -.show_field - %strong= Cmtool::News.human_attribute_name(:title) - = @news.title -.show_field - %strong= Cmtool::News.human_attribute_name(:active) - = boolean_text @news.active? -.show_field - %strong= Cmtool::News.human_attribute_name(:date) - =l @news.date -.show_field - %strong= Cmtool::Keyword.model_name.human.pluralize - %ul - - for keyword in @news.keywords - %li.keyword_show= keyword.name -.show_field - %strong= Cmtool::News.human_attribute_name(:body) - =raw @news.body - - -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@news), cmtool.edit_news_path(@news), class: ['btn', 'btn-warning'] - %li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path, class: [:btn] diff --git a/app/views/cmtool/news/show.html.slim b/app/views/cmtool/news/show.html.slim new file mode 100644 index 0000000..a15dedc --- /dev/null +++ b/app/views/cmtool/news/show.html.slim @@ -0,0 +1,28 @@ +- title :show, Cmtool::News +- if @news.image? + #news-image-container + = link_to image_tag(@news.image.url(:thumb)), @news.image.url + = link_to t('cmtool.news.remove_image'), cmtool.remove_image_news_path(@news), :method => :delete, :confirm => are_you_sure(), :remote => true +.show_field + strong= Cmtool::News.human_attribute_name(:title) + = @news.title +.show_field + strong= Cmtool::News.human_attribute_name(:active) + = boolean_text @news.active? +.show_field + strong= Cmtool::News.human_attribute_name(:date) + =l @news.date +.show_field + strong= Cmtool::Keyword.model_name.human.pluralize + ul + - for keyword in @news.keywords + li.keyword_show= keyword.name +.show_field + strong= Cmtool::News.human_attribute_name(:body) + =raw @news.body + + +- content_for :page_links do + ul + li= link_to link_to_edit_content(@news), cmtool.edit_news_path(@news), class: ['btn', 'btn-warning'] + li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path, class: [:btn] diff --git a/app/views/cmtool/newsletter_subscriptions/_form.html.haml b/app/views/cmtool/newsletter_subscriptions/_form.html.slim similarity index 100% rename from app/views/cmtool/newsletter_subscriptions/_form.html.haml rename to app/views/cmtool/newsletter_subscriptions/_form.html.slim diff --git a/app/views/cmtool/newsletter_subscriptions/edit.html.haml b/app/views/cmtool/newsletter_subscriptions/edit.html.haml deleted file mode 100644 index 38cde4b..0000000 --- a/app/views/cmtool/newsletter_subscriptions/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, Cmtool::NewsletterSubscription -= render 'form', :submit => update_button_text(@newsletter_subscription) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@newsletter_subscription), cmtool.newsletter_subscription_path(@newsletter_subscription), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path, class: [:btn] diff --git a/app/views/cmtool/newsletter_subscriptions/edit.html.slim b/app/views/cmtool/newsletter_subscriptions/edit.html.slim new file mode 100644 index 0000000..0a50376 --- /dev/null +++ b/app/views/cmtool/newsletter_subscriptions/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, Cmtool::NewsletterSubscription += render 'form', :submit => update_button_text(@newsletter_subscription) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@newsletter_subscription), cmtool.newsletter_subscription_path(@newsletter_subscription), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path, class: [:btn] diff --git a/app/views/cmtool/newsletter_subscriptions/index.html.haml b/app/views/cmtool/newsletter_subscriptions/index.html.haml deleted file mode 100644 index f9f55fe..0000000 --- a/app/views/cmtool/newsletter_subscriptions/index.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -- title :index, Cmtool::NewsletterSubscription -- if @newsletter_subscriptions.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::NewsletterSubscription.human_attribute_name(:email) - %th= Cmtool::NewsletterSubscription.human_attribute_name(:deactivation_token) - %th= Cmtool::NewsletterSubscription.human_attribute_name(:active) - %th - %th - %tbody - - @newsletter_subscriptions.each do |newsletter_subscription| - %tr - %td= newsletter_subscription.email - %td= newsletter_subscription.deactivation_token - %td= boolean_text newsletter_subscription.active - = edit_td newsletter_subscription - = destroy_td newsletter_subscription -- else - = empty_result(Cmtool::NewsletterSubscription) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::NewsletterSubscription), cmtool.new_newsletter_subscription_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/newsletter_subscriptions/index.html.slim b/app/views/cmtool/newsletter_subscriptions/index.html.slim new file mode 100644 index 0000000..def1fd8 --- /dev/null +++ b/app/views/cmtool/newsletter_subscriptions/index.html.slim @@ -0,0 +1,24 @@ +- title :index, Cmtool::NewsletterSubscription +- if @newsletter_subscriptions.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::NewsletterSubscription.human_attribute_name(:email) + th= Cmtool::NewsletterSubscription.human_attribute_name(:deactivation_token) + th= Cmtool::NewsletterSubscription.human_attribute_name(:active) + th + th + tbody + - @newsletter_subscriptions.each do |newsletter_subscription| + tr + td= newsletter_subscription.email + td= newsletter_subscription.deactivation_token + td= boolean_text newsletter_subscription.active + = edit_td newsletter_subscription + = destroy_td newsletter_subscription +- else + = empty_result(Cmtool::NewsletterSubscription) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::NewsletterSubscription), cmtool.new_newsletter_subscription_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/newsletter_subscriptions/new.html.haml b/app/views/cmtool/newsletter_subscriptions/new.html.slim similarity index 53% rename from app/views/cmtool/newsletter_subscriptions/new.html.haml rename to app/views/cmtool/newsletter_subscriptions/new.html.slim index 446772c..e721cea 100644 --- a/app/views/cmtool/newsletter_subscriptions/new.html.haml +++ b/app/views/cmtool/newsletter_subscriptions/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@newsletter_subscription) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path, class: [:btn] diff --git a/app/views/cmtool/newsletter_subscriptions/show.html.haml b/app/views/cmtool/newsletter_subscriptions/show.html.haml deleted file mode 100644 index f7f523e..0000000 --- a/app/views/cmtool/newsletter_subscriptions/show.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -- title :show, Cmtool::NewsletterSubscription -.show_field - %strong= Cmtool::NewsletterSubscription.human_attribute_name(:email) - = @newsletter_subscription.email -.show_field - %strong= Cmtool::NewsletterSubscription.human_attribute_name(:deactivation_token) - = @newsletter_subscription.deactivation_token -.show_field - %strong= Cmtool::NewsletterSubscription.human_attribute_name(:active) - = boolean_text @newsletter_subscription.active - -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@newsletter_subscription), cmtool.edit_newsletter_subscription_path(@newsletter_subscription), class: ['btn', 'btn-warning'] - %li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path, class: [:btn] diff --git a/app/views/cmtool/newsletter_subscriptions/show.html.slim b/app/views/cmtool/newsletter_subscriptions/show.html.slim new file mode 100644 index 0000000..01eb649 --- /dev/null +++ b/app/views/cmtool/newsletter_subscriptions/show.html.slim @@ -0,0 +1,15 @@ +- title :show, Cmtool::NewsletterSubscription +.show_field + strong= Cmtool::NewsletterSubscription.human_attribute_name(:email) + = @newsletter_subscription.email +.show_field + strong= Cmtool::NewsletterSubscription.human_attribute_name(:deactivation_token) + = @newsletter_subscription.deactivation_token +.show_field + strong= Cmtool::NewsletterSubscription.human_attribute_name(:active) + = boolean_text @newsletter_subscription.active + +- content_for :page_links do + ul + li= link_to link_to_edit_content(@newsletter_subscription), cmtool.edit_newsletter_subscription_path(@newsletter_subscription), class: ['btn', 'btn-warning'] + li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path, class: [:btn] diff --git a/app/views/cmtool/pages/_nested_pages.html.haml b/app/views/cmtool/pages/_nested_pages.html.haml deleted file mode 100644 index a5ccb73..0000000 --- a/app/views/cmtool/pages/_nested_pages.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -- pages.each do |page| - %tr - %td= link_to ' - '*page.tree_depth + page.name, cmtool.edit_page_path(page) - %td= page.title - %td.locale{class: "locale-#{page.locale}"}= page.locale - %td= boolean_text controller.template_exists?("pages/#{page.name}") - %td= boolean_text page.in_menu? - %th= page.tree_path.map(&:position).map(&:to_s).join('.') - - if children = page.children.presence - = render 'nested_pages', pages: children diff --git a/app/views/cmtool/pages/_nested_pages.html.slim b/app/views/cmtool/pages/_nested_pages.html.slim new file mode 100644 index 0000000..47f3b2e --- /dev/null +++ b/app/views/cmtool/pages/_nested_pages.html.slim @@ -0,0 +1,10 @@ +- pages.each do |page| + tr + td= link_to ' - '*page.tree_depth + page.name, cmtool.edit_page_path(page) + td= page.title + td.locale class: "locale-#{page.locale}" = page.locale + td= boolean_text controller.template_exists?("pages/# page.name ") + td= boolean_text page.in_menu? + th= page.tree_path.map(&:position).map(&:to_s).join('.') + - if children = page.children.presence + = render 'nested_pages', pages: children diff --git a/app/views/cmtool/pages/edit.html.haml b/app/views/cmtool/pages/edit.html.haml deleted file mode 100644 index 5ec33da..0000000 --- a/app/views/cmtool/pages/edit.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- title :edit, Page -= render 'form', :submit => update_button_text(@page) - -- content_for :page_links do - %ul - %li= link_to link_to_index_content(Page), cmtool.pages_path, class: [:btn] - %li= link_to link_to_show_content(@page), cmtool.page_path(@page), class: ['btn', 'btn-info'] - %li= link_to link_to_edit_content(@page), cmtool.edit_page_path(@page), class: ['btn', 'btn-warning'] - %li= link_to link_to_destroy_content(@page), cmtool.page_path(@page), :confirm => are_you_sure?(@page), :method => :delete, class: ['btn', 'btn-danger'] diff --git a/app/views/cmtool/pages/edit.html.slim b/app/views/cmtool/pages/edit.html.slim new file mode 100644 index 0000000..c4e5305 --- /dev/null +++ b/app/views/cmtool/pages/edit.html.slim @@ -0,0 +1,9 @@ +- title :edit, Page += render 'form', :submit => update_button_text(@page) + +- content_for :page_links do + ul + li= link_to link_to_index_content(Page), cmtool.pages_path, class: [:btn] + li= link_to link_to_show_content(@page), cmtool.page_path(@page), class: ['btn', 'btn-info'] + li= link_to link_to_edit_content(@page), cmtool.edit_page_path(@page), class: ['btn', 'btn-warning'] + li= link_to link_to_destroy_content(@page), cmtool.page_path(@page), :confirm => are_you_sure?(@page), :method => :delete, class: ['btn', 'btn-danger'] diff --git a/app/views/cmtool/pages/index.html.haml b/app/views/cmtool/pages/index.html.haml deleted file mode 100644 index 2519538..0000000 --- a/app/views/cmtool/pages/index.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -- title :index, Page -%table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Page.human_attribute_name(:name) - %th= Page.human_attribute_name(:title) - %th= Page.human_attribute_name(:locale) - %th= Page.human_attribute_name(:has_view) - %th= Page.human_attribute_name(:in_menu) - %th= Page.human_attribute_name(:position) - %th - %th - %tbody - = render 'nested_pages', pages: Page.full_tree(:nl) - = render 'nested_pages', pages: Page.full_tree(:en) - = render 'nested_pages', pages: Page.full_tree(:de) - = render 'nested_pages', pages: Page.full_tree(:es) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Page), cmtool.new_page_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/pages/index.html.slim b/app/views/cmtool/pages/index.html.slim new file mode 100644 index 0000000..cd895f5 --- /dev/null +++ b/app/views/cmtool/pages/index.html.slim @@ -0,0 +1,21 @@ +- title :index, Page +table.index-table.table.table-striped.table-hover + thead + tr + th= Page.human_attribute_name(:name) + th= Page.human_attribute_name(:title) + th= Page.human_attribute_name(:locale) + th= Page.human_attribute_name(:has_view) + th= Page.human_attribute_name(:in_menu) + th= Page.human_attribute_name(:position) + th + th + tbody + = render 'nested_pages', pages: Page.full_tree(:nl) + = render 'nested_pages', pages: Page.full_tree(:en) + = render 'nested_pages', pages: Page.full_tree(:de) + = render 'nested_pages', pages: Page.full_tree(:es) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Page), cmtool.new_page_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/pages/new.html.haml b/app/views/cmtool/pages/new.html.slim similarity index 54% rename from app/views/cmtool/pages/new.html.haml rename to app/views/cmtool/pages/new.html.slim index 36a7c28..0d84c34 100644 --- a/app/views/cmtool/pages/new.html.haml +++ b/app/views/cmtool/pages/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@page) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Page), cmtool.pages_path, class: [:btn] + ul + li= link_to link_to_index_content(Page), cmtool.pages_path, class: [:btn] diff --git a/app/views/cmtool/pages/show.html.haml b/app/views/cmtool/pages/show.html.haml deleted file mode 100644 index 7de7077..0000000 --- a/app/views/cmtool/pages/show.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -- title :show, Page -.show_field - %strong= Page.human_attribute_name(:name) - = @page.name -.show_field - %strong= Page.human_attribute_name(:menu_text) - = @page.menu_text -.show_field - %strong= Page.human_attribute_name(:title) - = @page.title -.show_field - %strong= Page.human_attribute_name(:body) - =raw @page.body -.show_field - %strong= Page.human_attribute_name(:footer) - =raw @page.footer -.show_field - %strong= Page.human_attribute_name(:sidebar) - =raw @page.sidebar -.show_field - %strong= Page.human_attribute_name(:parent) - = @page.parent -.show_field - %strong= Page.human_attribute_name(:position) - = @page.position -.show_field - %strong= Page.human_attribute_name(:layout) - = @page.layout -.show_field - %strong= Page.human_attribute_name(:has_view) - =# boolean_text template_exist?("pages/#{@page.name}") -.show_field - %strong= Page.human_attribute_name(:in_menu) - = boolean_text @page.in_menu? - -- content_for :page_links do - %ul - %li= link_to link_to_index_content(Page), cmtool.pages_path, class: [:btn] - %li= link_to link_to_edit_content(@page), cmtool.edit_page_path(@page), class: ['btn', 'btn-warning'] diff --git a/app/views/cmtool/pages/show.html.slim b/app/views/cmtool/pages/show.html.slim new file mode 100644 index 0000000..e603cd1 --- /dev/null +++ b/app/views/cmtool/pages/show.html.slim @@ -0,0 +1,39 @@ +- title :show, Page +.show_field + strong= Page.human_attribute_name(:name) + = @page.name +.show_field + strong= Page.human_attribute_name(:menu_text) + = @page.menu_text +.show_field + strong= Page.human_attribute_name(:title) + = @page.title +.show_field + strong= Page.human_attribute_name(:body) + =raw @page.body +.show_field + strong= Page.human_attribute_name(:footer) + =raw @page.footer +.show_field + strong= Page.human_attribute_name(:sidebar) + =raw @page.sidebar +.show_field + strong= Page.human_attribute_name(:parent) + = @page.parent +.show_field + strong= Page.human_attribute_name(:position) + = @page.position +.show_field + strong= Page.human_attribute_name(:layout) + = @page.layout +.show_field + strong= Page.human_attribute_name(:has_view) + =# boolean_text template_exist?("pages/#{@page.name}") +.show_field + strong= Page.human_attribute_name(:in_menu) + = boolean_text @page.in_menu? + +- content_for :page_links do + ul + li= link_to link_to_index_content(Page), cmtool.pages_path, class: [:btn] + li= link_to link_to_edit_content(@page), cmtool.edit_page_path(@page), class: ['btn', 'btn-warning'] diff --git a/app/views/cmtool/quotes/_form.html.haml b/app/views/cmtool/quotes/_form.html.slim similarity index 100% rename from app/views/cmtool/quotes/_form.html.haml rename to app/views/cmtool/quotes/_form.html.slim diff --git a/app/views/cmtool/quotes/edit.html.haml b/app/views/cmtool/quotes/edit.html.haml deleted file mode 100644 index 3ed3448..0000000 --- a/app/views/cmtool/quotes/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- title :edit, Cmtool::Quote -= render 'form', :submit => update_button_text(@quote) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@quote), cmtool.quote_path(@quote), class: ['btn', 'btn-info'] - %li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path, class: [:btn] diff --git a/app/views/cmtool/quotes/edit.html.slim b/app/views/cmtool/quotes/edit.html.slim new file mode 100644 index 0000000..5729421 --- /dev/null +++ b/app/views/cmtool/quotes/edit.html.slim @@ -0,0 +1,7 @@ +- title :edit, Cmtool::Quote += render 'form', :submit => update_button_text(@quote) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@quote), cmtool.quote_path(@quote), class: ['btn', 'btn-info'] + li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path, class: [:btn] diff --git a/app/views/cmtool/quotes/index.html.haml b/app/views/cmtool/quotes/index.html.haml deleted file mode 100644 index 9ce3e8a..0000000 --- a/app/views/cmtool/quotes/index.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- title :index, Cmtool::Quote -- if @quotes.any? - %table.index-table.table.table-striped.table-hover - %thead - %tr - %th= Cmtool::Quote.human_attribute_name(:owner) - %th= Cmtool::Quote.human_attribute_name(:function) - %th= Cmtool::Quote.human_attribute_name(:active) - %th= Cmtool::Quote.human_attribute_name(:state) - %th - %th - %tbody - - @quotes.each do |quote| - %tr - %td= quote.owner - %td= quote.function - %td= boolean_text quote.active - %td= quote.state - = edit_td quote - = destroy_td quote -- else - = empty_result(Cmtool::Quote) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(Cmtool::Quote), cmtool.new_quote_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/quotes/index.html.slim b/app/views/cmtool/quotes/index.html.slim new file mode 100644 index 0000000..de6ea7c --- /dev/null +++ b/app/views/cmtool/quotes/index.html.slim @@ -0,0 +1,26 @@ +- title :index, Cmtool::Quote +- if @quotes.any? + table.index-table.table.table-striped.table-hover + thead + tr + th= Cmtool::Quote.human_attribute_name(:owner) + th= Cmtool::Quote.human_attribute_name(:function) + th= Cmtool::Quote.human_attribute_name(:active) + th= Cmtool::Quote.human_attribute_name(:state) + th + th + tbody + - @quotes.each do |quote| + tr + td= quote.owner + td= quote.function + td= boolean_text quote.active + td= quote.state + = edit_td quote + = destroy_td quote +- else + = empty_result(Cmtool::Quote) + +- content_for :page_links do + ul + li= link_to link_to_new_content(Cmtool::Quote), cmtool.new_quote_path, class: ['btn', 'btn-primary'] diff --git a/app/views/cmtool/quotes/new.html.haml b/app/views/cmtool/quotes/new.html.slim similarity index 54% rename from app/views/cmtool/quotes/new.html.haml rename to app/views/cmtool/quotes/new.html.slim index e980b93..e6b565d 100644 --- a/app/views/cmtool/quotes/new.html.haml +++ b/app/views/cmtool/quotes/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@quote) - content_for :page_links do - %ul - %li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path, class: [:btn] + ul + li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path, class: [:btn] diff --git a/app/views/cmtool/quotes/show.html.haml b/app/views/cmtool/quotes/show.html.slim similarity index 50% rename from app/views/cmtool/quotes/show.html.haml rename to app/views/cmtool/quotes/show.html.slim index 526fbee..f93cfd3 100644 --- a/app/views/cmtool/quotes/show.html.haml +++ b/app/views/cmtool/quotes/show.html.slim @@ -4,22 +4,22 @@ = link_to image_tag(@quote.image.url(:thumb)), @quote.image.url = link_to t('cmtool.quote.remove_image'), cmtool.remove_image_quote_path(@quote), :method => :delete, :confirm => are_you_sure(), :remote => true .show_field - %strong= Cmtool::Quote.human_attribute_name(:owner) + strong= Cmtool::Quote.human_attribute_name(:owner) = @quote.owner .show_field - %strong= Cmtool::Quote.human_attribute_name(:function) + strong= Cmtool::Quote.human_attribute_name(:function) = @quote.function .show_field - %strong= Cmtool::Quote.human_attribute_name(:state) + strong= Cmtool::Quote.human_attribute_name(:state) = @quote.state .show_field - %strong= Cmtool::Quote.human_attribute_name(:body) + strong= Cmtool::Quote.human_attribute_name(:body) =raw @quote.body .show_field - %strong= Cmtool::Quote.human_attribute_name(:active) + strong= Cmtool::Quote.human_attribute_name(:active) = boolean_text @quote.active - content_for :page_links do - %ul - %li= link_to link_to_edit_content(@quote), cmtool.edit_quote_path(@quote), class: ['btn', 'btn-warning'] - %li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path, class: [:btn] + ul + li= link_to link_to_edit_content(@quote), cmtool.edit_quote_path(@quote), class: ['btn', 'btn-warning'] + li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path, class: [:btn] diff --git a/app/views/cmtool/users/.index.html.haml.swp b/app/views/cmtool/users/.index.html.haml.swp deleted file mode 100644 index 7070527..0000000 Binary files a/app/views/cmtool/users/.index.html.haml.swp and /dev/null differ diff --git a/app/views/cmtool/users/_form.html.haml b/app/views/cmtool/users/_form.html.slim similarity index 100% rename from app/views/cmtool/users/_form.html.haml rename to app/views/cmtool/users/_form.html.slim diff --git a/app/views/cmtool/users/edit.html.haml b/app/views/cmtool/users/edit.html.haml deleted file mode 100644 index 70044ce..0000000 --- a/app/views/cmtool/users/edit.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- title :edit, User -= render 'form', :submit => update_button_text(@user) - -- content_for :page_links do - %ul - %li= link_to link_to_show_content(@user), cmtool.user_path(@user) - - %li= link_to link_to_index_content(User), cmtool.users_path diff --git a/app/views/cmtool/users/edit.html.slim b/app/views/cmtool/users/edit.html.slim new file mode 100644 index 0000000..a60e188 --- /dev/null +++ b/app/views/cmtool/users/edit.html.slim @@ -0,0 +1,8 @@ +- title :edit, User += render 'form', :submit => update_button_text(@user) + +- content_for :page_links do + ul + li= link_to link_to_show_content(@user), cmtool.user_path(@user) + + li= link_to link_to_index_content(User), cmtool.users_path diff --git a/app/views/cmtool/users/index.html.haml b/app/views/cmtool/users/index.html.haml deleted file mode 100644 index b947ab8..0000000 --- a/app/views/cmtool/users/index.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- title :index, User -- if @users.any? - %table.index-table - %thead - %tr - %th= User.human_attribute_name(:email) - %th - %th - %tbody - - @users.each do |user| - %tr - %td= link_to user.email, cmtool.user_path(user) - = edit_td user - = destroy_td user -- else - = empty_result(User) - -- content_for :page_links do - %ul - %li= link_to link_to_new_content(User), cmtool.new_user_path diff --git a/app/views/cmtool/users/index.html.slim b/app/views/cmtool/users/index.html.slim new file mode 100644 index 0000000..f4e56ba --- /dev/null +++ b/app/views/cmtool/users/index.html.slim @@ -0,0 +1,20 @@ +- title :index, User +- if @users.any? + table.index-table + thead + tr + th= User.human_attribute_name(:email) + th + th + tbody + - @users.each do |user| + tr + td= link_to user.email, cmtool.user_path(user) + = edit_td user + = destroy_td user +- else + = empty_result(User) + +- content_for :page_links do + ul + li= link_to link_to_new_content(User), cmtool.new_user_path diff --git a/app/views/cmtool/users/new.html.haml b/app/views/cmtool/users/new.html.slim similarity index 59% rename from app/views/cmtool/users/new.html.haml rename to app/views/cmtool/users/new.html.slim index e08e340..a6ede4b 100644 --- a/app/views/cmtool/users/new.html.haml +++ b/app/views/cmtool/users/new.html.slim @@ -2,5 +2,5 @@ = render 'form', :submit => create_button_text(@user) - content_for :page_links do - %ul - %li= link_to link_to_index_content(User), cmtool.users_path + ul + li= link_to link_to_index_content(User), cmtool.users_path diff --git a/app/views/cmtool/users/show.html.haml b/app/views/cmtool/users/show.html.haml deleted file mode 100644 index 34da2e6..0000000 --- a/app/views/cmtool/users/show.html.haml +++ /dev/null @@ -1,38 +0,0 @@ -- title :show, User -.show_field - %span.show_label= User.human_attribute_name(:email) - %span.show_separator - %span.show_value= @user.email -.show_field - %span.show_label= User.human_attribute_name(:sign_in_count) - %span.show_separator - %span.show_value.link= @user.sign_in_count -.show_field - %span.show_label= User.human_attribute_name(:current_sign_in_at) - %span.show_separator - %span.show_value.link= @user.current_sign_in_at -.show_field - %span.show_label= User.human_attribute_name(:last_sign_in_at) - %span.show_separator - %span.show_value.link= @user.last_sign_in_at -.show_field - %span.show_label= User.human_attribute_name(:current_sign_in_ip) - %span.show_separator - %span.show_value.link= @user.current_sign_in_ip -.show_field - %span.show_label= User.human_attribute_name(:last_sign_in_ip) - %span.show_separator - %span.show_value.link= @user.last_sign_in_ip -.show_field - %span.show_label= User.human_attribute_name(:is_admin) - %span.show_separator - %span.show_value.boolean= boolean_text(@user.is_admin?) -.show_field - %span.show_label= User.human_attribute_name(:active) - %span.show_separator - %span.show_value.boolean= boolean_text(@user.active?) -- content_for :page_links do - %ul - %li= link_to link_to_edit_content(@user), cmtool.edit_user_path(@user) - - %li= link_to link_to_index_content(User), cmtool.users_path diff --git a/app/views/cmtool/users/show.html.slim b/app/views/cmtool/users/show.html.slim new file mode 100644 index 0000000..79262c7 --- /dev/null +++ b/app/views/cmtool/users/show.html.slim @@ -0,0 +1,38 @@ +- title :show, User +.show_field + span.show_label= User.human_attribute_name(:email) + span.show_separator + span.show_value= @user.email +.show_field + span.show_label= User.human_attribute_name(:sign_in_count) + span.show_separator + span.show_value.link= @user.sign_in_count +.show_field + span.show_label= User.human_attribute_name(:current_sign_in_at) + span.show_separator + span.show_value.link= @user.current_sign_in_at +.show_field + span.show_label= User.human_attribute_name(:last_sign_in_at) + span.show_separator + span.show_value.link= @user.last_sign_in_at +.show_field + span.show_label= User.human_attribute_name(:current_sign_in_ip) + span.show_separator + span.show_value.link= @user.current_sign_in_ip +.show_field + span.show_label= User.human_attribute_name(:last_sign_in_ip) + span.show_separator + span.show_value.link= @user.last_sign_in_ip +.show_field + span.show_label= User.human_attribute_name(:is_admin) + span.show_separator + span.show_value.boolean= boolean_text(@user.is_admin?) +.show_field + span.show_label= User.human_attribute_name(:active) + span.show_separator + span.show_value.boolean= boolean_text(@user.active?) +- content_for :page_links do + ul + li= link_to link_to_edit_content(@user), cmtool.edit_user_path(@user) + + li= link_to link_to_index_content(User), cmtool.users_path diff --git a/app/views/pages/home.html.haml b/app/views/pages/home.html.slim similarity index 100% rename from app/views/pages/home.html.haml rename to app/views/pages/home.html.slim diff --git a/app/views/pages/show.html.haml b/app/views/pages/show.html.slim similarity index 100% rename from app/views/pages/show.html.haml rename to app/views/pages/show.html.slim diff --git a/cmtool.gemspec b/cmtool.gemspec index ee471ef..6c7d3c1 100644 --- a/cmtool.gemspec +++ b/cmtool.gemspec @@ -23,24 +23,24 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q, [">= 0"]) s.add_runtime_dependency(%q, [">= 0"]) - s.add_runtime_dependency(%q, [">= 0"]) s.add_runtime_dependency(%q, [">= 0"]) s.add_runtime_dependency(%q, [">= 0"]) s.add_runtime_dependency(%q, [">= 0"]) + s.add_runtime_dependency(%q, [">= 0"]) else s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) end else s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) end end diff --git a/lib/cmtool/engine.rb b/lib/cmtool/engine.rb index 31cab5a..81b1632 100644 --- a/lib/cmtool/engine.rb +++ b/lib/cmtool/engine.rb @@ -4,7 +4,6 @@ require 'simply_stored' require 'email_validator' require 'devise' require 'devise_simply_stored' -require 'haml-rails' require 'sass-rails' require 'paperclip' require 'jquery-rails' @@ -18,7 +17,6 @@ module Cmtool require 'email_validator' require 'bourbon' require 'slim-rails' - require 'haml-rails' require 'paperclip' require 'devise' require 'devise_simply_stored' diff --git a/lib/cmtool/includes/page.rb b/lib/cmtool/includes/page.rb index 29587c9..bf73f03 100644 --- a/lib/cmtool/includes/page.rb +++ b/lib/cmtool/includes/page.rb @@ -68,6 +68,11 @@ module Cmtool end def top_menu + ActiveSupport::Deprecation.warn("Page.top_menu is a stupid name. Use Page.menu_roots instead") + menu_roots + end + + def menu_roots ::Page.roots(I18n.locale.to_s).select(&:in_menu?) end end