decidim-admin 0.0.1.alpha5 → 0.0.1.alpha6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-admin might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bcb075ae6997dfee8724c29c8b31cde6d60df4a
4
- data.tar.gz: b2e92083902a331ae3c462850f43a1350c8883f5
3
+ metadata.gz: f9a07856bf0f1fe7fafa20f693fd0d7c877270dc
4
+ data.tar.gz: ca7b7bb0bf52a3612ad0da6380c8897365878674
5
5
  SHA512:
6
- metadata.gz: 11a6968f34ae49a3b20cbc2f14153599eb8d83d49c744f8004121e45922b6878a1f1894aaebfd67e91993c2d5c19d2cb6283ac7a40ec71712eaf3562a19f58b8
7
- data.tar.gz: 4efdcc626a300fa04c9009e12d3120b93733f0e43de3876f89a4643ab95c19092f7947748491d86e0b7f41b752c898897019b0f10417025194a562b0f10d8efd
6
+ metadata.gz: d0ee71032aeef185653aa314089fed92e66ab7bfd293204c8d08743abe96e3086f6e895e4332863649b0685902f02141bd14f328a94ce2693edaac34d40fbb60
7
+ data.tar.gz: ce218ae587b569a0217349f67cb9b520213d36a1c7897bdf8ea4ddc572064189ab372c8207b1c96c185e8d9981080d9727aa03e4bbf52af2f2fda12912090210
@@ -1,2 +1,3 @@
1
- //= link_directory ../javascripts/decidim/admin.js
2
- //= link_directory ../stylesheets/decidim/admin.css
1
+ //= link decidim/admin/application.js
2
+ //= link decidim/admin/application.css
3
+ //= link_directory ../images/decidim/admin/
@@ -0,0 +1,8 @@
1
+ @import 'https://fonts.googleapis.com/css?family=Montserrat:400,700';
2
+
3
+ @import "foundation_and_overrides";
4
+ @import "layout";
5
+ @import "login";
6
+ @import "sidebar";
7
+ @import "tables";
8
+ @import "actions";
@@ -39,6 +39,8 @@ module Decidim
39
39
  hashtag: form.hashtag,
40
40
  description: form.description,
41
41
  short_description: form.short_description,
42
+ hero_image: form.hero_image,
43
+ banner_image: form.banner_image,
42
44
  organization: @organization
43
45
  )
44
46
  end
@@ -40,6 +40,8 @@ module Decidim
40
40
  subtitle: form.subtitle,
41
41
  slug: form.slug,
42
42
  hashtag: form.hashtag,
43
+ hero_image: form.hero_image,
44
+ banner_image: form.banner_image,
43
45
  description: form.description,
44
46
  short_description: form.short_description
45
47
  }
@@ -63,9 +63,11 @@ module Decidim
63
63
  end
64
64
 
65
65
  def destroy
66
- @participatory_process = collection.find(params[:id]).destroy!
66
+ @participatory_process = collection.find(params[:id])
67
67
  authorize @participatory_process
68
68
 
69
+ @participatory_process.destroy!
70
+
69
71
  flash[:notice] = I18n.t("participatory_processes.destroy.success", scope: "decidim.admin")
70
72
 
71
73
  redirect_to participatory_processes_path
@@ -16,6 +16,8 @@ module Decidim
16
16
 
17
17
  attribute :slug, String
18
18
  attribute :hashtag, String
19
+ attribute :hero_image
20
+ attribute :banner_image
19
21
 
20
22
  validates :slug, presence: true
21
23
  translatable_validates :title, :subtitle, :description, :short_description, presence: true
@@ -33,8 +33,7 @@ module Decidim
33
33
  attrs.map do |attr|
34
34
  if record.column_for_attribute(attr).type == :hstore
35
35
  I18n.available_locales.map do |locale|
36
- content_tag(:dt, record.class.human_attribute_name(attr) + " (#{locale})") +
37
- display_value(record, attr, locale)
36
+ display_label(record, attr, locale) + display_value(record, attr, locale)
38
37
  end.reduce(:+)
39
38
  else
40
39
  display_label(record, attr) + display_value(record, attr)
@@ -42,13 +41,14 @@ module Decidim
42
41
  end.reduce(:+)
43
42
  end
44
43
 
45
- private
46
-
47
- # Private: Holds the logic to render a label for a given attribute.
48
- def display_label(record, attr)
49
- content_tag(:dt, record.class.human_attribute_name(attr))
44
+ # Holds the logic to render a label for a given attribute.
45
+ def display_label(record, attr, locale = nil)
46
+ return content_tag(:dt, record.class.human_attribute_name(attr)) unless locale
47
+ content_tag(:dt, record.class.human_attribute_name(attr) + " (#{locale})")
50
48
  end
51
49
 
50
+ private
51
+
52
52
  # Private: Holds the logic to render the attribute value.
53
53
  def display_value(record, attr, locale = nil)
54
54
  return I18n.with_locale(locale) do
@@ -21,3 +21,11 @@
21
21
  <div class="field">
22
22
  <%= form.translated :text_area, :description %>
23
23
  </div>
24
+
25
+ <div class="field">
26
+ <%= form.file_field :hero_image %>
27
+ </div>
28
+
29
+ <div class="field">
30
+ <%= form.file_field :banner_image %>
31
+ </div>
@@ -14,7 +14,12 @@
14
14
  :title,
15
15
  :subtitle,
16
16
  :hashtag,
17
+ :slug,
17
18
  :short_description,
18
19
  :description
19
20
  %>
21
+ <dt><%= display_label(@participatory_process, :hero_image) %></dt>
22
+ <dd><%= image_tag @participatory_process.hero_image.url.to_s %></dd>
23
+ <dt><%= display_label(@participatory_process, :banner_image) %></dt>
24
+ <dd><%= image_tag @participatory_process.banner_image.url.to_s %></dd>
20
25
  </dl>
@@ -1,4 +1,4 @@
1
1
  <meta name="viewport" content="width=device-width, initial-scale=1">
2
2
  <%= csrf_meta_tags %>
3
- <%= stylesheet_link_tag 'decidim/admin', media: 'all', 'data-turbolinks-track': 'reload' %>
4
- <%= javascript_include_tag 'decidim/admin', 'data-turbolinks-track': 'reload' %>
3
+ <%= stylesheet_link_tag 'decidim/admin/application', media: 'all', 'data-turbolinks-track': 'reload' %>
4
+ <%= javascript_include_tag 'decidim/admin/application', 'data-turbolinks-track': 'reload' %>
@@ -20,11 +20,8 @@ module Decidim
20
20
  class Engine < ::Rails::Engine
21
21
  isolate_namespace Decidim::Admin
22
22
 
23
- config.to_prepare do
24
- Rails.application.config.assets.precompile += %w(
25
- decidim/admin.js
26
- decidim/admin.css
27
- )
23
+ initializer "decidim_admin.assets" do |app|
24
+ app.config.assets.precompile += %w(decidim_admin_manifest.js)
28
25
  end
29
26
  end
30
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha5
4
+ version: 0.0.1.alpha6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.0.1.alpha5
21
+ version: 0.0.1.alpha6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.0.1.alpha5
28
+ version: 0.0.1.alpha6
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rails
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -208,20 +208,34 @@ dependencies:
208
208
  - - "~>"
209
209
  - !ruby/object:Gem::Version
210
210
  version: 1.1.0
211
+ - !ruby/object:Gem::Dependency
212
+ name: carrierwave
213
+ requirement: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - "~>"
216
+ - !ruby/object:Gem::Version
217
+ version: 1.0.0.beta
218
+ type: :runtime
219
+ prerelease: false
220
+ version_requirements: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - "~>"
223
+ - !ruby/object:Gem::Version
224
+ version: 1.0.0.beta
211
225
  - !ruby/object:Gem::Dependency
212
226
  name: decidim-dev
213
227
  requirement: !ruby/object:Gem::Requirement
214
228
  requirements:
215
229
  - - '='
216
230
  - !ruby/object:Gem::Version
217
- version: 0.0.1.alpha5
231
+ version: 0.0.1.alpha6
218
232
  type: :development
219
233
  prerelease: false
220
234
  version_requirements: !ruby/object:Gem::Requirement
221
235
  requirements:
222
236
  - - '='
223
237
  - !ruby/object:Gem::Version
224
- version: 0.0.1.alpha5
238
+ version: 0.0.1.alpha6
225
239
  - !ruby/object:Gem::Dependency
226
240
  name: pundit-matchers
227
241
  requirement: !ruby/object:Gem::Requirement
@@ -248,8 +262,7 @@ files:
248
262
  - README.md
249
263
  - Rakefile
250
264
  - app/assets/config/decidim_admin_manifest.js
251
- - app/assets/javascripts/decidim/admin.js
252
- - app/assets/stylesheets/decidim/admin.scss
265
+ - app/assets/javascripts/decidim/admin/application.js
253
266
  - app/assets/stylesheets/decidim/admin/_actions.scss
254
267
  - app/assets/stylesheets/decidim/admin/_foundation_and_overrides.scss
255
268
  - app/assets/stylesheets/decidim/admin/_layout.scss
@@ -257,6 +270,7 @@ files:
257
270
  - app/assets/stylesheets/decidim/admin/_settings.scss
258
271
  - app/assets/stylesheets/decidim/admin/_sidebar.scss
259
272
  - app/assets/stylesheets/decidim/admin/_tables.scss
273
+ - app/assets/stylesheets/decidim/admin/application.scss
260
274
  - app/commands/decidim/admin/create_participatory_process.rb
261
275
  - app/commands/decidim/admin/update_participatory_process.rb
262
276
  - app/constraints/decidim/admin/organization_dashboard_constraint.rb
@@ -1,8 +0,0 @@
1
- @import 'https://fonts.googleapis.com/css?family=Montserrat:400,700';
2
-
3
- @import "admin/foundation_and_overrides";
4
- @import "admin/layout";
5
- @import "admin/login";
6
- @import "admin/sidebar";
7
- @import "admin/tables";
8
- @import "admin/actions";