summaryrefslogtreecommitdiff
path: root/app/views/gui_functions
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:05:14 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-17 12:05:14 +0100
commiteaad37485fe59d0306c37cc038dda6d210052910 (patch)
tree072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/views/gui_functions
parent3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff)
parentb80bd744ad873f6fc43018bc4bfb90677de167bd (diff)
Merge branch 'develop'
Diffstat (limited to 'app/views/gui_functions')
-rw-r--r--app/views/gui_functions/_form.html.haml7
-rw-r--r--app/views/gui_functions/_form_core.html.haml10
-rw-r--r--app/views/gui_functions/_index_core.html.haml26
-rw-r--r--app/views/gui_functions/edit.html.haml3
-rw-r--r--app/views/gui_functions/index.html.haml6
-rw-r--r--app/views/gui_functions/new.html.haml3
-rw-r--r--app/views/gui_functions/show.html.haml18
7 files changed, 73 insertions, 0 deletions
diff --git a/app/views/gui_functions/_form.html.haml b/app/views/gui_functions/_form.html.haml
new file mode 100644
index 0000000..0b2a201
--- /dev/null
+++ b/app/views/gui_functions/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for(@gui_function) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('gui_functions.form.submit') \ No newline at end of file
diff --git a/app/views/gui_functions/_form_core.html.haml b/app/views/gui_functions/_form_core.html.haml
new file mode 100644
index 0000000..c2d6cd7
--- /dev/null
+++ b/app/views/gui_functions/_form_core.html.haml
@@ -0,0 +1,10 @@
+.inputs
+ = f.input :category, :label => t('gui_functions.form.category.label'), :hint => conditional_hint('gui_functions.form.category.hint')
+ = f.input :name, :label => t('gui_functions.form.name.label'), :hint => conditional_hint('gui_functions.form.name.hint')
+ = f.input :description, :label => t('gui_functions.form.description.label'), :hint => conditional_hint('gui_functions.form.description.hint')
+
+ - counter = 0
+ = f.fields_for :gui_function_memberships do |gui_function_membership|
+ = gui_function_membership.hidden_field :user_group_id
+ = gui_function_membership.input :activated, :label => @user_groups[counter], :hint => conditional_hint('gui_functions.form.activated.hint')
+ - counter = counter + 1 \ No newline at end of file
diff --git a/app/views/gui_functions/_index_core.html.haml b/app/views/gui_functions/_index_core.html.haml
new file mode 100644
index 0000000..093a0d7
--- /dev/null
+++ b/app/views/gui_functions/_index_core.html.haml
@@ -0,0 +1,26 @@
+%table
+ %tr
+ %th= t('gui_functions.index.category')
+ %th= t('gui_functions.index.name')
+ - @user_groups.each do |user_group|
+ %th= user_group
+
+ - reset_cycle
+ - for gui_function in gui_functions
+ %tr{:class => cycle('odd', 'even')}
+ %td= gui_function.category
+ %td
+ = gui_function.name
+ - if !gui_function.description.blank?
+ %br
+ %i= gui_function.description
+ - @user_groups.each do |user_group|
+ - if gui_function.gui_function_memberships.find_by_user_group_id(user_group.id)
+ - if gui_function.gui_function_memberships.find_by_user_group_id(user_group.id).activated == true
+ %td= 'x'
+ - else
+ %td= ''
+ - else
+ %td= 'x'
+
+ =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => gui_function} \ No newline at end of file
diff --git a/app/views/gui_functions/edit.html.haml b/app/views/gui_functions/edit.html.haml
new file mode 100644
index 0000000..f43b5bc
--- /dev/null
+++ b/app/views/gui_functions/edit.html.haml
@@ -0,0 +1,3 @@
+- title t("gui_functions.edit.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/gui_functions/index.html.haml b/app/views/gui_functions/index.html.haml
new file mode 100644
index 0000000..ef909f0
--- /dev/null
+++ b/app/views/gui_functions/index.html.haml
@@ -0,0 +1,6 @@
+- title t("gui_functions.index.page_title")
+
+- if @gui_functions && @gui_functions.count > 0
+ = render "index_core", :gui_functions => @gui_functions
+
+= render :partial => 'shared/create_link', :locals => {:child_class => GuiFunction} \ No newline at end of file
diff --git a/app/views/gui_functions/new.html.haml b/app/views/gui_functions/new.html.haml
new file mode 100644
index 0000000..6c57e9c
--- /dev/null
+++ b/app/views/gui_functions/new.html.haml
@@ -0,0 +1,3 @@
+- title t("gui_functions.new.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/gui_functions/show.html.haml b/app/views/gui_functions/show.html.haml
new file mode 100644
index 0000000..0fc2dd9
--- /dev/null
+++ b/app/views/gui_functions/show.html.haml
@@ -0,0 +1,18 @@
+- title t("gui_functions.show.page_title")
+
+%p
+ %strong= t('gui_functions.show.name') + ":"
+ = @gui_function.name
+%p
+ %strong= t('gui_functions.show.description') + ":"
+ = @gui_function.description
+
+- @user_groups.each do |user_group|
+ %p
+ %strong= "#{user_group}:"
+ - if @gui_function.gui_function_memberships.where(:user_group_id => user_group.id, :activated => true).count > 0
+ = 'x'
+ - else
+ = 'not activated'
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @gui_function } \ No newline at end of file