From 18ed88c7e3c789366f6e5443dc4ee0bc981a4b88 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 20:18:16 +0100 Subject: Started the migration to Twitter Bootstrap. --- app/views/shared/_create_link.html.haml | 13 +++-- app/views/shared/_flash.html.haml | 19 ------- .../shared/_index_view_edit_destroy_part.html.haml | 62 ++++++++++++---------- app/views/shared/_show_edit_destroy_part.html.haml | 20 ++++--- app/views/shared/_system_message.html.haml | 10 ---- 5 files changed, 55 insertions(+), 69 deletions(-) delete mode 100644 app/views/shared/_flash.html.haml delete mode 100644 app/views/shared/_system_message.html.haml (limited to 'app/views/shared') diff --git a/app/views/shared/_create_link.html.haml b/app/views/shared/_create_link.html.haml index 103c82b..e5bc840 100644 --- a/app/views/shared/_create_link.html.haml +++ b/app/views/shared/_create_link.html.haml @@ -2,10 +2,17 @@ - if can? :create, parent.send(child_class.name.underscore.pluralize).build %p - if t("#{child_class.name.underscore.pluralize}.index.actions.create_for").include?('translation missing') || (!(defined? short_link).nil? && short_link == true) - = link_to t("#{child_class.name.underscore.pluralize}.index.actions.create"), method( :"new_#{parent.class.name.underscore}_#{child_class.name.underscore}_path" ).(parent) + %a.btn.btn-mini.btn-primary{:href => method( :"new_#{parent.class.name.underscore}_#{child_class.name.underscore}_path" ).(parent) } + %i.icon-plus.icon-white + =t("#{child_class.name.underscore.pluralize}.index.actions.create") - else - = link_to t("#{child_class.name.underscore.pluralize}.index.actions.create_for", :resource => parent.to_s), method( :"new_#{parent.class.name.underscore}_#{child_class.name.underscore}_path" ).(parent) + %a.btn.btn-mini.btn-primary{:href => method( :"new_#{parent.class.name.underscore}_#{child_class.name.underscore}_path" ).(parent) } + %i.icon-plus.icon-white + =t("#{child_class.name.underscore.pluralize}.index.actions.create_for", :resource => parent) + - elsif !(defined? child_class).nil? - if can? :create, child_class %p - = link_to t("#{child_class.name.underscore.pluralize}.index.actions.create"), method( :"new_#{child_class.name.underscore}_path" ).() \ No newline at end of file + %a.btn.btn-mini.btn-primary{:href => method( :"new_#{child_class.name.underscore}_path" ).() } + %i.icon-plus.icon-white + =t("#{child_class.name.underscore.pluralize}.index.actions.create") \ No newline at end of file diff --git a/app/views/shared/_flash.html.haml b/app/views/shared/_flash.html.haml deleted file mode 100644 index 320fd15..0000000 --- a/app/views/shared/_flash.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -- flash.each do |type, msg| - .flash{:class => type} - .light - .sign= resolve_flash_sign(type) - .message= msg - - --# These are the available types: --# --# .flash.notice --# .light --# .sign i --# .message Lorem ipsum dolor sit amet, consectetur adipisicing eli.w --# --# .flash.warning --# .light --# .sign ! --# .message Lorem ipsum dolor sit amet, consectetur adipisicing eli.w - diff --git a/app/views/shared/_index_view_edit_destroy_part.html.haml b/app/views/shared/_index_view_edit_destroy_part.html.haml index ff5a988..5bc715b 100644 --- a/app/views/shared/_index_view_edit_destroy_part.html.haml +++ b/app/views/shared/_index_view_edit_destroy_part.html.haml @@ -1,35 +1,39 @@ -- style = 'width:35px' +- style = 'width:70px' - if !(defined? parent).nil? && !(defined? child).nil? - %td{ :style => style } - - if can? :show, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.show"), method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) - %td{ :style => style } - - if can? :edit, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.edit"), method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) - %td{ :style => style } - - if can? :destroy, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.destroy"), method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :delete - - if child.respond_to?(:move_up?) or child and child.respond_to?(:move_down?) + - if can? :show, child %td{ :style => style } - - if can? :move_down, child and child.respond_to?(:move_down?) and child.move_down? - = link_to '⇩'.html_safe, method( :"move_lower_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :put - - if can? :move_up, child and child.respond_to?(:move_up?) and child.move_up? - = link_to '⇧'.html_safe, method( :"move_higher_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :put + %a.btn.btn-mini.btn-success{:href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) } + %i.icon-info-sign.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.show") + + - if can? :edit, child + %td{ :style => style } + %a.btn.btn-mini.btn-warning{:href => method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) } + %i.icon-edit.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.edit") + + - if can? :destroy, child + %td{ :style => style } + %a.btn.btn-mini.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :rel => "nofollow"} + %i.icon-trash.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.destroy") - elsif !(defined? child).nil? - %td{ :style => style } - - if can? :show, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.show"), method( :"#{child.class.name.underscore}_path" ).(child) - %td{ :style => style } - - if can? :edit, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.edit"), method( :"edit_#{child.class.name.underscore}_path" ).(child) - %td{ :style => style } - - if can? :destroy, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.destroy"), method( :"#{child.class.name.underscore}_path" ).(child), :method => :delete - - if child.respond_to?(:move_up?) or child and child.respond_to?(:move_down?) + - if can? :show, child + %td{ :style => style } + %a.btn.btn-mini.btn-success{:href => method( :"#{child.class.name.underscore}_path" ).(child) } + %i.icon-info-sign.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.show") + + - if can? :edit, child + %td{ :style => style } + %a.btn.btn-mini.btn-warning{:href => method( :"edit_#{child.class.name.underscore}_path" ).(child) } + %i.icon-edit.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.edit") + + - if can? :destroy, child %td{ :style => style } - - if can? :move_down, child and child.respond_to?(:move_down?) and child.move_down? - = link_to '⇩'.html_safe, method( :"move_lower_#{child.class.name.underscore}_path" ).(child), :method => :put - - if can? :move_up, child and child.respond_to?(:move_up?) and child.move_up? - = link_to '⇧'.html_safe, method( :"move_higher_#{child.class.name.underscore}_path" ).(child), :method => :put + %a.btn.btn-mini.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{child.class.name.underscore}_path" ).(child), :rel => "nofollow"} + %i.icon-trash.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.destroy") \ No newline at end of file diff --git a/app/views/shared/_show_edit_destroy_part.html.haml b/app/views/shared/_show_edit_destroy_part.html.haml index aff18d1..e82c667 100644 --- a/app/views/shared/_show_edit_destroy_part.html.haml +++ b/app/views/shared/_show_edit_destroy_part.html.haml @@ -1,16 +1,20 @@ %p - if !(defined? parent).nil? && !(defined? child).nil? - if can? :edit, child - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.edit"), method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) + %a.btn.btn-warning{:href => method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) } + %i.icon-edit.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.edit") - if can? :destroy, child - - if can? :edit, child - | - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.destroy"), method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :method => :delete + %a.btn.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :rel => "nofollow"} + %i.icon-trash.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.destroy") - elsif !(defined? child).nil? - if can? :edit, child - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.edit"), method( :"edit_#{child.class.name.underscore}_path" ).(child) + %a.btn.btn-warning{:href => method( :"edit_#{child.class.name.underscore}_path" ).(child) } + %i.icon-edit.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.edit") - if can? :destroy, child - - if can? :edit, child - | - = link_to t("#{child.class.name.underscore.pluralize}.show.actions.destroy"), method( :"#{child.class.name.underscore}_path" ).(child), :method => :delete \ No newline at end of file + %a.btn.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{child.class.name.underscore}_path" ).(child), :rel => "nofollow"} + %i.icon-trash.icon-white + =t("#{child.class.name.underscore.pluralize}.actions.destroy") \ No newline at end of file diff --git a/app/views/shared/_system_message.html.haml b/app/views/shared/_system_message.html.haml deleted file mode 100644 index 4aabb9c..0000000 --- a/app/views/shared/_system_message.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -- if current_user - .flash.notice#system_message_display - .light - .sign i - .message#system_message This is the place to display incoming calls and other stuff. - - = subscribe_to "/users/#{current_user.id}/system_messages" - - :javascript - $('#system_message_display').hide() \ No newline at end of file -- cgit v1.2.3 From d8fe3b636cab1504cb5d3cb5dc57ed818749ccf5 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 21:30:48 +0100 Subject: Twitter Bootstrap stuff. --- app/views/shared/_create_link.html.haml | 3 ++- .../shared/_index_view_edit_destroy_part.html.haml | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'app/views/shared') diff --git a/app/views/shared/_create_link.html.haml b/app/views/shared/_create_link.html.haml index e5bc840..0711ddf 100644 --- a/app/views/shared/_create_link.html.haml +++ b/app/views/shared/_create_link.html.haml @@ -8,7 +8,8 @@ - else %a.btn.btn-mini.btn-primary{:href => method( :"new_#{parent.class.name.underscore}_#{child_class.name.underscore}_path" ).(parent) } %i.icon-plus.icon-white - =t("#{child_class.name.underscore.pluralize}.index.actions.create_for", :resource => parent) + / =t("#{child_class.name.underscore.pluralize}.index.actions.create_for", :resource => parent.to_s) + =t("#{child_class.name.underscore.pluralize}.index.actions.create") - elsif !(defined? child_class).nil? - if can? :create, child_class diff --git a/app/views/shared/_index_view_edit_destroy_part.html.haml b/app/views/shared/_index_view_edit_destroy_part.html.haml index 5bc715b..00b9e8a 100644 --- a/app/views/shared/_index_view_edit_destroy_part.html.haml +++ b/app/views/shared/_index_view_edit_destroy_part.html.haml @@ -1,39 +1,40 @@ -- style = 'width:70px' +- style = 'width:90px' +- style = '' - if !(defined? parent).nil? && !(defined? child).nil? - if can? :show, child %td{ :style => style } %a.btn.btn-mini.btn-success{:href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) } %i.icon-info-sign.icon-white - =t("#{child.class.name.underscore.pluralize}.actions.show") + =t("#{child.class.name.underscore.pluralize}.index.actions.show") - if can? :edit, child %td{ :style => style } %a.btn.btn-mini.btn-warning{:href => method( :"edit_#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child) } %i.icon-edit.icon-white - =t("#{child.class.name.underscore.pluralize}.actions.edit") + =t("#{child.class.name.underscore.pluralize}.index.actions.edit") - if can? :destroy, child %td{ :style => style } - %a.btn.btn-mini.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :rel => "nofollow"} - %i.icon-trash.icon-white - =t("#{child.class.name.underscore.pluralize}.actions.destroy") + %a.btn.btn-mini.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.index.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{parent.class.name.underscore}_#{child.class.name.underscore}_path" ).(parent, child), :rel => "nofollow"} + %i.icon-remove.icon-white + =t("#{child.class.name.underscore.pluralize}.index.actions.destroy") - elsif !(defined? child).nil? - if can? :show, child %td{ :style => style } %a.btn.btn-mini.btn-success{:href => method( :"#{child.class.name.underscore}_path" ).(child) } %i.icon-info-sign.icon-white - =t("#{child.class.name.underscore.pluralize}.actions.show") + =t("#{child.class.name.underscore.pluralize}.index.actions.show") - if can? :edit, child %td{ :style => style } %a.btn.btn-mini.btn-warning{:href => method( :"edit_#{child.class.name.underscore}_path" ).(child) } %i.icon-edit.icon-white - =t("#{child.class.name.underscore.pluralize}.actions.edit") + =t("#{child.class.name.underscore.pluralize}.index.actions.edit") - if can? :destroy, child %td{ :style => style } - %a.btn.btn-mini.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{child.class.name.underscore}_path" ).(child), :rel => "nofollow"} + %a.btn.btn-mini.btn-danger{"data-confirm" => t("#{child.class.name.underscore.pluralize}.index.actions.confirm_detroy"), "data-method" => "delete", :href => method( :"#{child.class.name.underscore}_path" ).(child), :rel => "nofollow"} %i.icon-trash.icon-white - =t("#{child.class.name.underscore.pluralize}.actions.destroy") \ No newline at end of file + =t("#{child.class.name.underscore.pluralize}.index.actions.destroy") \ No newline at end of file -- cgit v1.2.3