elabs 2.0.0.pre → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 838695848a9e3f533e2419d77e5097a05e267442099baacc40753526d54c1731
4
- data.tar.gz: c006a4f8a7e418d3f3969e74b787d6726fecdac085cea7edac0e35c8df375de5
3
+ metadata.gz: b290d73dc3d912c67d96bb1be6f003e3937379450feeb5d5fb10de85e8c2d152
4
+ data.tar.gz: 895e5179cadaf4ca0dc9cd616cfcae0df47955d0330cb803cd4d65d6cc3423c9
5
5
  SHA512:
6
- metadata.gz: 7021d019b2d4460ce463f72c026e82bf467a1e6c56e43be61f7fa9e212ce68bbfd12a24439200eb5fd8714f5f975375dad3c288f80cbd00878dcbb205dab94dc
7
- data.tar.gz: 2756d6742ed8d5da4d2506e552a48e51f6398b5db548933278a1dd6f163b238f82395de846cec3ff972aca9898bd504e1bb42971912b19cf57a0fc739741293a
6
+ metadata.gz: dfadce23c0741913e150116ae8388e78e2f39287604036231116163b29174e1510ebf40a62ae067a02012b3041528dfa5531aaf66cf06aa05ba2373d402165af
7
+ data.tar.gz: 971646fbaee841718146fd8161fc8429ef6fa40fac4b1659034232eee7a997ea0442e579db580e66ea39da38e3108dad35c2686af68a8a1012f1a8229b5edd26
@@ -1,6 +1,37 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [2.0.0] - 2018-09-08 - Rails engine
5
+ Everything seems to run fine, it's enough for a major version.
6
+
7
+ ### Added
8
+
9
+ - Added missing ability to set content as "hidden in history":
10
+ following updates and activity on an "hidden" element will not be
11
+ logged in activity table.
12
+
13
+ ## [2.0.0.pre] - 2018-09-07 - Rails engine
14
+ ### Added
15
+
16
+ - Generators to make views/assets override easy
17
+ - Generator to copy needed files and initializer
18
+ - Two controller concerns to easily extend your custom controllers:
19
+ - "ElabsController", used to load Elabs layout and some helpers
20
+ - "Reportable", to prepare an empty report when using elabs layout
21
+
22
+ ### Changed
23
+
24
+ - The app is now an engine.
25
+
26
+ ### Improved
27
+
28
+ - New documentation
29
+ - Various improvements:
30
+ - Acts strings for notices are now in the "acts" helper
31
+
32
+ ### Fixed
33
+ - Translations of acts notices are now fixed
34
+
4
35
  ## [1.0.0] - 2018-08-09 - First v1 \o/
5
36
  ### Added
6
37
 
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- elabs (2.0.0.pre)
12
+ elabs (2.0.0)
13
13
  rails (~> 5.2.1)
14
14
 
15
15
  GEM
data/ROADMAP.md CHANGED
@@ -6,24 +6,14 @@ See the [issues](https://gitlab.com/experimentslabs/website/website/issues) for
6
6
 
7
7
  ## [Next] - Already done
8
8
  ### Added
9
- - Generators to make views/assets override easy
10
- - Generator to copy needed files and initializer
11
- - Two controller concerns to easily extend your custom controllers:
12
- - "ElabsController", used to load Elabs layout and some helpers
13
- - "Reportable", to prepare an empty report when using elabs layout
14
9
 
15
10
  ### Changed
16
- - The app is now an engine.
17
11
 
18
12
  ### Improved
19
- - New documentation
20
- - Various improvements:
21
- - Acts strings for notices are now in the "acts" helper
22
13
 
23
14
  ### Removed
24
15
 
25
16
  ### Fixed
26
- - Translations of acts notices are now fixed
27
17
 
28
18
  ## Planned
29
19
 
@@ -0,0 +1,23 @@
1
+ module Elabs
2
+ module FormHelper
3
+ def album_selector(form)
4
+ form.select :album_ids, Elabs::Album.by_member(current_user).for_list, {}, multiple: true
5
+ end
6
+
7
+ def language_selector(form)
8
+ form.select :language_id, Elabs::Language.for_list
9
+ end
10
+
11
+ def license_selector(form)
12
+ form.select :license_id, Elabs::License.for_list
13
+ end
14
+
15
+ def project_selector(form)
16
+ form.select :project_ids, Elabs::Project.by_member(current_user).for_list, {}, multiple: true
17
+ end
18
+
19
+ def uploads_selector(form)
20
+ form.select :upload_ids, Elabs::Upload.by_member(current_user).for_list, {}, multiple: true
21
+ end
22
+ end
23
+ end
@@ -20,5 +20,7 @@ module Elabs
20
20
  has_many :projects, through: :projects_albums, dependent: :destroy
21
21
  has_many :uploads, through: :albums_uploads, dependent: :destroy
22
22
  has_many :comments, as: 'content'
23
+
24
+ scope :for_list, -> { order(:name).pluck(:name, :id) }
23
25
  end
24
26
  end
@@ -40,7 +40,7 @@ module Elabs
40
40
 
41
41
  def update_acts
42
42
  acts.destroy_all if %i[lock unpublish].include? @action
43
- Act.create content: self, event: @action unless @action == :nothing
43
+ Act.create content: self, event: @action unless @action == :nothing || hidden_in_history
44
44
  end
45
45
 
46
46
  # TODO: check if used ? (dependent: destroy may do the trick.)
@@ -13,5 +13,6 @@ module Elabs
13
13
 
14
14
  scope :with_content_only, -> { where.not(albums_count: 0).or(where.not(articles_count: 0)).or(where.not(notes_count: 0)).or(where.not(projects_count: 0)).or(where.not(uploads_count: 0)) }
15
15
  scope :available_site_translations, -> { select(:id, :name, :iso639_1).where(iso639_1: I18n.available_locales) }
16
+ scope :for_list, -> { order(:name).pluck(:name, :id) }
16
17
  end
17
18
  end
@@ -11,5 +11,7 @@ module Elabs
11
11
  has_many :notes
12
12
  has_many :projects
13
13
  has_many :uploads
14
+
15
+ scope :for_list, -> { order(:name).pluck(:name, :id) }
14
16
  end
15
17
  end
@@ -21,5 +21,7 @@ module Elabs
21
21
  has_many :notes, through: :projects_notes, dependent: :destroy
22
22
  has_many :uploads, through: :projects_uploads, dependent: :destroy
23
23
  has_many :comments, as: 'content'
24
+
25
+ scope :for_list, -> { order(:name).pluck(:name, :id) }
24
26
  end
25
27
  end
@@ -24,5 +24,7 @@ module Elabs
24
24
  has_many :comments, as: 'content'
25
25
 
26
26
  has_one_attached :file
27
+
28
+ scope :for_list, -> { order(:title).pluck(:title, :id) }
27
29
  end
28
30
  end
@@ -35,18 +35,16 @@
35
35
  = f.label :hidden_in_history
36
36
  .field
37
37
  = f.label :license
38
- .field-input= f.collection_select :license_id, Elabs::License.all, :id, :name
38
+ .field-input= license_selector f
39
39
  .field
40
40
  = f.label :language
41
- .field-input= f.collection_select :language_id, Elabs::Language.all, :id, :name
41
+ .field-input= language_selector f
42
42
  .field
43
43
  = f.label :uploads
44
- .field-input= f.collection_select :upload_ids,
45
- Elabs::Upload.by_member(current_user), :id, :title, {}, multiple: true
44
+ .field-input= uploads_selector f
46
45
  .field
47
46
  = f.label :projects
48
- .field-input= f.collection_select :project_ids,
49
- Elabs::Project.by_member(current_user), :id, :name, {}, multiple: true
47
+ .field-input= project_selector f
50
48
  .field
51
49
  = f.label :tags, for: :tags_list
52
50
  .field-input
@@ -42,14 +42,13 @@
42
42
  = f.label :hidden_in_history
43
43
  .field
44
44
  = f.label :license
45
- .field-input= f.collection_select :license_id, Elabs::License.all, :id, :name
45
+ .field-input= license_selector f
46
46
  .field
47
47
  = f.label :language
48
- .field-input= f.collection_select :language_id, Elabs::Language.all, :id, :name
48
+ .field-input= language_selector f
49
49
  .field
50
50
  = f.label :projects
51
- .field-input= f.collection_select :project_ids,
52
- Elabs::Project.by_member(current_user), :id, :name, {}, multiple: true
51
+ .field-input= project_selector f
53
52
  .field
54
53
  = f.label :tags, for: :tags_list
55
54
  .field-input
@@ -30,14 +30,13 @@
30
30
  = f.label :hidden_in_history
31
31
  .field
32
32
  = f.label :license
33
- .field-input= f.collection_select :license_id, Elabs::License.all, :id, :name
33
+ .field-input= license_selector f
34
34
  .field
35
35
  = f.label :language
36
- .field-input= f.collection_select :language_id, Elabs::Language.all, :id, :name
36
+ .field-input= language_selector f
37
37
  .field
38
38
  = f.label :projects
39
- .field-input= f.collection_select :project_ids,
40
- Elabs::Project.by_member(current_user), :id, :name, {}, multiple: true
39
+ .field-input= project_selector f
41
40
  .field
42
41
  = f.label :tags, for: :tags_list
43
42
  .field-input
@@ -46,10 +46,10 @@
46
46
  = f.label :hidden_in_history
47
47
  .field
48
48
  = f.label :license
49
- .field-input= f.collection_select :license_id, Elabs::License.all, :id, :name
49
+ .field-input= license_selector f
50
50
  .field
51
51
  = f.label :language
52
- .field-input= f.collection_select :language_id, Elabs::Language.all, :id, :name
52
+ .field-input= language_selector f
53
53
  .field
54
54
  = f.label :tags, for: :tags_list
55
55
  .field-input
@@ -34,10 +34,10 @@
34
34
  = f.label :hidden_in_history
35
35
  .field
36
36
  = f.label :license
37
- .field-input= f.collection_select :license_id, Elabs::License.all, :id, :name
37
+ .field-input= license_selector f
38
38
  .field
39
39
  = f.label :language
40
- .field-input= f.collection_select :language_id, Elabs::Language.all, :id, :name
40
+ .field-input= language_selector f
41
41
  .field
42
42
  = f.label :file
43
43
  .field-input
@@ -46,11 +46,10 @@
46
46
  formats: available_formats.join(', '))
47
47
  .field
48
48
  = f.label :albums
49
- .field-input= f.collection_select :album_ids, Elabs::Album.by_member(current_user), :id, :name, {}, multiple: true
49
+ .field-input= album_selector f
50
50
  .field
51
51
  = f.label :projects
52
- .field-input= f.collection_select :project_ids,
53
- Elabs::Project.by_member(current_user), :id, :name, {}, multiple: true
52
+ .field-input= project_selector f
54
53
  .field
55
54
  = f.label :tags, for: :tags_list
56
55
  .field-input
@@ -1,3 +1,3 @@
1
1
  module Elabs
2
- VERSION = '2.0.0.pre'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Tancoigne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-07 00:00:00.000000000 Z
11
+ date: 2018-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -152,6 +152,7 @@ files:
152
152
  - app/helpers/elabs/application_helper.rb
153
153
  - app/helpers/elabs/content_filters_helper.rb
154
154
  - app/helpers/elabs/content_renderer_helper.rb
155
+ - app/helpers/elabs/form_helper.rb
155
156
  - app/helpers/elabs/member_content_helper.rb
156
157
  - app/helpers/elabs/thumbnails_helper.rb
157
158
  - app/helpers/elabs/time_helper.rb
@@ -451,9 +452,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
451
452
  version: '0'
452
453
  required_rubygems_version: !ruby/object:Gem::Requirement
453
454
  requirements:
454
- - - ">"
455
+ - - ">="
455
456
  - !ruby/object:Gem::Version
456
- version: 1.3.1
457
+ version: '0'
457
458
  requirements: []
458
459
  rubyforge_project:
459
460
  rubygems_version: 2.7.6