helena_administration 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2f978075a80540cad53ad0d956138185dfdbd9b
4
- data.tar.gz: 1535a6e907aca1c901a96213365d357bd7d4f103
3
+ metadata.gz: 2b74145c74375cd00829d623d68697dbf6c0ebab
4
+ data.tar.gz: 8ec05a7f09803ea81518bf0af6731a59b3a04d9f
5
5
  SHA512:
6
- metadata.gz: a04f634738439df548e8a7c6b4614dd138af5117df81b11ea73cd1cfad52bf54a0931626c73a6b4d13607613ec0dcc07718c6194c7d8513016eb25802de932b3
7
- data.tar.gz: e7e249d0f518faa423853052ae0ff07885aa167fb1ecc1619e6a57300dfef9bcbffb678748f11340496c211147679f2e5eef2c622d12039b364de85dc10ded29
6
+ metadata.gz: bba953cb0957798a1fcf47bfbb4cac242e3b6765857ae495244d2a20af8f40c5608526065d926f4bbc0b833ab3bf70eb0574ec72d406abb27943dbaf3d204760
7
+ data.tar.gz: 14ce62e4a94287109c52edac8c0d47eecf0a938d68ad6883c2e6cedce396c2e6b07d124fa7e5f70fee435b775ccf7be621e8a8d8297a6651339b0130b8934130
data/.travis.yml CHANGED
@@ -5,3 +5,6 @@ rvm:
5
5
 
6
6
  services:
7
7
  - mongodb
8
+
9
+ cache: bundler
10
+ sudo: false
data/Gemfile CHANGED
@@ -13,8 +13,8 @@ gemspec
13
13
  # To use debugger
14
14
  # gem 'debugger'
15
15
 
16
- gem 'helena', '~> 1.0.0.rc2',
17
- git: 'https://github.com/gurix/helena.git'
16
+ gem 'helena', '~> 1.0.0.rc3'
17
+ # git: 'https://github.com/gurix/helena.git'
18
18
  # path: '../helena/'
19
19
 
20
20
  gem 'compass-h5bp', group: :assets
data/Gemfile.lock CHANGED
@@ -1,27 +1,7 @@
1
- GIT
2
- remote: https://github.com/gurix/helena.git
3
- revision: b62701e9e9ed81a0e927525edcbbca98916595fe
4
- specs:
5
- helena (1.0.0.rc2)
6
- bootstrap-sass (~> 3.2)
7
- breadcrumbs_on_rails (~> 2.3)
8
- browser (~> 0.8)
9
- haml-rails (~> 0.9)
10
- jquery-rails (~> 4.0)
11
- mongoid (~> 4.0)
12
- mongoid-simple-tags (~> 0.1)
13
- mongoid_orderable (~> 4.1)
14
- rails (~> 4.2)
15
- rails-i18n (~> 4.0)
16
- responders (~> 2.0)
17
- sass-rails (~> 5.0)
18
- simple_form (~> 3.1.0.rc2)
19
- slim (~> 3.0)
20
-
21
1
  PATH
22
2
  remote: .
23
3
  specs:
24
- helena_administration (0.0.5)
4
+ helena_administration (0.0.6)
25
5
  bootstrap-sass (~> 3.2)
26
6
  breadcrumbs_on_rails (~> 2.3)
27
7
  codemirror-rails (~> 5)
@@ -45,44 +25,44 @@ GEM
45
25
  remote: https://rubygems.org/
46
26
  specs:
47
27
  ZenTest (4.11.0)
48
- actionmailer (4.2.2)
49
- actionpack (= 4.2.2)
50
- actionview (= 4.2.2)
51
- activejob (= 4.2.2)
28
+ actionmailer (4.2.3)
29
+ actionpack (= 4.2.3)
30
+ actionview (= 4.2.3)
31
+ activejob (= 4.2.3)
52
32
  mail (~> 2.5, >= 2.5.4)
53
33
  rails-dom-testing (~> 1.0, >= 1.0.5)
54
- actionpack (4.2.2)
55
- actionview (= 4.2.2)
56
- activesupport (= 4.2.2)
34
+ actionpack (4.2.3)
35
+ actionview (= 4.2.3)
36
+ activesupport (= 4.2.3)
57
37
  rack (~> 1.6)
58
38
  rack-test (~> 0.6.2)
59
39
  rails-dom-testing (~> 1.0, >= 1.0.5)
60
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
61
- actionview (4.2.2)
62
- activesupport (= 4.2.2)
40
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
41
+ actionview (4.2.3)
42
+ activesupport (= 4.2.3)
63
43
  builder (~> 3.1)
64
44
  erubis (~> 2.7.0)
65
45
  rails-dom-testing (~> 1.0, >= 1.0.5)
66
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
67
- activejob (4.2.2)
68
- activesupport (= 4.2.2)
46
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
47
+ activejob (4.2.3)
48
+ activesupport (= 4.2.3)
69
49
  globalid (>= 0.3.0)
70
- activemodel (4.2.2)
71
- activesupport (= 4.2.2)
50
+ activemodel (4.2.3)
51
+ activesupport (= 4.2.3)
72
52
  builder (~> 3.1)
73
- activerecord (4.2.2)
74
- activemodel (= 4.2.2)
75
- activesupport (= 4.2.2)
53
+ activerecord (4.2.3)
54
+ activemodel (= 4.2.3)
55
+ activesupport (= 4.2.3)
76
56
  arel (~> 6.0)
77
- activesupport (4.2.2)
57
+ activesupport (4.2.3)
78
58
  i18n (~> 0.7)
79
59
  json (~> 1.7, >= 1.7.7)
80
60
  minitest (~> 5.1)
81
61
  thread_safe (~> 0.3, >= 0.3.4)
82
62
  tzinfo (~> 1.1)
83
63
  addressable (2.3.8)
84
- arel (6.0.0)
85
- autoprefixer-rails (5.2.1)
64
+ arel (6.0.2)
65
+ autoprefixer-rails (5.2.1.1)
86
66
  execjs
87
67
  json
88
68
  autotest (4.4.6)
@@ -97,14 +77,14 @@ GEM
97
77
  rack (>= 0.9.0)
98
78
  binding_of_caller (0.7.2)
99
79
  debug_inspector (>= 0.0.1)
100
- bootstrap-sass (3.3.5)
80
+ bootstrap-sass (3.3.5.1)
101
81
  autoprefixer-rails (>= 5.0.0.1)
102
- sass (>= 3.2.19)
82
+ sass (>= 3.3.0)
103
83
  breadcrumbs_on_rails (2.3.0)
104
84
  browser (0.8.0)
105
- bson (3.1.0)
85
+ bson (3.1.2)
106
86
  builder (3.2.2)
107
- byebug (4.0.5)
87
+ byebug (5.0.0)
108
88
  columnize (= 0.9.0)
109
89
  capybara (2.4.4)
110
90
  mime-types (>= 1.16)
@@ -169,6 +149,22 @@ GEM
169
149
  haml (>= 4.0.6, < 5.0)
170
150
  html2haml (>= 1.0.1)
171
151
  railties (>= 4.0.1)
152
+ helena (1.0.0.rc3)
153
+ bootstrap-sass (~> 3.2)
154
+ breadcrumbs_on_rails (~> 2.3)
155
+ browser (~> 0.8)
156
+ haml-rails (~> 0.9)
157
+ jquery-rails (~> 4.0)
158
+ mongoid (~> 4.0)
159
+ mongoid-simple-tags (~> 0.1)
160
+ mongoid-tree (~> 2.0)
161
+ mongoid_orderable (~> 4.1)
162
+ rails (~> 4.2)
163
+ rails-i18n (~> 4.0)
164
+ responders (~> 2.0)
165
+ sass-rails (~> 5.0)
166
+ simple_form (~> 3.1.0.rc2)
167
+ slim (~> 3.0)
172
168
  html2haml (2.0.0)
173
169
  erubis (~> 2.7.0)
174
170
  haml (~> 4.0.0)
@@ -209,6 +205,8 @@ GEM
209
205
  mongoid-simple-tags (0.1.3)
210
206
  json (~> 1.8)
211
207
  mongoid (>= 3.0.3)
208
+ mongoid-tree (2.0.0)
209
+ mongoid (>= 4.0, <= 5.0)
212
210
  mongoid_orderable (4.1.1)
213
211
  mongoid
214
212
  moped (2.0.6)
@@ -224,24 +222,24 @@ GEM
224
222
  coderay (~> 1.1.0)
225
223
  method_source (~> 0.8.1)
226
224
  slop (~> 3.4)
227
- pry-byebug (3.1.0)
228
- byebug (~> 4.0)
225
+ pry-byebug (3.2.0)
226
+ byebug (~> 5.0)
229
227
  pry (~> 0.10)
230
228
  quiet_assets (1.1.0)
231
229
  railties (>= 3.1, < 5.0)
232
230
  rack (1.6.4)
233
231
  rack-test (0.6.3)
234
232
  rack (>= 1.0)
235
- rails (4.2.2)
236
- actionmailer (= 4.2.2)
237
- actionpack (= 4.2.2)
238
- actionview (= 4.2.2)
239
- activejob (= 4.2.2)
240
- activemodel (= 4.2.2)
241
- activerecord (= 4.2.2)
242
- activesupport (= 4.2.2)
233
+ rails (4.2.3)
234
+ actionmailer (= 4.2.3)
235
+ actionpack (= 4.2.3)
236
+ actionview (= 4.2.3)
237
+ activejob (= 4.2.3)
238
+ activemodel (= 4.2.3)
239
+ activerecord (= 4.2.3)
240
+ activesupport (= 4.2.3)
243
241
  bundler (>= 1.3.0, < 2.0)
244
- railties (= 4.2.2)
242
+ railties (= 4.2.3)
245
243
  sprockets-rails
246
244
  rails-deprecated_sanitizer (1.0.3)
247
245
  activesupport (>= 4.2.0.alpha)
@@ -254,9 +252,9 @@ GEM
254
252
  rails-i18n (4.0.4)
255
253
  i18n (~> 0.6)
256
254
  railties (~> 4.0)
257
- railties (4.2.2)
258
- actionpack (= 4.2.2)
259
- activesupport (= 4.2.2)
255
+ railties (4.2.3)
256
+ actionpack (= 4.2.3)
257
+ activesupport (= 4.2.3)
260
258
  rake (>= 0.8.7)
261
259
  thor (>= 0.18.1, < 2.0)
262
260
  rake (10.4.2)
@@ -271,15 +269,15 @@ GEM
271
269
  rspec-mocks (~> 3.3.0)
272
270
  rspec-collection_matchers (1.1.2)
273
271
  rspec-expectations (>= 2.99.0.beta1)
274
- rspec-core (3.3.1)
272
+ rspec-core (3.3.2)
275
273
  rspec-support (~> 3.3.0)
276
- rspec-expectations (3.3.0)
274
+ rspec-expectations (3.3.1)
277
275
  diff-lcs (>= 1.2.0, < 2.0)
278
276
  rspec-support (~> 3.3.0)
279
- rspec-mocks (3.3.1)
277
+ rspec-mocks (3.3.2)
280
278
  diff-lcs (>= 1.2.0, < 2.0)
281
279
  rspec-support (~> 3.3.0)
282
- rspec-rails (3.3.2)
280
+ rspec-rails (3.3.3)
283
281
  actionpack (>= 3.0, < 4.3)
284
282
  activesupport (>= 3.0, < 4.3)
285
283
  railties (>= 3.0, < 4.3)
@@ -290,7 +288,7 @@ GEM
290
288
  rspec-support (3.3.0)
291
289
  ruby_parser (3.7.0)
292
290
  sexp_processor (~> 4.1)
293
- sass (3.4.14)
291
+ sass (3.4.16)
294
292
  sass-rails (5.0.3)
295
293
  railties (>= 4.0.0, < 5.0)
296
294
  sass (~> 3.1)
@@ -319,7 +317,7 @@ GEM
319
317
  spork (0.9.2)
320
318
  sprockets (3.2.0)
321
319
  rack (~> 1.0)
322
- sprockets-rails (2.3.1)
320
+ sprockets-rails (2.3.2)
323
321
  actionpack (>= 3.0)
324
322
  activesupport (>= 3.0)
325
323
  sprockets (>= 2.8, < 4.0)
@@ -350,7 +348,7 @@ DEPENDENCIES
350
348
  dotenv-rails
351
349
  factory_girl_rails
352
350
  faker
353
- helena (~> 1.0.0.rc2)!
351
+ helena (~> 1.0.0.rc3)
354
352
  helena_administration!
355
353
  launchy
356
354
  mongoid-rspec
@@ -10,14 +10,18 @@ module HelenaAdministration
10
10
  end
11
11
 
12
12
  def new
13
+ source_version = @survey.newest_version
13
14
  @version = @survey.versions.any? ? @survey.versions.build(source_version.attributes) : @survey.versions.build
15
+ @version.parent = source_version
14
16
  @version.survey_detail = (@version.try(:survey_detail) || Helena::SurveyDetail.new)
15
17
  @version.notes = ''
16
18
  add_breadcrumb t('.new'), new_survey_version_path(@survey)
17
19
  end
18
20
 
19
21
  def create
20
- build_version && @version.update_attributes(version_params)
22
+ @version = build_version
23
+ @version.update_attributes(version_params)
24
+
21
25
  if @version.save
22
26
  flash[:success] = t 'shared.actions.created'
23
27
  else
@@ -64,19 +68,16 @@ module HelenaAdministration
64
68
  end
65
69
 
66
70
  def version_params
67
- params.require(:version).permit(:notes, :session_report, :active, settings: [:display_progressbar], survey_detail_attributes: [:title, :description])
71
+ params.require(:version).permit(:parent, :notes, :session_report, :active,
72
+ settings: [:display_progressbar], survey_detail_attributes: [:title, :description])
68
73
  end
69
74
 
70
75
  def build_version
71
- if source_version
72
- @version = Helena::VersionPublisher.publish(source_version)
73
- else
74
- @version = @survey.versions.build
75
- end
76
- end
77
-
78
- def source_version
79
- @survey.newest_version
76
+ @version = if version_params[:parent].present?
77
+ Helena::VersionPublisher.publish(@survey.versions.find(version_params[:parent]))
78
+ else
79
+ @survey.versions.build version: (@survey.newest_version.version + 1)
80
+ end
80
81
  end
81
82
  end
82
83
  end
@@ -6,7 +6,8 @@
6
6
  = f.input :session_report, as: :text, hint: t('.slim_lang_hint_html'), input_html: { cols: 60, rows: 10, class: 'slim_lang' }
7
7
  - if f.object.persisted?
8
8
  = f.input :active, as: :boolean
9
-
9
+ - else
10
+ = f.input :parent, collection: f.object.ancestors_and_self, label_method: ->(v){ "#{v.survey.name} #{v.version} #{v.notes}" if v.present?}, include_blank: true, selected: -> (v) { v.parent }
10
11
  = f.simple_fields_for :settings do |setting|
11
12
  = setting.input :display_progressbar, as: :boolean,
12
13
  label: t('.display_progressbar'),
@@ -1,3 +1,3 @@
1
1
  module HelenaAdministration
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helena_administration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Graf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari