helena_administration 0.3.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +14 -9
- data/.travis.yml +13 -3
- data/Gemfile +1 -1
- data/Gemfile.lock +175 -174
- data/MIT-LICENSE +1 -1
- data/README.md +21 -18
- data/Rakefile +1 -1
- data/app/assets/javascripts/helena_administration.js.coffee +0 -1
- data/app/assets/stylesheets/_layout.sass +3 -14
- data/app/assets/stylesheets/_variables.sass +13 -13
- data/app/assets/stylesheets/helena_administration.css.sass +1 -3
- data/app/controllers/helena_administration/application_controller.rb +1 -0
- data/app/controllers/helena_administration/question_groups_controller.rb +17 -11
- data/app/controllers/helena_administration/versions_controller.rb +10 -6
- data/app/views/helena_administration/application/{_flash_messages.html.haml → _flash_messages.html.slim} +1 -1
- data/app/views/helena_administration/application/_header.html.slim +11 -15
- data/app/views/helena_administration/layouts/application.html.slim +1 -1
- data/app/views/helena_administration/question_groups/show.html.slim +18 -18
- data/app/views/helena_administration/questions/_sub_questions.html.slim +1 -1
- data/app/views/helena_administration/questions/show.html.slim +14 -14
- data/app/views/helena_administration/surveys/index.html.slim +5 -5
- data/app/views/helena_administration/surveys/show.html.slim +29 -29
- data/app/views/helena_administration/versions/show.html.slim +24 -24
- data/app/views/layouts/helena_administration/application.html.slim +1 -1
- data/config/locales/en.yml +11 -0
- data/helena_administration.gemspec +7 -8
- data/lib/helena_administration/engine.rb +6 -5
- data/lib/helena_administration/version.rb +1 -1
- data/lib/helena_administration.rb +2 -2
- data/spec/controllers/sessions_controller_spec.rb +4 -4
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/boot.rb +2 -2
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config.ru +1 -1
- data/spec/features/dashboard/index_spec.rb +1 -1
- data/spec/features/question_groups/manage_question_groups_spec.rb +1 -1
- data/spec/features/questions/manage_questions_spec.rb +2 -2
- data/spec/features/sessions/manage_sessions_spec.rb +1 -1
- data/spec/features/surveys/manage_survey_spec.rb +2 -2
- data/spec/features/versions/manage_version_spec.rb +33 -3
- data/spec/helpers/applicatin_helper_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/rails_compatibility.rb +1 -1
- metadata +35 -53
- data/app/assets/javascripts/polyfills.js +0 -10
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
@@ -17,18 +17,10 @@ body
|
|
17
17
|
svg
|
18
18
|
fill: $brand-primary
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
li:before
|
23
|
-
content: '»'
|
24
|
-
padding-right: 5px
|
25
|
-
|
20
|
+
#navbarSupportedContent
|
21
|
+
ol
|
26
22
|
li
|
27
|
-
|
28
|
-
|
29
|
-
a
|
30
|
-
padding: 0px
|
31
|
-
display: inline
|
23
|
+
@extend .breadcrumb-item
|
32
24
|
|
33
25
|
a.btn
|
34
26
|
margin: 3px
|
@@ -36,9 +28,6 @@ body
|
|
36
28
|
i.fa
|
37
29
|
padding-right: 1ex
|
38
30
|
|
39
|
-
&.disabled,
|
40
|
-
@include opacity(.2)
|
41
|
-
|
42
31
|
hr
|
43
32
|
border-color: #EEE
|
44
33
|
|
@@ -1,19 +1,19 @@
|
|
1
|
-
// color palette: http://www.colourlovers.com/palette/3477680/ANA
|
1
|
+
// // color palette: http://www.colourlovers.com/palette/3477680/ANA
|
2
2
|
$brand-primary: #00A0B0
|
3
3
|
$brand-danger: #BD1550
|
4
4
|
$brand-success: #00C176
|
5
5
|
$state-success-bg: #00C176
|
6
6
|
$state-success-text: #FFF
|
7
7
|
|
8
|
-
$line-height: 1.4
|
9
|
-
$font-color: #222
|
10
|
-
$font-family: sans-serif
|
11
|
-
$font-size: 1em
|
12
|
-
$link-color: $brand-primary
|
13
|
-
$link-hover-color: $brand-primary
|
14
|
-
$link-visited-color: $brand-primary
|
15
|
-
$selected-font-color: #fff
|
16
|
-
$selected-background-color: #ff5e99
|
17
|
-
$invalid-background-color: #f0dddd
|
18
|
-
$well-bg: #FFF
|
19
|
-
$navbar-default-bg: #FFF
|
8
|
+
// $line-height: 1.4
|
9
|
+
// $font-color: #222
|
10
|
+
// $font-family: sans-serif
|
11
|
+
// $font-size: 1em
|
12
|
+
// $link-color: $brand-primary
|
13
|
+
// $link-hover-color: $brand-primary
|
14
|
+
// $link-visited-color: $brand-primary
|
15
|
+
// $selected-font-color: #fff
|
16
|
+
// $selected-background-color: #ff5e99
|
17
|
+
// $invalid-background-color: #f0dddd
|
18
|
+
// $well-bg: #FFF
|
19
|
+
// $navbar-default-bg: #FFF
|
@@ -12,8 +12,6 @@
|
|
12
12
|
//-----------------------------------------
|
13
13
|
// Vendor imports
|
14
14
|
//-----------------------------------------
|
15
|
-
// @import 'compass/css3';
|
16
|
-
@import 'bootstrap-sprockets'
|
17
15
|
@import 'bootstrap'
|
18
16
|
@import 'font-awesome-sprockets'
|
19
17
|
@import 'font-awesome'
|
@@ -25,4 +23,4 @@
|
|
25
23
|
@import 'layout'
|
26
24
|
@import media_queries
|
27
25
|
@import 'dashboard'
|
28
|
-
@import 'codemirror'
|
26
|
+
@import 'codemirror.css'
|
@@ -16,11 +16,13 @@ module HelenaAdministration
|
|
16
16
|
|
17
17
|
def create
|
18
18
|
@question_group = @version.question_groups.build question_group_params
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
# Note: Not used at the moment, because there are no validations atm
|
20
|
+
# if @question_group.save
|
21
|
+
# flash[:success] = t 'shared.actions.created'
|
22
|
+
# else
|
23
|
+
# flash.now[:danger] = t 'shared.actions.error'
|
24
|
+
# end
|
25
|
+
flash[:success] = t 'shared.actions.created' if @question_group.save
|
24
26
|
respond_with @question_group, location: [@survey, @version, @question_group]
|
25
27
|
end
|
26
28
|
|
@@ -29,12 +31,16 @@ module HelenaAdministration
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def update
|
32
|
-
if @question_group.update_attributes(question_group_params)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
flash[:success] = t('shared.actions.updated') if @question_group.update_attributes(question_group_params)
|
35
|
+
|
36
|
+
# Note: Not used at the moment, because there are no validations atm
|
37
|
+
# if @question_group.update_attributes(question_group_params)
|
38
|
+
# flash[:success] = t 'shared.actions.updated'
|
39
|
+
# else
|
40
|
+
# flash.now[:danger] = t 'shared.actions.error'
|
41
|
+
# add_breadcrumb @question_group.title_was
|
42
|
+
# end
|
43
|
+
|
38
44
|
respond_with @question_group, location: [@survey, @version, @question_group]
|
39
45
|
end
|
40
46
|
|
@@ -35,12 +35,16 @@ module HelenaAdministration
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def update
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
@version.update_attributes version_params
|
39
|
+
|
40
|
+
# Note: Not used at the moment, because there are no validations atm
|
41
|
+
# if @version.update_attributes version_params
|
42
|
+
# flash[:success] = t 'shared.actions.updated'
|
43
|
+
# else
|
44
|
+
# flash.now[:danger] = t 'shared.actions.error'
|
45
|
+
# add_breadcrumb t 'helena_administration.versions.version', version: @version.version
|
46
|
+
# end
|
47
|
+
flash[:success] = t 'shared.actions.updated'
|
44
48
|
respond_with @version, location: [:edit, @survey, @version]
|
45
49
|
end
|
46
50
|
|
@@ -1,16 +1,12 @@
|
|
1
1
|
header#header
|
2
|
-
nav.navbar.navbar-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
= render_breadcrumbs tag: :li, separator: ''
|
14
|
-
ul.nav.navbar-nav.navbar-right
|
15
|
-
li
|
16
|
-
a href="https://github.com/gurix/helena-admin" target='_blank' About
|
2
|
+
nav.navbar.navbar-light.bg-light.navbar-expand-lg role="navigation"
|
3
|
+
= link_to 'Helena Admin', root_path, class: 'navbar-brand'
|
4
|
+
.button.navbar-toggler type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"
|
5
|
+
span.navbar-toggler-icon
|
6
|
+
|
7
|
+
#navbarSupportedContent.collapse.navbar-collapse
|
8
|
+
ol.navbar-nav.mr-auto.breadcrumbs
|
9
|
+
= render_breadcrumbs tag: :li, separator: '', class: 'breadcrumb-item'
|
10
|
+
ul.nav.navbar-nav.navbar-right
|
11
|
+
li
|
12
|
+
a href="https://github.com/gurix/helena-admin" target='_blank' About
|
@@ -1,27 +1,27 @@
|
|
1
1
|
div id="#{dom_id(@question_group)}"
|
2
2
|
.row
|
3
3
|
.col-md-10
|
4
|
-
dl.
|
5
|
-
dt = Helena::QuestionGroup.human_attribute_name :position
|
6
|
-
dd = @question_group.position
|
4
|
+
dl.row
|
5
|
+
dt.col-sm-2 = Helena::QuestionGroup.human_attribute_name :position
|
6
|
+
dd.col-sm-10 = @question_group.position
|
7
7
|
|
8
8
|
- if @question_group.allow_to_go_back
|
9
|
-
dt
|
10
|
-
dd = Helena::QuestionGroup.human_attribute_name(:allow_to_go_back)
|
9
|
+
dt.col-sm-2
|
10
|
+
dd.col-sm-10 = Helena::QuestionGroup.human_attribute_name(:allow_to_go_back)
|
11
11
|
|
12
|
-
dt = Helena::QuestionGroup.human_attribute_name :title
|
13
|
-
dd = @question_group.title
|
12
|
+
dt.col-sm-2 = Helena::QuestionGroup.human_attribute_name :title
|
13
|
+
dd.col-sm-10 = @question_group.title
|
14
14
|
|
15
|
-
dt = Helena::QuestionGroup.human_attribute_name :created_at
|
16
|
-
dd = distance_of_time_in_words_to_now(@question_group.created_at)
|
15
|
+
dt.col-sm-2 = Helena::QuestionGroup.human_attribute_name :created_at
|
16
|
+
dd.col-sm-10 = distance_of_time_in_words_to_now(@question_group.created_at)
|
17
17
|
|
18
18
|
.col-md-2
|
19
19
|
.pull-right
|
20
|
-
= link_to [:edit, @survey, @version, @question_group], class: "btn btn-
|
21
|
-
i.fa.fa-
|
20
|
+
= link_to [:edit, @survey, @version, @question_group], class: "btn btn-dark #{'disabled' if @version.active}", role: 'button' do
|
21
|
+
i.fa.fa-edit
|
22
22
|
= t('shared.actions.edit')
|
23
23
|
= 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
|
24
|
-
i.fa.fa-
|
24
|
+
i.fa.fa-trash
|
25
25
|
= t('shared.actions.delete')
|
26
26
|
|
27
27
|
hr
|
@@ -36,8 +36,8 @@ div id="#{dom_id(@question_group)}"
|
|
36
36
|
th.type width='10%' = Helena::Question.human_attribute_name(:type)
|
37
37
|
th.created_at width='10%' = Helena::Question.human_attribute_name(:created_at)
|
38
38
|
th width='20%'
|
39
|
-
= link_to [:new, @survey, @version, @question_group, :question], class: "btn btn-
|
40
|
-
i.fa.fa-plus-square
|
39
|
+
= link_to [:new, @survey, @version, @question_group, :question], class: "btn btn-dark pull-right #{'disabled' if @version.active}", role: 'button' do
|
40
|
+
i.fa.fa-plus-square
|
41
41
|
= t('shared.actions.new')
|
42
42
|
tbody
|
43
43
|
- @question_group.questions.asc(:position).each do |question|
|
@@ -49,12 +49,12 @@ div id="#{dom_id(@question_group)}"
|
|
49
49
|
td.create_at = distance_of_time_in_words_to_now(question.created_at)
|
50
50
|
td.actions
|
51
51
|
.pull-right
|
52
|
-
= link_to [@survey, @version, @question_group, question], class: 'btn btn-
|
52
|
+
= link_to [@survey, @version, @question_group, question], class: 'btn btn-link', role: 'button' do
|
53
53
|
i.fa.fa-angle-right
|
54
54
|
= t('shared.actions.view')
|
55
|
-
= link_to [:edit, @survey, @version, @question_group, question], class: "btn btn-
|
56
|
-
i.fa.fa-
|
55
|
+
= link_to [:edit, @survey, @version, @question_group, question], class: "btn btn-link #{'disabled' if @version.active}", role: 'button' do
|
56
|
+
i.fa.fa-edit
|
57
57
|
= t('shared.actions.edit')
|
58
58
|
= 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
|
59
|
-
i.fa.fa-
|
59
|
+
i.fa.fa-trash
|
60
60
|
= t('shared.actions.delete')
|
@@ -25,7 +25,7 @@ h3= t '.options'
|
|
25
25
|
= sub_question.input :text, label: false
|
26
26
|
- if @question.is_a?(Helena::Questions::CheckboxGroup)
|
27
27
|
td.value
|
28
|
-
= sub_question.input :value, label: false
|
28
|
+
= sub_question.input :value, label: false
|
29
29
|
td.delete
|
30
30
|
- unless sub_question.object.new_record?
|
31
31
|
= sub_question.input :_destroy, as: :boolean,
|
@@ -1,26 +1,26 @@
|
|
1
1
|
div id="#{dom_id(@question)}"
|
2
2
|
.row
|
3
3
|
.col-md-10
|
4
|
-
dl.
|
5
|
-
dt = Helena::Question.human_attribute_name :position
|
6
|
-
dd = @question.position
|
4
|
+
dl.row
|
5
|
+
dt.col-sm-2 = Helena::Question.human_attribute_name :position
|
6
|
+
dd.col-sm-10 = @question.position
|
7
7
|
|
8
|
-
dt = Helena::Question.human_attribute_name :code
|
9
|
-
dd = @question.code
|
8
|
+
dt.col-sm-2 = Helena::Question.human_attribute_name :code
|
9
|
+
dd.col-sm-10 = @question.code
|
10
10
|
|
11
|
-
dt = Helena::Question.human_attribute_name :question_text
|
12
|
-
dd = @question.question_text
|
11
|
+
dt.col-sm-2 = Helena::Question.human_attribute_name :question_text
|
12
|
+
dd.col-sm-10 = @question.question_text
|
13
13
|
|
14
|
-
dt = Helena::Question.human_attribute_name :type
|
15
|
-
dd = @question.class.model_name.human
|
14
|
+
dt.col-sm-2 = Helena::Question.human_attribute_name :type
|
15
|
+
dd.col-sm-10 = @question.class.model_name.human
|
16
16
|
|
17
|
-
dt = Helena::Question.human_attribute_name :created_at
|
18
|
-
dd = distance_of_time_in_words_to_now(@question.created_at)
|
17
|
+
dt.col-sm-2 = Helena::Question.human_attribute_name :created_at
|
18
|
+
dd.col-sm-10 = distance_of_time_in_words_to_now(@question.created_at)
|
19
19
|
.col-md-2
|
20
20
|
.pull-right
|
21
|
-
= link_to [:edit, @survey, @version, @question_group, @question], class: "btn btn-
|
22
|
-
i.fa.fa-
|
21
|
+
= link_to [:edit, @survey, @version, @question_group, @question], class: "btn btn-dark #{'disabled' if @version.active}", role: 'button' do
|
22
|
+
i.fa.fa-edit
|
23
23
|
= t('shared.actions.edit')
|
24
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-
|
25
|
+
i.fa.fa-trash
|
26
26
|
= t('shared.actions.delete')
|
@@ -6,10 +6,10 @@ table.table.table-striped
|
|
6
6
|
th.lanugage width='20%' = Helena::Survey.human_attribute_name(:language)
|
7
7
|
th.created_at width='10%' = Helena::Survey.human_attribute_name(:created_at)
|
8
8
|
th width='20%'
|
9
|
-
= link_to new_survey_path, class: 'btn btn-
|
10
|
-
i.fa.fa-plus-square
|
9
|
+
= link_to new_survey_path, class: 'btn btn-dark pull-right', role: 'button' do
|
10
|
+
i.fa.fa-plus-square
|
11
11
|
= t('shared.actions.new')
|
12
|
-
= link_to new_import_survey_path, class: 'btn btn-
|
12
|
+
= link_to new_import_survey_path, class: 'btn btn-dark pull-right', role: 'button' do
|
13
13
|
i.fa.fa-caret-square-o-up
|
14
14
|
= t('.import')
|
15
15
|
tbody
|
@@ -26,9 +26,9 @@ table.table.table-striped
|
|
26
26
|
= t('shared.actions.view')
|
27
27
|
|
28
28
|
= link_to edit_survey_path(survey), class: 'btn btn-default', role: 'button' do
|
29
|
-
i.fa.fa-
|
29
|
+
i.fa.fa-edit
|
30
30
|
= t('shared.actions.edit')
|
31
31
|
|
32
32
|
= link_to survey, class: 'btn btn-danger', method: :delete, data: { confirm: t('shared.actions.ask_for_deletion') } do
|
33
|
-
i.fa.fa-
|
33
|
+
i.fa.fa-trash
|
34
34
|
= t('shared.actions.delete')
|
@@ -1,26 +1,26 @@
|
|
1
1
|
div id="#{dom_id(@survey)}"
|
2
2
|
.row
|
3
3
|
.col-md-10
|
4
|
-
dl.
|
5
|
-
dt #
|
6
|
-
dd
|
4
|
+
dl.row
|
5
|
+
dt.col-sm-2 #
|
6
|
+
dd.col-sm-10 = @survey.position
|
7
7
|
|
8
|
-
dt
|
9
|
-
dd = @survey.name
|
8
|
+
dt.col-sm-2 = Helena::Survey.human_attribute_name :name
|
9
|
+
dd.col-sm-10 = @survey.name
|
10
10
|
|
11
|
-
dt
|
12
|
-
dd = distance_of_time_in_words_to_now(@survey.created_at)
|
11
|
+
dt.col-sm-2 = Helena::Survey.human_attribute_name :created_at
|
12
|
+
dd.col-sm-10 = distance_of_time_in_words_to_now(@survey.created_at)
|
13
13
|
|
14
|
-
dt
|
15
|
-
dd = @survey.language
|
14
|
+
dt.col-sm-2 = Helena::Survey.human_attribute_name :language
|
15
|
+
dd.col-sm-10 = @survey.language
|
16
16
|
.col-md-2
|
17
17
|
.pull-right
|
18
|
-
= link_to edit_survey_path(@survey), class: 'btn btn-
|
19
|
-
i.fa.fa-
|
18
|
+
= link_to edit_survey_path(@survey), class: 'btn btn-dark', role: 'button' do
|
19
|
+
i.fa.fa-edit
|
20
20
|
= t('shared.actions.edit')
|
21
21
|
|
22
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-
|
23
|
+
i.fa.fa-trash
|
24
24
|
= t('shared.actions.delete')
|
25
25
|
|
26
26
|
|
@@ -36,8 +36,8 @@ div id="#{dom_id(@survey)}"
|
|
36
36
|
th.notes = Helena::Version.human_attribute_name(:notes)
|
37
37
|
th.created_at width='10%' = Helena::Version.human_attribute_name(:created_at)
|
38
38
|
th width='20%'
|
39
|
-
= link_to new_survey_version_path(@survey), class: 'btn btn-
|
40
|
-
i.fa.fa-plus-square
|
39
|
+
= link_to new_survey_version_path(@survey), class: 'btn btn-dark pull-right', role: 'button' do
|
40
|
+
i.fa.fa-plus-square
|
41
41
|
= t('shared.actions.new')
|
42
42
|
tbody
|
43
43
|
- @survey.versions.desc(:version).each do |version|
|
@@ -45,32 +45,32 @@ div id="#{dom_id(@survey)}"
|
|
45
45
|
td.version = version.version
|
46
46
|
td.activity_state
|
47
47
|
- if version.active
|
48
|
-
span.
|
48
|
+
span.badge.badge-success = t 'shared.active'
|
49
49
|
- else
|
50
|
-
span.
|
50
|
+
span.badge.badge-dark = t 'shared.inactive'
|
51
51
|
td.notes = version.notes
|
52
52
|
td.create_at = distance_of_time_in_words_to_now(version.created_at)
|
53
53
|
td.actions
|
54
54
|
.pull-right
|
55
55
|
|
56
|
-
= link_to [@survey, version], class: 'btn btn-
|
56
|
+
= link_to [@survey, version], class: 'btn btn-link', role: 'button' do
|
57
57
|
i.fa.fa-angle-right
|
58
58
|
= t('shared.actions.view')
|
59
|
-
= link_to edit_survey_version_path(@survey, version), class: 'btn btn-
|
60
|
-
i.fa.fa-
|
59
|
+
= link_to edit_survey_version_path(@survey, version), class: 'btn btn-link', role: 'button' do
|
60
|
+
i.fa.fa-edit
|
61
61
|
= t('shared.actions.edit')
|
62
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-
|
63
|
+
i.fa.fa-trash
|
64
64
|
= t('shared.actions.delete')
|
65
65
|
|
66
66
|
- if @survey.versions.any?
|
67
67
|
hr
|
68
68
|
h3.pull-left = Helena::Session.model_name.human(count: 2)
|
69
|
-
= link_to survey_sessions_path(@survey, format: :csv), class: 'btn btn-
|
69
|
+
= link_to survey_sessions_path(@survey, format: :csv), class: 'btn btn-dark pull-right', role: 'button' do
|
70
70
|
i.fa.fa-download
|
71
71
|
= t('.export_sessions_as_csv')
|
72
72
|
|
73
|
-
= link_to survey_sessions_path(@survey, format: :json), class: 'btn btn-
|
73
|
+
= link_to survey_sessions_path(@survey, format: :json), class: 'btn btn-dark pull-right', role: 'button' do
|
74
74
|
i.fa.fa-download
|
75
75
|
= t('.export_sessions_as_json')
|
76
76
|
|
@@ -84,8 +84,8 @@ div id="#{dom_id(@survey)}"
|
|
84
84
|
th.updated_at width='10%' = Helena::Session.human_attribute_name(:updated_at)
|
85
85
|
th.created_at width='10%' = Helena::Session.human_attribute_name(:created_at)
|
86
86
|
th width='20%'
|
87
|
-
= link_to new_survey_session_path(@survey), class: 'btn btn-
|
88
|
-
i.fa.fa-plus-square
|
87
|
+
= link_to new_survey_session_path(@survey), class: 'btn btn-dark pull-right', role: 'button' do
|
88
|
+
i.fa.fa-plus-square
|
89
89
|
= t('shared.actions.new')
|
90
90
|
tfoot
|
91
91
|
tr
|
@@ -98,9 +98,9 @@ div id="#{dom_id(@survey)}"
|
|
98
98
|
tr id="#{dom_id(session)}"
|
99
99
|
td.completed
|
100
100
|
- if session.completed
|
101
|
-
span.
|
101
|
+
span.badge.badge-success = t 'shared.completed'
|
102
102
|
- else
|
103
|
-
span.
|
103
|
+
span.badge.badge-dark = t 'shared.not_completed'
|
104
104
|
|
105
105
|
td.version = session.version.version
|
106
106
|
td.token = session.token
|
@@ -109,12 +109,12 @@ div id="#{dom_id(@survey)}"
|
|
109
109
|
td.create_at = distance_of_time_in_words_to_now(session.created_at)
|
110
110
|
td.actions
|
111
111
|
.pull-right
|
112
|
-
= link_to helena.edit_session_path(session.token), class: 'btn btn-
|
112
|
+
= link_to helena.edit_session_path(session.token), class: 'btn btn-', role: 'button' do
|
113
113
|
i.fa.fa-play
|
114
114
|
= t('shared.actions.run')
|
115
115
|
= link_to edit_survey_session_path(@survey, session), class: 'btn btn-default', role: 'button' do
|
116
|
-
i.fa.fa-
|
116
|
+
i.fa.fa-edit
|
117
117
|
= t('shared.actions.edit')
|
118
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-
|
119
|
+
i.fa.fa-trash
|
120
120
|
= t('shared.actions.delete')
|
@@ -1,39 +1,39 @@
|
|
1
1
|
div id="#{dom_id(@version)}"
|
2
2
|
.row
|
3
3
|
.col-md-10
|
4
|
-
dl.
|
4
|
+
dl.row
|
5
5
|
- if @version.survey_detail
|
6
|
-
dt
|
7
|
-
dd = @version.survey_detail.title
|
6
|
+
dt.col-sm-2 = Helena::SurveyDetail.human_attribute_name :title
|
7
|
+
dd.col-sm-10 = @version.survey_detail.title
|
8
8
|
|
9
|
-
dt
|
10
|
-
dd = @version.survey_detail.description
|
9
|
+
dt.col-sm-2 = Helena::SurveyDetail.human_attribute_name :description
|
10
|
+
dd.col-sm-10 = @version.survey_detail.description
|
11
11
|
|
12
|
-
dt
|
13
|
-
dd
|
12
|
+
dt.col-sm-2 = Helena::Version.human_attribute_name :active
|
13
|
+
dd.col-sm-10
|
14
14
|
- if @version.active
|
15
15
|
span.label.label-success = t 'shared.active'
|
16
16
|
- else
|
17
17
|
span.label.label-default = t 'shared.inactive'
|
18
18
|
|
19
|
-
dt
|
20
|
-
dd = @version.version
|
19
|
+
dt.col-sm-2 = Helena::Version.human_attribute_name :version
|
20
|
+
dd.col-sm-10 = @version.version
|
21
21
|
|
22
|
-
dt
|
23
|
-
dd = @version.notes
|
22
|
+
dt.col-sm-2 = Helena::Version.human_attribute_name :notes
|
23
|
+
dd.col-sm-10 = @version.notes
|
24
24
|
|
25
|
-
dt
|
26
|
-
dd = distance_of_time_in_words_to_now(@version.created_at)
|
25
|
+
dt.col-sm-2 = Helena::Version.human_attribute_name :created_at
|
26
|
+
dd.col-sm-10 = distance_of_time_in_words_to_now(@version.created_at)
|
27
27
|
|
28
|
-
dt
|
29
|
-
dd = truncate_between strip_tags(sanitize @version.session_report), 100
|
28
|
+
dt.col-sm-2 = Helena::Version.human_attribute_name :session_report
|
29
|
+
dd.col-sm-10 = truncate_between strip_tags(sanitize @version.session_report), 100
|
30
30
|
.col-md-2
|
31
31
|
.pull-right
|
32
|
-
= link_to edit_survey_version_path(@survey, @version), class: 'btn btn-
|
33
|
-
i.fa.fa-
|
32
|
+
= link_to edit_survey_version_path(@survey, @version), class: 'btn btn-dark', role: 'button' do
|
33
|
+
i.fa.fa-edit
|
34
34
|
= t('shared.actions.edit')
|
35
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-
|
36
|
+
i.fa.fa-trash
|
37
37
|
= t('shared.actions.delete')
|
38
38
|
hr
|
39
39
|
|
@@ -46,8 +46,8 @@ div id="#{dom_id(@version)}"
|
|
46
46
|
th.title = Helena::QuestionGroup.human_attribute_name(:title)
|
47
47
|
th.created_at width='10%' = Helena::QuestionGroup.human_attribute_name(:created_at)
|
48
48
|
th width='20%'
|
49
|
-
= link_to [:new, @survey, @version, :question_group], class: "btn btn-
|
50
|
-
i.fa.fa-plus-square
|
49
|
+
= link_to [:new, @survey, @version, :question_group], class: "btn btn-dark pull-right #{'disabled' if @version.active}", role: 'button' do
|
50
|
+
i.fa.fa-plus-square
|
51
51
|
= t('shared.actions.new')
|
52
52
|
tbody
|
53
53
|
- @version.question_groups.asc(:position).each do |question_group|
|
@@ -57,12 +57,12 @@ div id="#{dom_id(@version)}"
|
|
57
57
|
td.create_at = distance_of_time_in_words_to_now(question_group.created_at)
|
58
58
|
td.actions
|
59
59
|
.pull-right
|
60
|
-
= link_to [@survey, @version, question_group], class: 'btn btn-
|
60
|
+
= link_to [@survey, @version, question_group], class: 'btn btn-link', role: 'button' do
|
61
61
|
i.fa.fa-angle-right
|
62
62
|
= t('shared.actions.view')
|
63
|
-
= link_to [:edit, @survey, @version, question_group], class: "btn btn-
|
64
|
-
i.fa.fa-
|
63
|
+
= link_to [:edit, @survey, @version, question_group], class: "btn btn-link #{'disabled' if @version.active}", role: 'button' do
|
64
|
+
i.fa.fa-edit
|
65
65
|
= t('shared.actions.edit')
|
66
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-
|
67
|
+
i.fa.fa-trash
|
68
68
|
= t('shared.actions.delete')
|
data/config/locales/en.yml
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
en:
|
2
2
|
shared:
|
3
|
+
delete_question: Are you sure?
|
4
|
+
delete: Delete
|
5
|
+
save: Save
|
6
|
+
edit: Edit
|
7
|
+
add: Add
|
8
|
+
show: Show
|
9
|
+
code_hint: The code should consist only of lowercase letters, numbers and underscores. Don't begin with a digit or an underscore and don't end with an underscore.
|
10
|
+
move_up: Move up
|
11
|
+
move_down: Move down
|
12
|
+
untitled: Untitled
|
13
|
+
|
3
14
|
navigation:
|
4
15
|
dashboard: Dashboard
|
5
16
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
$LOAD_PATH.push File.expand_path('
|
1
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
2
2
|
|
3
3
|
# Maintain your gem's version:
|
4
4
|
require 'helena_administration/version'
|
@@ -23,19 +23,18 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_runtime_dependency 'rails', '>= 4.2'
|
24
24
|
s.add_runtime_dependency 'slim-rails', '>= 3.0'
|
25
25
|
s.add_dependency 'haml-rails', '>= 0.5'
|
26
|
-
s.add_dependency 'helena', '~>
|
26
|
+
s.add_dependency 'helena', '~> 2.0'
|
27
|
+
s.add_dependency 'jquery-rails', '~> 4'
|
27
28
|
s.add_dependency 'mongoid', ['>= 4.0']
|
28
29
|
s.add_dependency 'mongoid-simple-tags', '~> 0.1'
|
29
|
-
s.add_dependency 'mongoid_orderable', '~>
|
30
|
-
s.add_runtime_dependency 'html5-rails', '~> 0.1'
|
31
|
-
s.add_dependency 'jquery-rails', '~> 4'
|
30
|
+
s.add_dependency 'mongoid_orderable', '~> 5.2'
|
32
31
|
s.add_runtime_dependency 'sass-rails', '~> 5.0'
|
33
|
-
s.add_dependency 'bootstrap-sass', '~> 3.2'
|
34
32
|
s.add_dependency 'breadcrumbs_on_rails', '>= 3.0.1'
|
35
33
|
s.add_dependency 'rails-i18n'
|
36
|
-
s.add_dependency 'simple_form', '~>
|
34
|
+
s.add_dependency 'simple_form', '~> 4'
|
37
35
|
s.add_runtime_dependency 'coffee-rails', '~> 4.1'
|
38
|
-
s.add_runtime_dependency 'font-awesome-sass'
|
36
|
+
s.add_runtime_dependency 'font-awesome-sass'
|
37
|
+
s.add_dependency 'bootstrap', '~> 4.1.3'
|
39
38
|
s.add_dependency 'responders', '~> 2.0'
|
40
39
|
|
41
40
|
s.add_development_dependency 'rspec-collection_matchers', '~> 1'
|
@@ -4,10 +4,11 @@ module HelenaAdministration
|
|
4
4
|
config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
|
5
5
|
config.assets.precompile += %w[helena_administration.js helena_administration.css]
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
7
|
+
# Thre are no decorators at the moment
|
8
|
+
# config.to_prepare do
|
9
|
+
# Dir.glob(Rails.root + 'app/decorators/**/*_decorator*.rb').each do |c|
|
10
|
+
# require_dependency c
|
11
|
+
# end
|
12
|
+
# end
|
12
13
|
end
|
13
14
|
end
|