diff --git a/Gemfile b/Gemfile index c1cb864..d7d50c8 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gemspec group :assets do gem 'sass-rails' - #gem 'bourbon' + gem 'bourbon' gem 'coffee-script' gem 'therubyracer', :platforms => :ruby gem 'less-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 33533d3..55203c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -245,6 +245,7 @@ PLATFORMS ruby DEPENDENCIES + bourbon cmtool! coffee-script couch_potato! diff --git a/app/assets/stylesheets/cmtool/structure.css.sass b/app/assets/stylesheets/cmtool/structure.css.sass index 3984a08..5590937 100644 --- a/app/assets/stylesheets/cmtool/structure.css.sass +++ b/app/assets/stylesheets/cmtool/structure.css.sass @@ -36,13 +36,8 @@ a margin: 0 padding: 0 li - @include linear-gradient(#2989d8, #1e5799) float: left margin-right: 10px - padding: 3px 6px - +border-bottom-radius(5px) - a - color: white #title-container margin-top: 12px @include linear-gradient(#aaa, #fff) diff --git a/app/assets/stylesheets/cmtool/table.css.sass b/app/assets/stylesheets/cmtool/table.css.sass index 6d838a1..89440f0 100644 --- a/app/assets/stylesheets/cmtool/table.css.sass +++ b/app/assets/stylesheets/cmtool/table.css.sass @@ -1,13 +1,5 @@ @import bourbon -table +table.index-table td.action - //@include radial-gradient(50% 50%, circle cover, #1e5799, #2989d8) - a - display: block - width: 16px - height: 16px - padding: 4px - @include radial-gradient(50% 50%, circle cover, #fff, #aaa) - &:hover - @include radial-gradient(50% 50%, circle cover, #ffc, #aaa) + width: 24px diff --git a/app/assets/stylesheets/cmtool/twittered.css.sass b/app/assets/stylesheets/cmtool/twittered.css.sass new file mode 100644 index 0000000..040274a --- /dev/null +++ b/app/assets/stylesheets/cmtool/twittered.css.sass @@ -0,0 +1,13 @@ + +#sub-navigation-container + ul + list-style: none + margin: 0 + padding: 0 + li + float: left + margin-right: 10px +body + textarea + &.editor_full + width: 100% diff --git a/app/controllers/cmtool/passwords_controller.rb b/app/controllers/cmtool/passwords_controller.rb index 17da516..5d9db33 100644 --- a/app/controllers/cmtool/passwords_controller.rb +++ b/app/controllers/cmtool/passwords_controller.rb @@ -1,5 +1,5 @@ module Cmtool class PasswordsController < Devise::PasswordsController - layout 'cmtool/sessions' + layout 'cmtool/devise' end end diff --git a/app/controllers/cmtool/sessions_controller.rb b/app/controllers/cmtool/sessions_controller.rb index b4ca969..3830363 100644 --- a/app/controllers/cmtool/sessions_controller.rb +++ b/app/controllers/cmtool/sessions_controller.rb @@ -1,5 +1,5 @@ module Cmtool class SessionsController < ::Devise::SessionsController - layout 'cmtool/sessions' + layout 'cmtool/devise' end end diff --git a/app/helpers/cmtool/application_helper.rb b/app/helpers/cmtool/application_helper.rb index d6391dd..a0387a8 100644 --- a/app/helpers/cmtool/application_helper.rb +++ b/app/helpers/cmtool/application_helper.rb @@ -116,14 +116,14 @@ module Cmtool def edit_td(obj) content_tag( :td, - link_to((content_tag(:span, 'edit', class: ['ui-icon', 'ui-icon-pencil'])), cmtool.url_for([:edit, obj]), class: [:edit]), + link_to((content_tag(:span, t('cmtool.table.index.edit'), class: [:edit, 'icon-pencil'])), cmtool.url_for([:edit, obj]), class: [:edit, :btn, 'btn-warning', 'btn-mini']), class: [:action, :edit] ) end def destroy_td(obj) content_tag( :td, - link_to(content_tag(:span, 'delete', class: ['ui-icon', 'ui-icon-trash']), cmtool.url_for(obj), method: :delete, confirm: are_you_sure(obj), class: [:destroy]), + link_to(content_tag(:span, t('cmtool.table.index.destroy'), class: [:destroy, 'icon-trash']), cmtool.url_for(obj), method: :delete, confirm: are_you_sure(obj), class: [:destroy, :btn, 'btn-danger', 'btn-mini']), class: [:action, :destroy] ) end diff --git a/app/views/cmtool/application/_links.html.slim b/app/views/cmtool/application/_links.html.slim new file mode 100644 index 0000000..689d28c --- /dev/null +++ b/app/views/cmtool/application/_links.html.slim @@ -0,0 +1,19 @@ +ul.nav.nav-pills + - if controller_name != 'sessions' + li= link_to t('devise.sessions.button'), new_session_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.registerable? && controller_name != 'registrations' + li= link_to t('devise.registrations.button'), new_registration_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.recoverable? && controller_name != 'passwords' + li= link_to t('devise.sessions.forgot_your_password'), new_password_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.confirmable? && controller_name != 'confirmations' + li= link_to t('devise.confirmations.did_not_receive_instructions_link'), new_confirmation_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + li= link_to t('devise.unlocks.did_not_receive_instructions_link'), new_unlock_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.omniauthable? + - resource_class.omniauth_providers.each do |provider| + li= link_to t('devise.omniauth_callbacks.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), class: [:devise, :btn] diff --git a/app/views/cmtool/contact_forms/edit.html.haml b/app/views/cmtool/contact_forms/edit.html.haml index f1c6368..ce93b37 100644 --- a/app/views/cmtool/contact_forms/edit.html.haml +++ b/app/views/cmtool/contact_forms/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@contact_form), cmtool.contact_form_path(@contact_form) - - %li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path + %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 index c40af17..251726e 100644 --- a/app/views/cmtool/contact_forms/index.html.haml +++ b/app/views/cmtool/contact_forms/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::ContactForm - if @contact_forms.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::ContactForm.human_attribute_name(:gender) @@ -23,4 +23,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::ContactForm), cmtool.new_contact_form_path + %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.haml index 730119c..8053acc 100644 --- a/app/views/cmtool/contact_forms/new.html.haml +++ b/app/views/cmtool/contact_forms/new.html.haml @@ -2,4 +2,4 @@ = 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 + %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 index 4c1d1b6..bcabac2 100644 --- a/app/views/cmtool/contact_forms/show.html.haml +++ b/app/views/cmtool/contact_forms/show.html.haml @@ -17,6 +17,5 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@contact_form), cmtool.edit_contact_form_path(@contact_form) - - %li= link_to link_to_index_content(Cmtool::ContactForm), cmtool.contact_forms_path + %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/directories/_image.html.haml b/app/views/cmtool/directories/_image.html.haml index ad591b3..48dc2a3 100644 --- a/app/views/cmtool/directories/_image.html.haml +++ b/app/views/cmtool/directories/_image.html.haml @@ -1,5 +1,5 @@ %tr - %td.image.thumb= link_to(image_tag(image.file.url(:thumb)), cmtool.image_path(image) + %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 index 510e01c..5c43f93 100644 --- a/app/views/cmtool/directories/edit.html.haml +++ b/app/views/cmtool/directories/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@directory), cmtool.directory_path(@directory) - - %li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path + %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 index b9be5a0..00950ea 100644 --- a/app/views/cmtool/directories/index.html.haml +++ b/app/views/cmtool/directories/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::Directory - if @directories.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::Directory.human_attribute_name(:name) @@ -17,4 +17,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::Directory), cmtool.new_directory_path + %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.haml index 5918f0a..849a10e 100644 --- a/app/views/cmtool/directories/new.html.haml +++ b/app/views/cmtool/directories/new.html.haml @@ -4,4 +4,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path + %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 index 8cdf950..3f04d73 100644 --- a/app/views/cmtool/directories/show.html.haml +++ b/app/views/cmtool/directories/show.html.haml @@ -1,13 +1,17 @@ - title :show, Cmtool::Directory - content_for :onload_javascript do $('.add-image-container').dialog({modal: true, autoOpen: false, width: 400}) -.add-image-container - = form_for [cmtool, Cmtool::Image.new(directory_id: @directory.id)], :html => { :multipart => true } do |f| - = f.hidden_field :directory_id - = f.file_field :file - = f.submit t('cmtool.directory.add_image.label', image: Cmtool::Image.model_name.human) +#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#directory-view.table.table-striped.table-hover %thead %tbody %tr @@ -27,9 +31,6 @@ %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) - - %li= link_to link_to_index_content(Cmtool::Directory), cmtool.directories_path - - %li= link_to_function t('cmtool.directoy.add_file'), %|$('.add-image-container').dialog('open')| + %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/edit.html.haml b/app/views/cmtool/faqs/edit.html.haml index a311b02..194d418 100644 --- a/app/views/cmtool/faqs/edit.html.haml +++ b/app/views/cmtool/faqs/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@faq), cmtool.faq_path(@faq) - - %li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path + %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 index 7ed26ee..1f8ff1c 100644 --- a/app/views/cmtool/faqs/index.html.haml +++ b/app/views/cmtool/faqs/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::Faq - if @faqs.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::Faq.human_attribute_name(:question) @@ -19,4 +19,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::Faq), cmtool.new_faq_path + %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.haml index 807384b..6fea2af 100644 --- a/app/views/cmtool/faqs/new.html.haml +++ b/app/views/cmtool/faqs/new.html.haml @@ -3,4 +3,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path + %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 index 72f346f..ab71a14 100644 --- a/app/views/cmtool/faqs/show.html.haml +++ b/app/views/cmtool/faqs/show.html.haml @@ -8,6 +8,6 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@faq), cmtool.edit_faq_path(@faq) + %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 + %li= link_to link_to_index_content(Cmtool::Faq), cmtool.faqs_path, class: [:btn] diff --git a/app/views/cmtool/images/edit.html.haml b/app/views/cmtool/images/edit.html.haml index 86aa09c..ddf6e59 100644 --- a/app/views/cmtool/images/edit.html.haml +++ b/app/views/cmtool/images/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@image), cmtool.image_path(@image) - - %li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path + %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 index 8313595..0b5668e 100644 --- a/app/views/cmtool/images/index.html.haml +++ b/app/views/cmtool/images/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::Image - if @images.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::Image.model_name.human @@ -19,7 +19,7 @@ %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 + %td= l image.file_updated_at, :format => :short = edit_td image = destroy_td image - else @@ -27,4 +27,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::Image), cmtool.new_image_path + %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.js.erb b/app/views/cmtool/images/index.js.erb index 5482e72..2223f4f 100644 --- a/app/views/cmtool/images/index.js.erb +++ b/app/views/cmtool/images/index.js.erb @@ -1,3 +1,3 @@ var tinyMCEImageList = new Array( - <%= Cmtool::Image.active.map{|i| %{['#{i.clean_name} (Origineel)', '#{i.file.url(:original)}'], ['#{i.clean_name} (Pagina)', '#{i.file.url(:page)}'], ['#{i.clean_name} (Medium)', '#{i.file.url(:medium)}'], ['#{i.clean_name} (Thumb)', '#{i.file.url(:thumb)}']}}.join(",\n") %> + <%=raw Cmtool::Image.active.map{|i| %{['#{i.clean_name} (Origineel)', '#{i.file.url(:original)}'], ['#{i.clean_name} (Pagina)', '#{i.file.url(:page)}'], ['#{i.clean_name} (Medium)', '#{i.file.url(:medium)}'], ['#{i.clean_name} (Thumb)', '#{i.file.url(:thumb)}']}}.join(",\n") %> ); diff --git a/app/views/cmtool/images/new.html.haml b/app/views/cmtool/images/new.html.haml index 60c20d1..86ea208 100644 --- a/app/views/cmtool/images/new.html.haml +++ b/app/views/cmtool/images/new.html.haml @@ -3,4 +3,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path + %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 index c60ac50..b49dd6b 100644 --- a/app/views/cmtool/images/show.html.haml +++ b/app/views/cmtool/images/show.html.haml @@ -17,8 +17,6 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@image), cmtool.edit_image_path(@image) - - %li= link_to link_to_new_content(Cmtool::Image), cmtool.new_image_path, :class => %w[new image] - - %li= link_to link_to_index_content(Cmtool::Image), cmtool.images_path + %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/edit.html.haml b/app/views/cmtool/keywords/edit.html.haml index 586a75a..61041b2 100644 --- a/app/views/cmtool/keywords/edit.html.haml +++ b/app/views/cmtool/keywords/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@keyword), cmtool.keyword_path(@keyword) - - %li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path + %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 index 7033e2c..83a9614 100644 --- a/app/views/cmtool/keywords/index.html.haml +++ b/app/views/cmtool/keywords/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::Keyword - if @keywords.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::Keyword.human_attribute_name(:name) @@ -17,4 +17,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::Keyword), cmtool.new_keyword_path + %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.haml index 1bdb933..bc0941a 100644 --- a/app/views/cmtool/keywords/new.html.haml +++ b/app/views/cmtool/keywords/new.html.haml @@ -4,4 +4,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path + %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 index 991c4c8..e9a7c34 100644 --- a/app/views/cmtool/keywords/show.html.haml +++ b/app/views/cmtool/keywords/show.html.haml @@ -5,6 +5,5 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@keyword), cmtool.edit_keyword_path(@keyword) - - %li= link_to link_to_index_content(Cmtool::Keyword), cmtool.keywords_path + %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/edit.html.haml b/app/views/cmtool/news/edit.html.haml index cf1d080..4ddd938 100644 --- a/app/views/cmtool/news/edit.html.haml +++ b/app/views/cmtool/news/edit.html.haml @@ -5,6 +5,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@news), cmtool.news_path(@news) - - %li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path + %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 index 9f1e6fc..889e378 100644 --- a/app/views/cmtool/news/index.html.haml +++ b/app/views/cmtool/news/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::News - if @news.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::News.human_attribute_name(:title) @@ -21,4 +21,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::News), cmtool.new_news_path + %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.haml index a6052ea..508588b 100644 --- a/app/views/cmtool/news/new.html.haml +++ b/app/views/cmtool/news/new.html.haml @@ -3,4 +3,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path + %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 index a80743d..842d2e3 100644 --- a/app/views/cmtool/news/show.html.haml +++ b/app/views/cmtool/news/show.html.haml @@ -24,6 +24,5 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@news), cmtool.edit_news_path(@news) - - %li= link_to link_to_index_content(Cmtool::News), cmtool.news_index_path + %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/edit.html.haml b/app/views/cmtool/newsletter_subscriptions/edit.html.haml index 8527baa..38cde4b 100644 --- a/app/views/cmtool/newsletter_subscriptions/edit.html.haml +++ b/app/views/cmtool/newsletter_subscriptions/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@newsletter_subscription), cmtool.newsletter_subscription_path(@newsletter_subscription) - - %li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path + %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 index 5fbeaf8..f9f55fe 100644 --- a/app/views/cmtool/newsletter_subscriptions/index.html.haml +++ b/app/views/cmtool/newsletter_subscriptions/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::NewsletterSubscription - if @newsletter_subscriptions.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::NewsletterSubscription.human_attribute_name(:email) @@ -21,4 +21,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::NewsletterSubscription), cmtool.new_newsletter_subscription_path + %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.haml index 9eb06b6..446772c 100644 --- a/app/views/cmtool/newsletter_subscriptions/new.html.haml +++ b/app/views/cmtool/newsletter_subscriptions/new.html.haml @@ -3,4 +3,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path + %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 index 60eb685..f7f523e 100644 --- a/app/views/cmtool/newsletter_subscriptions/show.html.haml +++ b/app/views/cmtool/newsletter_subscriptions/show.html.haml @@ -11,6 +11,5 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@newsletter_subscription), cmtool.edit_newsletter_subscription_path(@newsletter_subscription) - - %li= link_to link_to_index_content(Cmtool::NewsletterSubscription), cmtool.newsletter_subscriptions_path + %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/edit.html.haml b/app/views/cmtool/pages/edit.html.haml index 298ab84..5ec33da 100644 --- a/app/views/cmtool/pages/edit.html.haml +++ b/app/views/cmtool/pages/edit.html.haml @@ -3,7 +3,7 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Page), cmtool.pages_path - %li= link_to link_to_show_content(@page), cmtool.page_path(@page) - %li= link_to link_to_edit_content(@page), cmtool.edit_page_path(@page) - %li= link_to link_to_destroy_content(@page), cmtool.page_path(@page), :confirm => are_you_sure?(@page), :method => :delete + %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 index c422414..2519538 100644 --- a/app/views/cmtool/pages/index.html.haml +++ b/app/views/cmtool/pages/index.html.haml @@ -1,5 +1,5 @@ - title :index, Page -%table.index-table.table.table-striped +%table.index-table.table.table-striped.table-hover %thead %tr %th= Page.human_attribute_name(:name) @@ -18,4 +18,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Page), cmtool.new_page_path + %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.haml index 0b05ba1..36a7c28 100644 --- a/app/views/cmtool/pages/new.html.haml +++ b/app/views/cmtool/pages/new.html.haml @@ -3,4 +3,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Page), cmtool.pages_path + %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 index f82d02e..7de7077 100644 --- a/app/views/cmtool/pages/show.html.haml +++ b/app/views/cmtool/pages/show.html.haml @@ -26,9 +26,6 @@ .show_field %strong= Page.human_attribute_name(:layout) = @page.layout -.show_field - %strong= Page.human_attribute_name(:default) - = boolean_text @page.default .show_field %strong= Page.human_attribute_name(:has_view) =# boolean_text template_exist?("pages/#{@page.name}") @@ -38,5 +35,5 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Page), cmtool.pages_path - %li= link_to link_to_edit_content(@page), cmtool.edit_page_path(@page) + %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/passwords/edit.html.haml b/app/views/cmtool/passwords/edit.html.haml deleted file mode 100644 index 184a333..0000000 --- a/app/views/cmtool/passwords/edit.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -%h2 Verander wachtwoord -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| - = devise_error_messages! - = f.hidden_field :reset_password_token - .field - = f.label :password, "Nieuw wachtwoord" - = f.password_field :password - .field - = f.label :password_confirmation, "Bevestig nieuw wachtwoord" - = f.password_field :password_confirmation - .actions - = f.submit "Verander mijn wachtwoord" -= render :partial => "devise/shared/links" diff --git a/app/views/cmtool/passwords/edit.html.slim b/app/views/cmtool/passwords/edit.html.slim new file mode 100644 index 0000000..7e2fd3e --- /dev/null +++ b/app/views/cmtool/passwords/edit.html.slim @@ -0,0 +1,14 @@ +h2= t('devise.passwords.edit.title') += form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal', method: :put}) do |f| + = devise_error_messages! + = f.hidden_field :reset_password_token + .control-group + = f.label :password, class: 'control-label' + .controls= f.password_field :password + .control-group + = f.label :password_confirmation, class: 'control-label' + .controls= f.password_field :password_confirmation + .control-group + .controls + = f.submit t('devise.passwords.edit.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/cmtool/passwords/new.html.haml b/app/views/cmtool/passwords/new.html.haml deleted file mode 100644 index c8aaa27..0000000 --- a/app/views/cmtool/passwords/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2 Wachtwoord vergeten? -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| - = devise_error_messages! - .field - = f.label :email - = f.email_field :email - .field - = f.submit "Stuur mij instructies om mijn wachtwoord te vernieuwen" -= render :partial => "devise/shared/links" diff --git a/app/views/cmtool/passwords/new.html.slim b/app/views/cmtool/passwords/new.html.slim new file mode 100644 index 0000000..b3c0ca3 --- /dev/null +++ b/app/views/cmtool/passwords/new.html.slim @@ -0,0 +1,10 @@ +h2= t('devise.passwords.title') += form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal'}) do |f| + = devise_error_messages! + .control-group + = f.label :email, class: 'control-label' + .controls= f.email_field :email + .control-group + .controls + = f.submit t('devise.passwords.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/cmtool/quotes/edit.html.haml b/app/views/cmtool/quotes/edit.html.haml index 528a9a4..3ed3448 100644 --- a/app/views/cmtool/quotes/edit.html.haml +++ b/app/views/cmtool/quotes/edit.html.haml @@ -3,6 +3,5 @@ - content_for :page_links do %ul - %li= link_to link_to_show_content(@quote), cmtool.quote_path(@quote) - - %li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path + %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 index 12e8259..9ce3e8a 100644 --- a/app/views/cmtool/quotes/index.html.haml +++ b/app/views/cmtool/quotes/index.html.haml @@ -1,6 +1,6 @@ - title :index, Cmtool::Quote - if @quotes.any? - %table.index-table + %table.index-table.table.table-striped.table-hover %thead %tr %th= Cmtool::Quote.human_attribute_name(:owner) @@ -23,4 +23,4 @@ - content_for :page_links do %ul - %li= link_to link_to_new_content(Cmtool::Quote), cmtool.new_quote_path + %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.haml index 1ddfe61..e980b93 100644 --- a/app/views/cmtool/quotes/new.html.haml +++ b/app/views/cmtool/quotes/new.html.haml @@ -3,4 +3,4 @@ - content_for :page_links do %ul - %li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path + %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.haml index a251434..526fbee 100644 --- a/app/views/cmtool/quotes/show.html.haml +++ b/app/views/cmtool/quotes/show.html.haml @@ -21,6 +21,5 @@ - content_for :page_links do %ul - %li= link_to link_to_edit_content(@quote), cmtool.edit_quote_path(@quote) - - %li= link_to link_to_index_content(Cmtool::Quote), cmtool.quotes_path + %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/sessions/new.html.haml b/app/views/cmtool/sessions/new.html.haml deleted file mode 100644 index 6558004..0000000 --- a/app/views/cmtool/sessions/new.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -%h2= t('cmtool.sessions.new.title') -= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| - .field - = f.label :email - = f.email_field :email - .field - = f.label :password - = f.password_field :password - - - if devise_mapping.rememberable? - .field - = f.check_box :remember_me - = f.label :remember_me - .actions - = f.submit t('cmtool.sessions.new.label'), class: :button, id: 'new-session-button' -= render :partial => "devise/shared/links" diff --git a/app/views/cmtool/sessions/new.html.slim b/app/views/cmtool/sessions/new.html.slim new file mode 100644 index 0000000..05f5bfc --- /dev/null +++ b/app/views/cmtool/sessions/new.html.slim @@ -0,0 +1,19 @@ +h2= t('devise.sessions.title') += form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-horizontal'}) do |f| + = devise_error_messages! + .control-group + = f.label :email, class: 'control-label' + .controls= f.email_field :email + .control-group + = f.label :password, class: 'control-label' + .controls= f.password_field :password + .control-group + .controls + = f.label :remember_me do + = f.check_box :remember_me + |  + = t('devise.sessions.remember_me') + .control-group + .controls + = f.submit t('devise.sessions.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/cmtool/sessions/sessions/new.html.haml b/app/views/cmtool/sessions/sessions/new.html.haml deleted file mode 100644 index 5bd4393..0000000 --- a/app/views/cmtool/sessions/sessions/new.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%h2 Inloggen voor toegang tot extra diensten -= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| - .field - = f.label :email - = f.email_field :email, value: params[:email] - .field - = f.label :password - = f.password_field :password, value: params[:password] - - - if devise_mapping.rememberable? - .field - = f.check_box :remember_me - = f.label :remember_me, t('devise.sessions.remember_me') - = button_tag t('devise.sessions.sign_in'), id: 'new-session-button', class: :button - - else - .field - = button_tag t('devise.sessions.sign_in'), id: 'new-session-button', class: :button -= render :partial => "devise/shared/links" diff --git a/app/views/devise/_devise_links.html.slim b/app/views/devise/_devise_links.html.slim new file mode 100644 index 0000000..689d28c --- /dev/null +++ b/app/views/devise/_devise_links.html.slim @@ -0,0 +1,19 @@ +ul.nav.nav-pills + - if controller_name != 'sessions' + li= link_to t('devise.sessions.button'), new_session_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.registerable? && controller_name != 'registrations' + li= link_to t('devise.registrations.button'), new_registration_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.recoverable? && controller_name != 'passwords' + li= link_to t('devise.sessions.forgot_your_password'), new_password_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.confirmable? && controller_name != 'confirmations' + li= link_to t('devise.confirmations.did_not_receive_instructions_link'), new_confirmation_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + li= link_to t('devise.unlocks.did_not_receive_instructions_link'), new_unlock_path(resource_name), class: [:devise, :btn] + + - if devise_mapping.omniauthable? + - resource_class.omniauth_providers.each do |provider| + li= link_to t('devise.omniauth_callbacks.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), class: [:devise, :btn] diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index b7ae403..1dc5ca6 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -9,4 +9,4 @@
<%= f.submit "Resend confirmation instructions" %>
<% end %> -<%= render :partial => "devise/shared/links" %> \ No newline at end of file +<%= render "devise_links" %> \ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index a6ea8ca..a5c4585 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,5 +1,5 @@

Welcome <%= @resource.email %>!

-

You can confirm your account through the link below:

+

You can confirm your account email through the link below:

<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000..ae9e888 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password, and you can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml deleted file mode 100644 index 88fdb8d..0000000 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%p= "Hello #{@resource.email}!" - -%p Someone has requested a link to change your password, and you can do this through the link below. - -%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) - -%p If you didn't request this, please ignore this email. -%p Your password won't change until you access the link above and create a new one. -%p With kind regards, -%p The ATool team diff --git a/app/views/devise/mailer/reset_password_instructions.nl.html.haml b/app/views/devise/mailer/reset_password_instructions.nl.html.haml deleted file mode 100644 index 075ce62..0000000 --- a/app/views/devise/mailer/reset_password_instructions.nl.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%p= "Hallo #{@resource.email}!" -%p Er is een nieuw wachtwoord voor je aangevraagt. Dit kan je bevestigen door naar de onderstaande link te gaan. -%p= link_to 'Wijzig wachtwoord', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) -%p Als deze aanvraag niet van jou is kan je deze email negeren. Het wachtwoord wordt niet gewijzigd zonder dat de bovenstaande link gebruikt wordt. -%p Met vriendelijke groet, -%p Het ATool team diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index ff76588..0000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Change your password

- -<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> - -
<%= f.label :password, "New password" %>
- <%= f.password_field :password %>
- -
<%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation %>
- -
<%= f.submit "Change my password" %>
-<% end %> - -<%= render :partial => "devise/shared/links" %> diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim new file mode 100644 index 0000000..7e2fd3e --- /dev/null +++ b/app/views/devise/passwords/edit.html.slim @@ -0,0 +1,14 @@ +h2= t('devise.passwords.edit.title') += form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal', method: :put}) do |f| + = devise_error_messages! + = f.hidden_field :reset_password_token + .control-group + = f.label :password, class: 'control-label' + .controls= f.password_field :password + .control-group + = f.label :password_confirmation, class: 'control-label' + .controls= f.password_field :password_confirmation + .control-group + .controls + = f.submit t('devise.passwords.edit.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 6c21e9f..0000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Forgot your password?

- -<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email %>
- -
<%= f.submit "Send me reset password instructions" %>
-<% end %> - -<%= render :partial => "devise/shared/links" %> \ No newline at end of file diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim new file mode 100644 index 0000000..b3c0ca3 --- /dev/null +++ b/app/views/devise/passwords/new.html.slim @@ -0,0 +1,10 @@ +h2= t('devise.passwords.title') += form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal'}) do |f| + = devise_error_messages! + .control-group + = f.label :email, class: 'control-label' + .controls= f.email_field :email + .control-group + .controls + = f.submit t('devise.passwords.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index ff38050..bb66fbf 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -7,7 +7,7 @@ <%= f.email_field :email %>
<%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password %>
+ <%= f.password_field :password, :autocomplete => "off" %>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index d15e275..0000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -

Sign up

- -<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email %>
- -
<%= f.label :password %>
- <%= f.password_field :password %>
- -
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>
- -
<%= f.submit "Sign up" %>
-<% end %> - -<%= render :partial => "devise/shared/links" %> diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim new file mode 100644 index 0000000..af57f04 --- /dev/null +++ b/app/views/devise/registrations/new.html.slim @@ -0,0 +1,16 @@ +h2= t('devise.registrations.title') += form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: {class: 'form-horizontal'}) do |f| + = devise_error_messages! + .control-group + = f.label :email, class: 'control-label' + .controls= f.email_field :email + .control-group + = f.label :password, class: 'control-label' + .controls= f.password_field :password + .control-group + = f.label :password_confirmation, class: 'control-label' + .controls= f.password_field :password_confirmation + .control-group + .controls + = f.submit t('devise.registrations.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index ff59f7c..0000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -

Sign in

- -<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> -
<%= f.label :email %>
- <%= f.email_field :email %>
- -
<%= f.label :password %>
- <%= f.password_field :password %>
- - <% if devise_mapping.rememberable? -%> -
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
- <% end -%> - -
<%= f.submit "Sign in" %>
-<% end %> - -<%= render :partial => "devise/shared/links" %> \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim new file mode 100644 index 0000000..05f5bfc --- /dev/null +++ b/app/views/devise/sessions/new.html.slim @@ -0,0 +1,19 @@ +h2= t('devise.sessions.title') += form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-horizontal'}) do |f| + = devise_error_messages! + .control-group + = f.label :email, class: 'control-label' + .controls= f.email_field :email + .control-group + = f.label :password, class: 'control-label' + .controls= f.password_field :password + .control-group + .controls + = f.label :remember_me do + = f.check_box :remember_me + |  + = t('devise.sessions.remember_me') + .control-group + .controls + = f.submit t('devise.sessions.button'), class: 'btn btn-primary' += render "devise_links" diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb deleted file mode 100644 index eab783a..0000000 --- a/app/views/devise/shared/_links.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%- if controller_name != 'sessions' %> - <%= link_to "Sign in", new_session_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> -<% end -%> \ No newline at end of file diff --git a/app/views/devise/shared/_links.html.haml b/app/views/devise/shared/_links.html.haml deleted file mode 100644 index a686c34..0000000 --- a/app/views/devise/shared/_links.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -%ul#devise-links - %li= link_to 'Home', root_path, id: 'login-home' - - if controller_name != 'sessions' - %li= link_to "Inloggen", new_session_path(resource_name) - - - if devise_mapping.registerable? && controller_name != 'registrations' - %li= link_to "Registreer", new_registration_path(resource_name) - - - if devise_mapping.recoverable? && controller_name != 'passwords' - %li= link_to "Wachtwoord vergeten?", new_password_path(resource_name) - - - if devise_mapping.confirmable? && controller_name != 'confirmations' - %li= link_to "Geen bevestigingsemail ontvangen?", new_confirmation_path(resource_name) - - - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - %li= link_to "Geen unlock instructies ontvangen?", new_unlock_path(resource_name) - - - if devise_mapping.omniauthable? - - resource_class.omniauth_providers.each do |provider| - %li= link_to "Inloggen met #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index c6cdcfe..a1aaff2 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -9,4 +9,4 @@
<%= f.submit "Resend unlock instructions" %>
<% end %> -<%= render :partial => "devise/shared/links" %> \ No newline at end of file +<%= render "devise_links" %> \ No newline at end of file diff --git a/app/views/layouts/cmtool/application.html.haml b/app/views/layouts/cmtool/application.html.haml deleted file mode 100644 index af75349..0000000 --- a/app/views/layouts/cmtool/application.html.haml +++ /dev/null @@ -1,45 +0,0 @@ -!!! Strict -%html{"xml:lang" => I18n.locale, :lang => I18n.locale} - %head - %title= site_title - = csrf_meta_tag - :javascript - var tinymce_language = '#{I18n.locale}'; - = stylesheet_link_tag 'cmtool/application' - = javascript_include_tag 'cmtool/application' - = yield(:head) - :javascript - $(function(){ - //Onload - #{yield(:onload_javascript)} - }); - %body - #page-wrapper - #header-container= render 'user_info' - #navigation-container - #menu-container - - if user_signed_in? - %ul - %li{:class => controller_name == 'pages' ? 'ui-state-active' : 'ui-state-default'}=link_to Page.model_name.human_plural, cmtool.pages_path - %li{:class => controller_name == 'news' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::News.model_name.human_plural, cmtool.news_index_path - %li{:class => controller_name == 'keywords' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::Keyword.model_name.human_plural, cmtool.keywords_path - %li{:class => controller_name == 'faqs' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::Faq.model_name.human_plural, cmtool.faqs_path - %li{:class => controller_name == 'quotes' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::Quote.model_name.human_plural, cmtool.quotes_path - %li{:class => %w[contact_forms demo_requests call_requests newsletter_subscriptions].include?(controller_name) ? ['ui-state-active', 'parent'] : ['ui-state-default', 'parent']} - %span.title= t('cmtool.menu.forms.title') - %ul.child-menu - %li{:class => controller_name == 'contact_forms' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::ContactForm.model_name.human_plural, cmtool.contact_forms_path - %li{:class => controller_name == 'newsletter_subscriptions' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::NewsletterSubscription.model_name.human_plural, cmtool.newsletter_subscriptions_path - %li{:class => controller_name == 'users' ? 'ui-state-active' : 'ui-state-default'}=link_to User.model_name.human_plural, cmtool.users_path - %li{:class => controller_name == 'images' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::Image.model_name.human_plural, cmtool.images_path - %li{:class => controller_name == 'directories' ? 'ui-state-active' : 'ui-state-default'}=link_to Cmtool::Directory.model_name.human_plural, cmtool.directories_path - .clear - #sub-navigation-container - = yield :page_links - .clear - #title-container - %h1#title= yield :title - #content-container - = render 'alerts' - #content - =yield diff --git a/app/views/layouts/cmtool/application.html.slim b/app/views/layouts/cmtool/application.html.slim index 1292664..a0daacf 100644 --- a/app/views/layouts/cmtool/application.html.slim +++ b/app/views/layouts/cmtool/application.html.slim @@ -70,12 +70,16 @@ html lang="en" .row .span9 = content_for?(:content) ? yield(:content) : yield + - if content_for?(:page_links) + #sub-navigation-container.form-actions = yield(:page_links) + .span3 .well.sidebar-nav h3= content_for?(:page_title) ? yield(:page_title) : application_title ul.nav.nav-list li.nav-header Links li= link_to "Home", root_path + li= link_to 'Wiki', 'https://github.com/bterkuile/cmtool/wiki', target: :_blank = yield :sidebar footer diff --git a/app/views/layouts/cmtool/devise.html.slim b/app/views/layouts/cmtool/devise.html.slim index 8a59d72..b73a676 100644 --- a/app/views/layouts/cmtool/devise.html.slim +++ b/app/views/layouts/cmtool/devise.html.slim @@ -1,3 +1,3 @@ - content_for :content do .devise= yield -= render :template => 'layouts/application' += render :template => 'layouts/cmtool/application' diff --git a/app/views/layouts/cmtool/sessions.html.haml b/app/views/layouts/cmtool/sessions.html.haml deleted file mode 100644 index be6eaef..0000000 --- a/app/views/layouts/cmtool/sessions.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -!!! Strict -%html{"xml:lang" => I18n.locale, :lang => I18n.locale} - %head - %title Login - = csrf_meta_tag - = stylesheet_link_tag 'cmtool/sessions/application' - = javascript_include_tag 'cmtool/sessions/application' - %body - #page-wrapper - #content-container - #content - = render 'cmtool/application/alerts' - = yield - .clear diff --git a/spec/dummy/config/initializers/devise.rb b/config/initializers/devise.rb similarity index 96% rename from spec/dummy/config/initializers/devise.rb rename to config/initializers/devise.rb index eff990e..c9a65e1 100644 --- a/spec/dummy/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -16,7 +16,7 @@ Devise.setup do |config| # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be # available as additional gems. - # require 'devise/orm/' + require 'devise/orm/simply_stored' # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating a user. The default is @@ -55,7 +55,7 @@ Devise.setup do |config| # It can be set to an array that will enable http authentication only for the # given strategies, for example, `config.http_authenticatable = [:token]` will # enable it only for token authentication. - # config.http_authenticatable = false + # config.http_authenticatable = [:token] # If http headers should be returned for AJAX requests. True by default. # config.http_authenticatable_on_xhr = true @@ -85,7 +85,7 @@ Devise.setup do |config| config.stretches = Rails.env.test? ? 1 : 10 # Setup a pepper to generate the encrypted password. - # config.pepper = "4d61ec240ec1a40b14433880885d34d96c937689a2756f88a65895640e20e69275ec4252b6c4b2d34a6cad3368a9f04b25221d02d230163ae50b4ff7d6ac0257" + # config.pepper = "0645e56df1cf3f1fabb289964a240de9069b044768999ea2bec0ff49794c0613273f9a29c013f47574c9c225b0d5dbe9a8d961ba49dd9a3e878a0da539905b56" # ==> Configuration for :confirmable # A period that the user is allowed to access the website even without @@ -176,7 +176,7 @@ Devise.setup do |config| # ==> Configuration for :token_authenticatable # Defines name of the authentication token params key - # config.token_authentication_key = :auth_token + config.token_authentication_key = :auth_token # ==> Scopes configuration # Turn scoped views on. Before rendering "sessions/new", it will first check for @@ -191,7 +191,7 @@ Devise.setup do |config| # Configure sign_out behavior. # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope). # The default is true, which means any logout action will sign out all active scopes. - # config.sign_out_all_scopes = true + config.sign_out_all_scopes = false # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like @@ -205,7 +205,7 @@ Devise.setup do |config| # config.navigational_formats = ["*/*", :html] # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete + config.sign_out_via = [:delete, :get] # ==> OmniAuth # Add a new OmniAuth provider. Check the wiki for more information on setting diff --git a/config/locales/cmtool.en.yml b/config/locales/cmtool.en.yml index 7c5c814..8befcb9 100644 --- a/config/locales/cmtool.en.yml +++ b/config/locales/cmtool.en.yml @@ -31,12 +31,16 @@ en: show: title: Show %{model} destroy: - title: Destroy %{model} + title: Delete %{model} successful: '%{model} successfully deleted' directory: add_file: Add file add_image: label: Add %{image} + table: + index: + edit: '' + destroy: '' news: remove_image: Remove image newsletter_subscription: diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml new file mode 100644 index 0000000..2ede53b --- /dev/null +++ b/config/locales/devise.en.yml @@ -0,0 +1,71 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +en: + errors: + messages: + expired: "has expired, please request a new one" + not_found: "not found" + already_confirmed: "was already confirmed, please try signing in" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" + + devise: + failure: + already_authenticated: 'You are already signed in.' + unauthenticated: 'You need to sign in or sign up before continuing.' + unconfirmed: 'You have to confirm your account before continuing.' + locked: 'Your account is locked.' + invalid: 'Invalid email or password.' + invalid_token: 'Invalid authentication token.' + timeout: 'Your session expired, please sign in again to continue.' + inactive: 'Your account was not activated yet.' + sessions: + title: Sign in + button: Sign in + remember_me: Remember me + forgot_your_password: 'Forgot your password?' + signed_in: 'Signed in successfully.' + signed_out: 'Signed out successfully.' + passwords: + title: Forgot your password? + button: 'Send me reset password instructions' + send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' + updated: 'Your password was changed successfully. You are now signed in.' + updated_not_active: 'Your password was changed successfully.' + send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail" + edit: + title: 'Change your password' + button: 'Change my password' + confirmations: + did_not_receive_instructions_link: "Didn't receive confirmation instructions?" + send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' + send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.' + confirmed: 'Your account was successfully confirmed. You are now signed in.' + registrations: + title: Sign up + button: Sign up + signed_up: 'Welcome! You have signed up successfully.' + signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.' + signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.' + signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.' + updated: 'You updated your account successfully.' + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." + destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' + unlocks: + did_not_receive_instructions_link: "Didn't receive unlock instructions?" + send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' + unlocked: 'Your account has been unlocked successfully. Please sign in to continue.' + send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.' + omniauth_callbacks: + sign_in_with: "Sign in with %{provider}" + success: 'Successfully authorized from %{kind} account.' + failure: 'Could not authorize you from %{kind} because "%{reason}".' + mailer: + confirmation_instructions: + subject: 'Confirmation instructions' + reset_password_instructions: + subject: 'Reset password instructions' + unlock_instructions: + subject: 'Unlock Instructions' diff --git a/config/locales/devise.nl.yml b/config/locales/devise.nl.yml new file mode 100644 index 0000000..5c740d2 --- /dev/null +++ b/config/locales/devise.nl.yml @@ -0,0 +1,73 @@ +nl: + errors: + messages: + not_found: "bestaat niet" + already_confirmed: "was reeds bevestigd" + not_locked: "was niet vergrendeld" + not_saved: + one: "Een fout verhinderde het uitvoeren van de actie:" + other: "%{count} fouten verhinderden het uitvoeren van de actie:" + + devise: + failure: + already_authenticated: 'U bent reeds ingelogd.' + unauthenticated: 'U moet inloggen voordat u verder kunt' + unconfirmed: 'U dient deze account te bevestigen voordat u verder kunt.' + locked: 'Uw account is geblokkeerd.' + invalid: 'Deze login gegevens zijn niet geldig' + invalid_token: 'Invalid authentication token.' + timeout: 'Uw sessie is verlopen. U moet opnieuw inloggen om verder te gaan.' + inactive: 'Your account was not activated yet.' + sessions: + title: Inloggen + button: Inloggen + signed_in: Succesvol ingelogd + signed_out: Succesvol uitgelogd + signed_in_as: Ingelogd als + forgot_your_password: Wachtwoord vergeten? + sign_out: Uitloggen + sign_in: Inloggen + remember_me: Ingelogd blijven? + passwords: + title: Wachtwoord vergeten? + button: 'Stuur mij instructies voor het vernieuwen van mijn wachtwoord' + send_instructions: 'U ontvangt binnen enkele minuten een e-mail met instructies voor het resetten van uw wachtwoord' + updated: 'Uw wachtwoord is succesvol gewijzigd. U bent nu ingelogd.' + forgot_password: Wachtwoord vergeten? + send_instructions_button: Stuur mij reset instructies + confirmations: + send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' + confirmed: 'Your account was successfully confirmed. You are now signed in.' + did_not_receive_instructions_link: "Heeft u geen bevestigingsinstructies ontvangen?" + did_not_receive: Heeft u geen bevestigingsinstructies ontvangen? + registrations: + title: Aanmelden + button: Aanmelden + signed_up: 'Welcome! You have signed up successfully.' + signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.' + signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.' + signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.' + updated: 'You updated your account successfully.' + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." + + signed_up: 'You have signed up successfully. If enabled, a confirmation was sent your e-mail.' + updated: 'You updated your account successfully.' + destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' + sign_up: Acount aanvragen + unlocks: + did_not_receive_instructions_link: "Didn't receive unlock instructions?" + send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' + unlocked: 'Your account was successfully unlocked. You are now signed in.' + did_not_receive: Heeft u geen deblokkeerinstructies ontvangen? + send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.' + omniauth_callbacks: + sign_in_with: "Sign in with %{provider}" + success: 'Successfully authorized from %{kind} account.' + failure: 'Could not authorize you from %{kind} because "%{reason}".' + mailer: + confirmation_instructions: + subject: 'Bevestigingsinstructies' + reset_password_instructions: + subject: 'Wachtwoord reset instructies' + unlock_instructions: + subject: 'Ontsluitings instructies' diff --git a/spec/cmtool_menu_spec.rb b/spec/cmtool_menu_spec.rb index a2396fd..445bc6e 100644 --- a/spec/cmtool_menu_spec.rb +++ b/spec/cmtool_menu_spec.rb @@ -55,6 +55,9 @@ describe Cmtool::Menu do end end end + it "should have 7 items now" do + Cmtool::Menu.items.size.should == 7 + end it "should have pages as second last items argument" do second_last = Cmtool::Menu.items[-2] second_last.should be_a Cmtool::Menu::ResourceLink