helena_administration 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rubocop.yml +18 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +44 -0
  6. data/Gemfile.lock +309 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.md +82 -0
  9. data/Rakefile +28 -0
  10. data/app/assets/images/helena_administration/.keep +0 -0
  11. data/app/assets/javascripts/helena_administration.js.coffee +20 -0
  12. data/app/assets/javascripts/polyfills.js +10 -0
  13. data/app/assets/stylesheets/_dashboard.sass +4 -0
  14. data/app/assets/stylesheets/_layout.sass +50 -0
  15. data/app/assets/stylesheets/_media_queries.scss +18 -0
  16. data/app/assets/stylesheets/_variables.sass +19 -0
  17. data/app/assets/stylesheets/helena_administration.css.sass +27 -0
  18. data/app/controllers/helena_administration/application_controller.rb +19 -0
  19. data/app/controllers/helena_administration/dashboard_controller.rb +11 -0
  20. data/app/controllers/helena_administration/import_surveys_controller.rb +40 -0
  21. data/app/controllers/helena_administration/question_groups_controller.rb +68 -0
  22. data/app/controllers/helena_administration/questions/checkbox_groups_controller.rb +15 -0
  23. data/app/controllers/helena_administration/questions/checkbox_matrix_controller.rb +7 -0
  24. data/app/controllers/helena_administration/questions/long_texts_controller.rb +11 -0
  25. data/app/controllers/helena_administration/questions/radio_groups_controller.rb +15 -0
  26. data/app/controllers/helena_administration/questions/radio_matrix_controller.rb +7 -0
  27. data/app/controllers/helena_administration/questions/short_texts_controller.rb +11 -0
  28. data/app/controllers/helena_administration/questions/static_texts_controller.rb +11 -0
  29. data/app/controllers/helena_administration/questions_controller.rb +96 -0
  30. data/app/controllers/helena_administration/sessions_controller.rb +60 -0
  31. data/app/controllers/helena_administration/surveys_controller.rb +71 -0
  32. data/app/controllers/helena_administration/versions_controller.rb +82 -0
  33. data/app/helpers/helena_administration/application_helper.rb +14 -0
  34. data/app/models/helena_administration/import_survey_form.rb +9 -0
  35. data/app/views/helena_administration/application/_chromeframe.html.slim +4 -0
  36. data/app/views/helena_administration/application/_flash_messages.html.haml +5 -0
  37. data/app/views/helena_administration/application/_head.html.slim +13 -0
  38. data/app/views/helena_administration/application/_header.html.slim +16 -0
  39. data/app/views/helena_administration/dashboard/index.html.slim +14 -0
  40. data/app/views/helena_administration/import_surveys/_form.html.slim +11 -0
  41. data/app/views/helena_administration/import_surveys/new.html.slim +1 -0
  42. data/app/views/helena_administration/kaminari/_first_page.html.slim +2 -0
  43. data/app/views/helena_administration/kaminari/_gap.html.slim +2 -0
  44. data/app/views/helena_administration/kaminari/_last_page.html.slim +2 -0
  45. data/app/views/helena_administration/kaminari/_next_page.html.slim +2 -0
  46. data/app/views/helena_administration/kaminari/_page.html.slim +2 -0
  47. data/app/views/helena_administration/kaminari/_paginator.html.slim +11 -0
  48. data/app/views/helena_administration/kaminari/_prev_page.html.slim +2 -0
  49. data/app/views/helena_administration/layouts/application.html.slim +13 -0
  50. data/app/views/helena_administration/question_groups/_form.html.slim +5 -0
  51. data/app/views/helena_administration/question_groups/edit.html.slim +1 -0
  52. data/app/views/helena_administration/question_groups/new.html.slim +1 -0
  53. data/app/views/helena_administration/question_groups/show.html.slim +60 -0
  54. data/app/views/helena_administration/questions/_form.html.slim +15 -0
  55. data/app/views/helena_administration/questions/_labels.html.slim +24 -0
  56. data/app/views/helena_administration/questions/_sub_questions.html.slim +32 -0
  57. data/app/views/helena_administration/questions/edit.html.slim +1 -0
  58. data/app/views/helena_administration/questions/new.html.slim +1 -0
  59. data/app/views/helena_administration/questions/show.html.slim +26 -0
  60. data/app/views/helena_administration/sessions/_form.html.slim +8 -0
  61. data/app/views/helena_administration/sessions/edit.html.slim +1 -0
  62. data/app/views/helena_administration/surveys/_form.html.slim +5 -0
  63. data/app/views/helena_administration/surveys/edit.html.slim +1 -0
  64. data/app/views/helena_administration/surveys/index.html.slim +34 -0
  65. data/app/views/helena_administration/surveys/new.html.slim +1 -0
  66. data/app/views/helena_administration/surveys/show.html.slim +120 -0
  67. data/app/views/helena_administration/versions/_form.html.slim +14 -0
  68. data/app/views/helena_administration/versions/edit.html.slim +1 -0
  69. data/app/views/helena_administration/versions/new.html.slim +1 -0
  70. data/app/views/helena_administration/versions/show.html.slim +68 -0
  71. data/app/views/layouts/helena_administration/application.html.slim +10 -0
  72. data/bin/rails +12 -0
  73. data/config/compass.rb +2 -0
  74. data/config/html5_rails.yml +26 -0
  75. data/config/locales/en.yml +21 -0
  76. data/config/locales/views/dashboard.en.yml +6 -0
  77. data/config/locales/views/import_surveys.en.yml +11 -0
  78. data/config/locales/views/question_groups.en.yml +5 -0
  79. data/config/locales/views/questions.en.yml +5 -0
  80. data/config/locales/views/surveys.en.yml +10 -0
  81. data/config/locales/views/versions.en.yml +11 -0
  82. data/config/routes.rb +24 -0
  83. data/coverage/.resultset.json.lock +0 -0
  84. data/coverage/assets/0.8.0/application.css +799 -0
  85. data/coverage/assets/0.8.0/application.js +1559 -0
  86. data/coverage/assets/0.8.0/colorbox/border.png +0 -0
  87. data/coverage/assets/0.8.0/colorbox/controls.png +0 -0
  88. data/coverage/assets/0.8.0/colorbox/loading.gif +0 -0
  89. data/coverage/assets/0.8.0/colorbox/loading_background.png +0 -0
  90. data/coverage/assets/0.8.0/favicon_green.png +0 -0
  91. data/coverage/assets/0.8.0/favicon_red.png +0 -0
  92. data/coverage/assets/0.8.0/favicon_yellow.png +0 -0
  93. data/coverage/assets/0.8.0/loading.gif +0 -0
  94. data/coverage/assets/0.8.0/magnify.png +0 -0
  95. data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  96. data/coverage/assets/0.8.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  97. data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  98. data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  99. data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  100. data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  101. data/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  102. data/coverage/assets/0.8.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  103. data/coverage/assets/0.8.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
  104. data/coverage/assets/0.8.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  105. data/coverage/assets/0.8.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
  106. data/coverage/assets/0.8.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
  107. data/coverage/assets/0.8.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  108. data/helena_administration.gemspec +37 -0
  109. data/lib/helena_administration/engine.rb +13 -0
  110. data/lib/helena_administration/version.rb +3 -0
  111. data/lib/helena_administration.rb +15 -0
  112. data/lib/tasks/helena_administration_tasks.rake +4 -0
  113. data/spec/controllers/dashboard_controller_spec.rb +11 -0
  114. data/spec/controllers/sessions_controller_spec.rb +102 -0
  115. data/spec/controllers/survey_controller_spec.rb +36 -0
  116. data/spec/dummy/README.rdoc +28 -0
  117. data/spec/dummy/Rakefile +6 -0
  118. data/spec/dummy/app/assets/images/.keep +0 -0
  119. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  120. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  121. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  122. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  123. data/spec/dummy/app/decorators/controllers/helena_administration/application_controller_decorator.rb +5 -0
  124. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  125. data/spec/dummy/app/mailers/.keep +0 -0
  126. data/spec/dummy/app/models/.keep +0 -0
  127. data/spec/dummy/app/models/concerns/.keep +0 -0
  128. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  129. data/spec/dummy/bin/bundle +3 -0
  130. data/spec/dummy/bin/rails +4 -0
  131. data/spec/dummy/bin/rake +4 -0
  132. data/spec/dummy/config/application.rb +27 -0
  133. data/spec/dummy/config/boot.rb +5 -0
  134. data/spec/dummy/config/environment.rb +5 -0
  135. data/spec/dummy/config/environments/development.rb +34 -0
  136. data/spec/dummy/config/environments/production.rb +78 -0
  137. data/spec/dummy/config/environments/test.rb +39 -0
  138. data/spec/dummy/config/initializers/assets.rb +9 -0
  139. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  140. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  141. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  142. data/spec/dummy/config/initializers/inflections.rb +16 -0
  143. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  144. data/spec/dummy/config/initializers/session_store.rb +3 -0
  145. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  146. data/spec/dummy/config/locales/en.yml +23 -0
  147. data/spec/dummy/config/mongoid.yml +13 -0
  148. data/spec/dummy/config/routes.rb +4 -0
  149. data/spec/dummy/config/secrets.yml +22 -0
  150. data/spec/dummy/config.ru +4 -0
  151. data/spec/dummy/lib/assets/.keep +0 -0
  152. data/spec/dummy/log/.keep +0 -0
  153. data/spec/dummy/public/404.html +67 -0
  154. data/spec/dummy/public/422.html +67 -0
  155. data/spec/dummy/public/500.html +66 -0
  156. data/spec/dummy/public/favicon.ico +0 -0
  157. data/spec/features/dashboard/index.html.slim_spec.rb +9 -0
  158. data/spec/features/question_groups/manage_question_groups_spec.rb +97 -0
  159. data/spec/features/questions/manage_questions_spec.rb +108 -0
  160. data/spec/features/questions/question_types/manage_checkbox_group_question_spec.rb +53 -0
  161. data/spec/features/questions/question_types/manage_long_text_question_spec.rb +22 -0
  162. data/spec/features/questions/question_types/manage_radio_group_question_spec.rb +57 -0
  163. data/spec/features/questions/question_types/manage_radio_matrix_question_spec.rb +78 -0
  164. data/spec/features/questions/question_types/manage_short_text_question_spec.rb +20 -0
  165. data/spec/features/questions/question_types/manage_static_text_question_spec.rb +18 -0
  166. data/spec/features/sessions/manage_sessions_spec.rb +51 -0
  167. data/spec/features/surveys/manage_survey_spec.rb +95 -0
  168. data/spec/features/versions/manage_version_spec.rb +113 -0
  169. data/spec/helpers/applicatin_helper_spec.rb +17 -0
  170. data/spec/rails_helper.rb +23 -0
  171. data/spec/spec_helper.rb +63 -0
  172. data/spec/support/.keep +0 -0
  173. metadata +455 -0
@@ -0,0 +1,15 @@
1
+ = simple_form_for [@survey, @version, @question_group, question] do |f|
2
+ = f.input :question_text
3
+ = f.input :code, hint: t('shared.code_hint')
4
+ = f.input :_type, collection: Helena::Question::TYPES.map { |type| [type.model_name.human, type] }
5
+ - if @question.respond_to? :required
6
+ = f.input :required, as: :boolean
7
+ - if @question.is_a?(Helena::Questions::LongText) || @question.is_a?(Helena::Questions::StaticText)
8
+ = f.input :default_value
9
+ - if @question.is_a?(Helena::Questions::ShortText)
10
+ = f.input :default_value, as: :string
11
+ - if @question.includes_labels?
12
+ = render 'labels', form: f
13
+ - if @question.includes_subquestions?
14
+ = render 'sub_questions', form: f
15
+ = f.submit t('shared.save'), class: 'btn btn-success'
@@ -0,0 +1,24 @@
1
+ h3= t '.labels'
2
+ .table-responsive
3
+ table.table.labels
4
+ thead
5
+ tr
6
+ th.position= Helena::Label.human_attribute_name :position
7
+ th.preselected
8
+ th.text= Helena::Label.human_attribute_name :text
9
+ th.value= Helena::Label.human_attribute_name :value
10
+ th.delete
11
+ tbody
12
+ = form.simple_fields_for :labels do |label|
13
+ tr id="#{dom_id(label.object)}"
14
+ td.position
15
+ = label.input :position, as: :integer, label: false
16
+ td.preselected
17
+ = label.input :preselected, as: :boolean, label: Helena::Label.human_attribute_name(:preselected)
18
+ td.text
19
+ = label.input :text, label: false
20
+ td.value
21
+ = label.input :value, label: false
22
+ td.delete
23
+ - unless label.object.new_record?
24
+ = label.input :_destroy, as: :boolean, label: Helena::Label.human_attribute_name(:_destroy)
@@ -0,0 +1,32 @@
1
+ h3= t '.options'
2
+ .table-responsive
3
+ table.table.sub_questions
4
+ thead
5
+ tr
6
+ th.position= Helena::SubQuestion.human_attribute_name :position
7
+ th.position= Helena::SubQuestion.human_attribute_name :code
8
+ - if @question.is_a?(Helena::Questions::CheckboxGroup)
9
+ th.preselected
10
+ th.text= Helena::SubQuestion.human_attribute_name :text
11
+ - if @question.is_a?(Helena::Questions::CheckboxGroup)
12
+ th.value= Helena::SubQuestion.human_attribute_name :value
13
+ th.delete
14
+ tbody
15
+ = form.simple_fields_for :sub_questions do |sub_question|
16
+ tr id="#{dom_id(sub_question.object)}"
17
+ td.position
18
+ = sub_question.input :position, as: :integer, label: false
19
+ td.code
20
+ = sub_question.input :code, label: false, hint: t('shared.code_hint')
21
+ - if @question.is_a?(Helena::Questions::CheckboxGroup)
22
+ td.preselected
23
+ = sub_question.input :preselected, as: :boolean
24
+ td.text
25
+ = sub_question.input :text, label: false
26
+ - if @question.is_a?(Helena::Questions::CheckboxGroup)
27
+ td.value
28
+ = sub_question.input :value, label: false, as: :hidden, value: 1
29
+ td.delete
30
+ - unless sub_question.object.new_record?
31
+ = sub_question.input :_destroy, as: :boolean,
32
+ label: Helena::SubQuestion.human_attribute_name(:_destroy)
@@ -0,0 +1 @@
1
+ = render 'form', question: @question
@@ -0,0 +1 @@
1
+ = render 'form', question: @question
@@ -0,0 +1,26 @@
1
+ div id="#{dom_id(@question)}"
2
+ .row
3
+ .col-md-10
4
+ dl.dl-horizontal
5
+ dt = Helena::Question.human_attribute_name :position
6
+ dd = @question.position
7
+
8
+ dt = Helena::Question.human_attribute_name :code
9
+ dd = @question.code
10
+
11
+ dt = Helena::Question.human_attribute_name :question_text
12
+ dd = @question.question_text
13
+
14
+ dt = Helena::Question.human_attribute_name :type
15
+ dd = @question.class.model_name.human
16
+
17
+ dt = Helena::Question.human_attribute_name :created_at
18
+ dd = distance_of_time_in_words_to_now(@question.created_at)
19
+ .col-md-2
20
+ .pull-right
21
+ = link_to [:edit, @survey, @version, @question_group, @question], class: "btn btn-default #{'disabled' if @version.active}", role: 'button' do
22
+ i.fa.fa-pencil-square-o
23
+ = t('shared.actions.edit')
24
+ = link_to [@survey, @version, @question_group, @question] , class: "btn btn-danger #{'disabled' if @version.active}", method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
25
+ i.fa.fa-remove
26
+ = t('shared.actions.delete')
@@ -0,0 +1,8 @@
1
+ = simple_form_for [@survey, session] do | f |
2
+ = f.input :token
3
+ = f.input :view_token
4
+ = f.input :answers_as_yaml, as: :text, hint: t('shared.yaml_lang_hint_html'), input_html: { cols: 60, rows: 10, class: 'yaml_lang' }
5
+ = f.input :completed, as: :boolean
6
+ = f.input :last_question_group_id, collection: session.version.question_groups,
7
+ label_method: ->(question_group){ t("#{question_group.position}: #{question_group.title || t('shared.untitled')}") }
8
+ = f.submit t('shared.save'), class: 'btn btn-success'
@@ -0,0 +1 @@
1
+ = render 'form', session: @session
@@ -0,0 +1,5 @@
1
+ = simple_form_for(survey) do | f |
2
+ = f.input :name
3
+ = f.input :tag_list
4
+ = f.input :language, collection: I18n.available_locales, include_blank: false
5
+ = f.submit value: t('shared.actions.save'), class: 'btn btn-success'
@@ -0,0 +1 @@
1
+ = render 'form', survey: @survey
@@ -0,0 +1,34 @@
1
+ table.table.table-striped
2
+ thead
3
+ tr
4
+ th.position width='1%' #
5
+ th.name = Helena::Survey.human_attribute_name(:name)
6
+ th.lanugage width='20%' = Helena::Survey.human_attribute_name(:language)
7
+ th.created_at width='10%' = Helena::Survey.human_attribute_name(:created_at)
8
+ th width='20%'
9
+ = link_to new_survey_path, class: 'btn btn-default pull-right', role: 'button' do
10
+ i.fa.fa-plus-square-o
11
+ = t('shared.actions.new')
12
+ = link_to new_import_survey_path, class: 'btn btn-default pull-right', role: 'button' do
13
+ i.fa.fa-caret-square-o-up
14
+ = t('.import')
15
+ tbody
16
+ - @surveys.each do |survey|
17
+ tr id="#{dom_id(survey)}"
18
+ td.position = survey.position
19
+ td.name = link_to survey.name, survey_path(survey)
20
+ td.language = survey.language
21
+ td.create_at = distance_of_time_in_words_to_now(survey.created_at)
22
+ td.actions
23
+ .pull-right
24
+ = link_to survey, class: 'btn btn-default', role: 'button' do
25
+ i.fa.fa-angle-right
26
+ = t('shared.actions.view')
27
+
28
+ = link_to edit_survey_path(survey), class: 'btn btn-default', role: 'button' do
29
+ i.fa.fa-pencil-square-o
30
+ = t('shared.actions.edit')
31
+
32
+ = link_to survey, class: 'btn btn-danger', method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
33
+ i.fa.fa-remove
34
+ = t('shared.actions.delete')
@@ -0,0 +1 @@
1
+ = render 'form', survey: @survey
@@ -0,0 +1,120 @@
1
+ div id="#{dom_id(@survey)}"
2
+ .row
3
+ .col-md-10
4
+ dl.dl-horizontal
5
+ dt #
6
+ dd = @survey.position
7
+
8
+ dt = Helena::Survey.human_attribute_name :name
9
+ dd = @survey.name
10
+
11
+ dt = Helena::Survey.human_attribute_name :created_at
12
+ dd = distance_of_time_in_words_to_now(@survey.created_at)
13
+
14
+ dt = Helena::Survey.human_attribute_name :language
15
+ dd = @survey.language
16
+ .col-md-2
17
+ .pull-right
18
+ = link_to edit_survey_path(@survey), class: 'btn btn-default', role: 'button' do
19
+ i.fa.fa-pencil-square-o
20
+ = t('shared.actions.edit')
21
+
22
+ = link_to survey_path(@survey), class: 'btn btn-danger', method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
23
+ i.fa.fa-remove
24
+ = t('shared.actions.delete')
25
+
26
+
27
+ hr
28
+
29
+ h3 = Helena::Version.model_name.human(count: 2)
30
+
31
+ table.table.table-striped.versions
32
+ thead
33
+ tr
34
+ th.version width='5%' = Helena::Version.human_attribute_name(:version)
35
+ th.activity_state width='5%' = Helena::Version.human_attribute_name(:active)
36
+ th.notes = Helena::Version.human_attribute_name(:notes)
37
+ th.created_at width='10%' = Helena::Version.human_attribute_name(:created_at)
38
+ th width='20%'
39
+ = link_to new_survey_version_path(@survey), class: 'btn btn-default pull-right', role: 'button' do
40
+ i.fa.fa-plus-square-o
41
+ = t('shared.actions.new')
42
+ tbody
43
+ - @survey.versions.desc(:version).each do |version|
44
+ tr id="#{dom_id(version)}"
45
+ td.version = version.version
46
+ td.activity_state
47
+ - if version.active
48
+ span.label.label-success = t 'shared.active'
49
+ - else
50
+ span.label.label-default = t 'shared.inactive'
51
+ td.notes = version.notes
52
+ td.create_at = distance_of_time_in_words_to_now(version.created_at)
53
+ td.actions
54
+ .pull-right
55
+
56
+ = link_to [@survey, version], class: 'btn btn-default', role: 'button' do
57
+ i.fa.fa-angle-right
58
+ = t('shared.actions.view')
59
+ = link_to edit_survey_version_path(@survey, version), class: 'btn btn-default', role: 'button' do
60
+ i.fa.fa-pencil-square-o
61
+ = t('shared.actions.edit')
62
+ = link_to [@survey, version], class: "btn btn-danger #{'disabled' if version.active}", method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
63
+ i.fa.fa-remove
64
+ = t('shared.actions.delete')
65
+
66
+ - if @survey.versions.any?
67
+ hr
68
+ h3.pull-left = Helena::Session.model_name.human(count: 2)
69
+ = link_to survey_sessions_path(@survey, format: :csv), class: 'btn btn-default pull-right', role: 'button' do
70
+ i.fa.fa-download
71
+ = t('.export_sessions_as_csv')
72
+
73
+ = link_to survey_sessions_path(@survey, format: :json), class: 'btn btn-default pull-right', role: 'button' do
74
+ i.fa.fa-download
75
+ = t('.export_sessions_as_json')
76
+
77
+ table.table.table-striped.sessions
78
+ thead
79
+ tr
80
+ th.completed width='5%' = Helena::Session.human_attribute_name(:completed)
81
+ th.version width='5%' = Helena::Session.human_attribute_name(:version)
82
+ th.token = Helena::Session.human_attribute_name(:token)
83
+ th.view_token = Helena::Session.human_attribute_name(:view_token)
84
+ th.updated_at width='10%' = Helena::Session.human_attribute_name(:updated_at)
85
+ th.created_at width='10%' = Helena::Session.human_attribute_name(:created_at)
86
+ th width='20%'
87
+ = link_to new_survey_session_path(@survey), class: 'btn btn-default pull-right', role: 'button' do
88
+ i.fa.fa-plus-square-o
89
+ = t('shared.actions.new')
90
+ tfoot
91
+ tr
92
+ td colspan='7'
93
+ .pull-right
94
+ = paginate @sessions
95
+
96
+ tbody
97
+ - @sessions.each do |session|
98
+ tr id="#{dom_id(session)}"
99
+ td.completed
100
+ - if session.completed
101
+ span.label.label-success = t 'shared.completed'
102
+ - else
103
+ span.label.label-default = t 'shared.not_completed'
104
+
105
+ td.version = session.version.version
106
+ td.token = session.token
107
+ td.view_token = session.view_token
108
+ td.updated_at = distance_of_time_in_words_to_now(session.updated_at)
109
+ td.create_at = distance_of_time_in_words_to_now(session.created_at)
110
+ td.actions
111
+ .pull-right
112
+ = link_to helena.edit_session_path(session.token), class: 'btn btn-default', role: 'button' do
113
+ i.fa.fa-play
114
+ = t('shared.actions.run')
115
+ = link_to edit_survey_session_path(@survey, session), class: 'btn btn-default', role: 'button' do
116
+ i.fa.fa-pencil-square-o
117
+ = t('shared.actions.edit')
118
+ = link_to survey_session_path(@survey, session), class: 'btn btn-danger', method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
119
+ i.fa.fa-remove
120
+ = t('shared.actions.delete')
@@ -0,0 +1,14 @@
1
+ = simple_form_for [@survey, version] do | f |
2
+ = f.simple_fields_for :survey_detail do |detail|
3
+ = detail.input :title
4
+ = detail.input :description, as: :text, input_html: { cols: 60, rows: 10 }
5
+ = f.input :notes
6
+ = f.input :session_report, as: :text, hint: t('.slim_lang_hint_html'), input_html: { cols: 60, rows: 10, class: 'slim_lang' }
7
+ - if f.object.persisted?
8
+ = f.input :active, as: :boolean
9
+
10
+ = f.simple_fields_for :settings do |setting|
11
+ = setting.input :display_progressbar, as: :boolean,
12
+ label: t('.display_progressbar'),
13
+ input_html: { checked: (version.settings['display_progressbar'] == '1') }
14
+ = f.submit t('shared.save'), class: 'btn btn-success'
@@ -0,0 +1 @@
1
+ = render 'form', version: @version
@@ -0,0 +1 @@
1
+ = render 'form', version: @version
@@ -0,0 +1,68 @@
1
+ div id="#{dom_id(@version)}"
2
+ .row
3
+ .col-md-10
4
+ dl.dl-horizontal
5
+ - if @version.survey_detail
6
+ dt = Helena::SurveyDetail.human_attribute_name :title
7
+ dd = @version.survey_detail.title
8
+
9
+ dt = Helena::SurveyDetail.human_attribute_name :description
10
+ dd = @version.survey_detail.description
11
+
12
+ dt = Helena::Version.human_attribute_name :active
13
+ dd
14
+ - if @version.active
15
+ span.label.label-success = t 'shared.active'
16
+ - else
17
+ span.label.label-default = t 'shared.inactive'
18
+
19
+ dt = Helena::Version.human_attribute_name :version
20
+ dd = @version.version
21
+
22
+ dt = Helena::Version.human_attribute_name :notes
23
+ dd = @version.notes
24
+
25
+ dt = Helena::Version.human_attribute_name :created_at
26
+ dd = distance_of_time_in_words_to_now(@version.created_at)
27
+
28
+ dt = Helena::Version.human_attribute_name :session_report
29
+ dd = truncate_between strip_tags(sanitize @version.session_report), 100
30
+ .col-md-2
31
+ .pull-right
32
+ = link_to edit_survey_version_path(@survey, @version), class: 'btn btn-default', role: 'button' do
33
+ i.fa.fa-pencil-square-o
34
+ = t('shared.actions.edit')
35
+ = link_to [@survey, @version], class: "btn btn-danger #{'disabled' if @version.active}", method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
36
+ i.fa.fa-remove
37
+ = t('shared.actions.delete')
38
+ hr
39
+
40
+ h3 = Helena::QuestionGroup.model_name.human(count: 2)
41
+
42
+ table.table.table-striped.question_groups
43
+ thead
44
+ tr
45
+ th.position width='5%' = Helena::QuestionGroup.human_attribute_name(:position)
46
+ th.title = Helena::QuestionGroup.human_attribute_name(:title)
47
+ th.created_at width='10%' = Helena::QuestionGroup.human_attribute_name(:created_at)
48
+ th width='20%'
49
+ = link_to [:new, @survey, @version, :question_group], class: "btn btn-default pull-right #{'disabled' if @version.active}", role: 'button' do
50
+ i.fa.fa-plus-square-o
51
+ = t('shared.actions.new')
52
+ tbody
53
+ - @version.question_groups.asc(:position).each do |question_group|
54
+ tr id="#{dom_id(question_group)}"
55
+ td.position = question_group.position
56
+ td.title = question_group.title
57
+ td.create_at = distance_of_time_in_words_to_now(question_group.created_at)
58
+ td.actions
59
+ .pull-right
60
+ = link_to [@survey, @version, question_group], class: 'btn btn-default', role: 'button' do
61
+ i.fa.fa-angle-right
62
+ = t('shared.actions.view')
63
+ = link_to [:edit, @survey, @version, question_group], class: "btn btn-default #{'disabled' if @version.active}", role: 'button' do
64
+ i.fa.fa-pencil-square-o
65
+ = t('shared.actions.edit')
66
+ = link_to [@survey, @version, question_group], class: "btn btn-danger #{'disabled' if @version.active}", method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
67
+ i.fa.fa-remove
68
+ = t('shared.actions.delete')
@@ -0,0 +1,10 @@
1
+ doctype html
2
+ html
3
+ = render 'helena_administration/application/head'
4
+
5
+ body class=controller.controller_name
6
+ = render 'helena_administration/application/header'
7
+
8
+ .container-fluid
9
+ = render 'helena_administration/application/flash_messages'
10
+ = yield
data/bin/rails ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
+
4
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
+ ENGINE_PATH = File.expand_path('../../lib/helena_administration/engine', __FILE__)
6
+
7
+ # Set up gems listed in the Gemfile.
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
+
11
+ require 'rails/all'
12
+ require 'rails/engine/commands'
data/config/compass.rb ADDED
@@ -0,0 +1,2 @@
1
+ # Require any additional compass plugins here.
2
+ require 'compass/h5bp'
@@ -0,0 +1,26 @@
1
+ # This file stores config values that html5-rails uses
2
+ # to render various code blocks and features.
3
+ # (i.e. Google Analytics)
4
+ #
5
+ # Leaving a value blank will result in that code block
6
+ # or feature not rendering.
7
+ #
8
+ # You can also define any key/value pair in you ENV and
9
+ # it will take precidence over the yml value.
10
+ # e.g. ENV['google_account_id'] || yml[:google_account_id]
11
+
12
+ defaults: &defaults
13
+ :google_account_id: '' # Google Analytics
14
+ :google_api_key: '' # Google APIs
15
+
16
+ :development:
17
+ <<: *defaults
18
+
19
+ :test:
20
+ <<: *defaults
21
+
22
+ :staging:
23
+ <<: *defaults
24
+
25
+ :production:
26
+ <<: *defaults