diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-17 12:05:14 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-17 12:05:14 +0100 |
commit | eaad37485fe59d0306c37cc038dda6d210052910 (patch) | |
tree | 072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/shared | |
parent | 3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff) | |
parent | b80bd744ad873f6fc43018bc4bfb90677de167bd (diff) |
Merge branch 'develop'
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/_create_link.html.haml | 11 | ||||
-rw-r--r-- | app/views/shared/_flash.html.haml | 19 | ||||
-rw-r--r-- | app/views/shared/_header.de.html.haml | 41 | ||||
-rw-r--r-- | app/views/shared/_header.html.haml | 41 | ||||
-rw-r--r-- | app/views/shared/_index_view_edit_destroy_part.html.haml | 29 | ||||
-rw-r--r-- | app/views/shared/_show_edit_destroy_part.html.haml | 16 | ||||
-rw-r--r-- | app/views/shared/_system_message.html.haml | 10 |
7 files changed, 167 insertions, 0 deletions
diff --git a/app/views/shared/_create_link.html.haml b/app/views/shared/_create_link.html.haml new file mode 100644 index 0000000..103c82b --- /dev/null +++ b/app/views/shared/_create_link.html.haml @@ -0,0 +1,11 @@ +- if !(defined? parent).nil? && !(defined? child_class).nil? + - 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) + - 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) +- 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 diff --git a/app/views/shared/_flash.html.haml b/app/views/shared/_flash.html.haml new file mode 100644 index 0000000..320fd15 --- /dev/null +++ b/app/views/shared/_flash.html.haml @@ -0,0 +1,19 @@ +- 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/_header.de.html.haml b/app/views/shared/_header.de.html.haml new file mode 100644 index 0000000..c6205ae --- /dev/null +++ b/app/views/shared/_header.de.html.haml @@ -0,0 +1,41 @@ +%header#main + .light + %h1.gemeinschaft-logo + - if @current_user && @current_user.current_tenant + = link_to "Gemeinschaft", tenant_path(@current_user.current_tenant) + - else + = link_to "Gemeinschaft", root_url + + - if current_user + = form_tag '/search' do + %div.search-box + - if GuiFunction.display?('search_field_in_top_navigation_bar', current_user) + %input.text{:value => 'Suchen ...', :name => 'q'} + %input{:type => 'submit', :value => ''} + + / Adjustable Navigation. + - if current_user + - if navigation_items.size > 0 + - navigation_items.each do |item| + - if GuiFunction.display?('navigation_items_in_top_navigation_bar', current_user) + %span + = link_to item[:title], item[:url] + + - if current_user + .user-context + %a.user{:href => tenant_user_path(current_user.current_tenant.id, current_user.id)} + - if GuiFunction.display?('user_avatar_in_top_navigation_bar', current_user) + - if current_user.image? && current_user.image_url(:mini) + = image_tag current_user.image_url(:mini).to_s, :class => 'display' + - else + - if current_user.male? + = image_tag 'icons/user-male-16x.png', :class => 'display logged-out' + - else + = image_tag 'icons/user-female-16x.png', :class => 'display logged-out' + = current_user + = link_to( "[x]", log_out_path, :class => 'logout', :title => "Abmelden" ) # Temporary way of logging out. + - else + .user-context + = link_to "Registrieren", sign_up_path + oder + = link_to "Anmelden", log_in_path diff --git a/app/views/shared/_header.html.haml b/app/views/shared/_header.html.haml new file mode 100644 index 0000000..377d8e0 --- /dev/null +++ b/app/views/shared/_header.html.haml @@ -0,0 +1,41 @@ +%header#main + .light + %h1.gemeinschaft-logo + - if @current_user && @current_user.current_tenant + = link_to "Gemeinschaft", tenant_path(@current_user.current_tenant) + - else + = link_to "Gemeinschaft", root_url + + - if current_user + = form_tag '/search' do + %div.search-box + - if GuiFunction.display?('search_field_in_top_navigation_bar', current_user) + %input.text{:value => 'Search ...', :name => 'q'} + %input{:type => 'submit', :value => ''} + + / Adjustable Navigation. + - if current_user + - if navigation_items.size > 0 + - navigation_items.each do |item| + - if GuiFunction.display?('navigation_items_in_top_navigation_bar', current_user) + %span + = link_to item[:title], item[:url] + + - if current_user + .user-context + %a.user{:href => tenant_user_path(current_user.current_tenant.id, current_user.id)} + - if GuiFunction.display?('user_avatar_in_top_navigation_bar', current_user) + - if current_user.image? && current_user.image_url(:mini) + = image_tag current_user.image_url(:mini).to_s, :class => 'display' + - else + - if current_user.male? + = image_tag 'icons/user-male-16x.png', :class => 'display logged-out' + - else + = image_tag 'icons/user-female-16x.png', :class => 'display logged-out' + = current_user + = link_to( "[x]", log_out_path, :class => 'logout', :title => "Log out" ) # Temporary way of logging out. + - else + .user-context + = link_to "Sign up", sign_up_path + or + = link_to "Log in", log_in_path diff --git a/app/views/shared/_index_view_edit_destroy_part.html.haml b/app/views/shared/_index_view_edit_destroy_part.html.haml new file mode 100644 index 0000000..06ec904 --- /dev/null +++ b/app/views/shared/_index_view_edit_destroy_part.html.haml @@ -0,0 +1,29 @@ +- style = 'width:35px' + +- 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?) + %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 + +- 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
\ 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 new file mode 100644 index 0000000..aff18d1 --- /dev/null +++ b/app/views/shared/_show_edit_destroy_part.html.haml @@ -0,0 +1,16 @@ +%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) + - 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 + + - 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) + - 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 diff --git a/app/views/shared/_system_message.html.haml b/app/views/shared/_system_message.html.haml new file mode 100644 index 0000000..4aabb9c --- /dev/null +++ b/app/views/shared/_system_message.html.haml @@ -0,0 +1,10 @@ +- 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 |