decidim-theme 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +104 -0
  4. data/Rakefile +9 -0
  5. data/app/cells/decidim/meetings/meeting_cell.rb +65 -0
  6. data/app/cells/decidim/meetings/meeting_s_overrides/show.erb +25 -0
  7. data/app/cells/decidim/meetings/meeting_s_overrides_cell.rb +53 -0
  8. data/app/controllers/decidim/theme/admin/application_controller.rb +15 -0
  9. data/app/controllers/decidim/theme/application_controller.rb +13 -0
  10. data/app/helpers/decidim/theme/application_helper.rb +10 -0
  11. data/app/models/decidim/theme/application_record.rb +10 -0
  12. data/app/overrides/insert_javascript_tag.rb +6 -0
  13. data/app/overrides/language_chooser_icon.rb +4 -0
  14. data/app/overrides/layouts/decidim/_main_footer/replace_content.html.erb.deface +96 -0
  15. data/app/overrides/layouts/decidim/_mini_footer/replace_content.html.erb.deface +25 -0
  16. data/app/overrides/mailer_styles.rb +36 -0
  17. data/app/overrides/prefix_body.rb +10 -0
  18. data/app/overrides/prefix_classes.rb +63 -0
  19. data/app/overrides/prefix_processes_wrapper.rb +10 -0
  20. data/app/packs/entrypoints/decidim_theme_email.js +1 -0
  21. data/app/packs/entrypoints/decidim_theme_email.scss +2 -0
  22. data/app/packs/entrypoints/decidim_theme_polyfill.js +5 -0
  23. data/app/packs/fonts/decidim/Inter-Black.woff +0 -0
  24. data/app/packs/fonts/decidim/Inter-Black.woff2 +0 -0
  25. data/app/packs/fonts/decidim/Inter-BlackItalic.woff +0 -0
  26. data/app/packs/fonts/decidim/Inter-BlackItalic.woff2 +0 -0
  27. data/app/packs/fonts/decidim/Inter-Bold.woff +0 -0
  28. data/app/packs/fonts/decidim/Inter-Bold.woff2 +0 -0
  29. data/app/packs/fonts/decidim/Inter-BoldItalic.woff +0 -0
  30. data/app/packs/fonts/decidim/Inter-BoldItalic.woff2 +0 -0
  31. data/app/packs/fonts/decidim/Inter-ExtraBold.woff +0 -0
  32. data/app/packs/fonts/decidim/Inter-ExtraBold.woff2 +0 -0
  33. data/app/packs/fonts/decidim/Inter-ExtraBoldItalic.woff +0 -0
  34. data/app/packs/fonts/decidim/Inter-ExtraBoldItalic.woff2 +0 -0
  35. data/app/packs/fonts/decidim/Inter-ExtraLight.woff +0 -0
  36. data/app/packs/fonts/decidim/Inter-ExtraLight.woff2 +0 -0
  37. data/app/packs/fonts/decidim/Inter-ExtraLightItalic.woff +0 -0
  38. data/app/packs/fonts/decidim/Inter-ExtraLightItalic.woff2 +0 -0
  39. data/app/packs/fonts/decidim/Inter-Italic.woff +0 -0
  40. data/app/packs/fonts/decidim/Inter-Italic.woff2 +0 -0
  41. data/app/packs/fonts/decidim/Inter-Light.woff +0 -0
  42. data/app/packs/fonts/decidim/Inter-Light.woff2 +0 -0
  43. data/app/packs/fonts/decidim/Inter-LightItalic.woff +0 -0
  44. data/app/packs/fonts/decidim/Inter-LightItalic.woff2 +0 -0
  45. data/app/packs/fonts/decidim/Inter-Medium.woff +0 -0
  46. data/app/packs/fonts/decidim/Inter-Medium.woff2 +0 -0
  47. data/app/packs/fonts/decidim/Inter-MediumItalic.woff +0 -0
  48. data/app/packs/fonts/decidim/Inter-MediumItalic.woff2 +0 -0
  49. data/app/packs/fonts/decidim/Inter-Regular.woff +0 -0
  50. data/app/packs/fonts/decidim/Inter-Regular.woff2 +0 -0
  51. data/app/packs/fonts/decidim/Inter-SemiBold.woff +0 -0
  52. data/app/packs/fonts/decidim/Inter-SemiBold.woff2 +0 -0
  53. data/app/packs/fonts/decidim/Inter-SemiBoldItalic.woff +0 -0
  54. data/app/packs/fonts/decidim/Inter-SemiBoldItalic.woff2 +0 -0
  55. data/app/packs/fonts/decidim/Inter-Thin.woff +0 -0
  56. data/app/packs/fonts/decidim/Inter-Thin.woff2 +0 -0
  57. data/app/packs/fonts/decidim/Inter-ThinItalic.woff +0 -0
  58. data/app/packs/fonts/decidim/Inter-ThinItalic.woff2 +0 -0
  59. data/app/packs/fonts/decidim/Inter-italic.var.woff2 +0 -0
  60. data/app/packs/fonts/decidim/Inter-roman.var.woff2 +0 -0
  61. data/app/packs/fonts/decidim/Inter.var.woff2 +0 -0
  62. data/app/packs/images/decidim/cc-by-sa-4.svg +8 -0
  63. data/app/packs/images/decidim/decidim-initial.svg +9 -0
  64. data/app/packs/images/decidim/theme/icon.svg +1 -0
  65. data/app/packs/javascripts/empty.polyfill.js +7 -0
  66. data/app/packs/javascripts/has.polyfill.js +30 -0
  67. data/app/packs/stylesheets/decidim/theme/_font_face.scss +180 -0
  68. data/app/packs/stylesheets/decidim/theme/_theme.scss +121 -0
  69. data/app/packs/stylesheets/decidim/theme/_theme_settings.scss +923 -0
  70. data/app/packs/stylesheets/decidim/theme/_theme_variables.scss +80 -0
  71. data/app/packs/stylesheets/decidim/theme/atoms/Buttons/_Generic.scss +98 -0
  72. data/app/packs/stylesheets/decidim/theme/atoms/Buttons/_Misc.scss +115 -0
  73. data/app/packs/stylesheets/decidim/theme/atoms/Buttons/_Navigation.scss +83 -0
  74. data/app/packs/stylesheets/decidim/theme/atoms/Typography/_Body.scss +88 -0
  75. data/app/packs/stylesheets/decidim/theme/atoms/Typography/_Headline.scss +98 -0
  76. data/app/packs/stylesheets/decidim/theme/atoms/Typography/_mixins.scss +109 -0
  77. data/app/packs/stylesheets/decidim/theme/email.scss +41 -0
  78. data/app/packs/stylesheets/decidim/theme/molecules/Callouts/_default.scss +41 -0
  79. data/app/packs/stylesheets/decidim/theme/molecules/Cards/_card_process.scss +24 -0
  80. data/app/packs/stylesheets/decidim/theme/molecules/Cards/_data-item.scss +31 -0
  81. data/app/packs/stylesheets/decidim/theme/molecules/Cards/_documents.scss +46 -0
  82. data/app/packs/stylesheets/decidim/theme/molecules/Cards/_extra.scss +32 -0
  83. data/app/packs/stylesheets/decidim/theme/molecules/Cards/_upcoming_meetings.scss +47 -0
  84. data/app/packs/stylesheets/decidim/theme/organisms/_account.scss +129 -0
  85. data/app/packs/stylesheets/decidim/theme/organisms/_accountability.scss +119 -0
  86. data/app/packs/stylesheets/decidim/theme/organisms/_assembly.scss +5 -0
  87. data/app/packs/stylesheets/decidim/theme/organisms/_authorizations.scss +25 -0
  88. data/app/packs/stylesheets/decidim/theme/organisms/_blog.scss +77 -0
  89. data/app/packs/stylesheets/decidim/theme/organisms/_budgets.scss +221 -0
  90. data/app/packs/stylesheets/decidim/theme/organisms/_cookie_warning.scss +6 -0
  91. data/app/packs/stylesheets/decidim/theme/organisms/_debate.scss +65 -0
  92. data/app/packs/stylesheets/decidim/theme/organisms/_footer.scss +145 -0
  93. data/app/packs/stylesheets/decidim/theme/organisms/_groups.scss +49 -0
  94. data/app/packs/stylesheets/decidim/theme/organisms/_logins.scss +45 -0
  95. data/app/packs/stylesheets/decidim/theme/organisms/_meetings.scss +214 -0
  96. data/app/packs/stylesheets/decidim/theme/organisms/_members.scss +6 -0
  97. data/app/packs/stylesheets/decidim/theme/organisms/_messaging.scss +118 -0
  98. data/app/packs/stylesheets/decidim/theme/organisms/_metrics.scss +31 -0
  99. data/app/packs/stylesheets/decidim/theme/organisms/_notifications.scss +20 -0
  100. data/app/packs/stylesheets/decidim/theme/organisms/_processes.scss +12 -0
  101. data/app/packs/stylesheets/decidim/theme/organisms/_proposals.scss +150 -0
  102. data/app/packs/stylesheets/decidim/theme/organisms/_search.scss +12 -0
  103. data/app/packs/stylesheets/decidim/theme/organisms/_sortitions.scss +65 -0
  104. data/app/packs/stylesheets/decidim/theme/organisms/_surveys.scss +65 -0
  105. data/app/packs/stylesheets/decidim/theme/organisms/_text_page.scss +115 -0
  106. data/app/packs/stylesheets/decidim/theme/organisms/_user_conversations.scss +7 -0
  107. data/app/packs/stylesheets/decidim/theme/reset/_author.scss +36 -0
  108. data/app/packs/stylesheets/decidim/theme/reset/_author_avatar.scss +182 -0
  109. data/app/packs/stylesheets/decidim/theme/reset/_badges.scss +159 -0
  110. data/app/packs/stylesheets/decidim/theme/reset/_base.scss +543 -0
  111. data/app/packs/stylesheets/decidim/theme/reset/_budget-list.scss +202 -0
  112. data/app/packs/stylesheets/decidim/theme/reset/_budget-meter.scss +85 -0
  113. data/app/packs/stylesheets/decidim/theme/reset/_buttons.scss +538 -0
  114. data/app/packs/stylesheets/decidim/theme/reset/_callout.scss +37 -0
  115. data/app/packs/stylesheets/decidim/theme/reset/_card.scss +1480 -0
  116. data/app/packs/stylesheets/decidim/theme/reset/_categories.scss +130 -0
  117. data/app/packs/stylesheets/decidim/theme/reset/_collapsible.scss +59 -0
  118. data/app/packs/stylesheets/decidim/theme/reset/_columns.scss +8 -0
  119. data/app/packs/stylesheets/decidim/theme/reset/_comments.scss +320 -0
  120. data/app/packs/stylesheets/decidim/theme/reset/_conversation.scss +158 -0
  121. data/app/packs/stylesheets/decidim/theme/reset/_data-consent.scss +133 -0
  122. data/app/packs/stylesheets/decidim/theme/reset/_data-picker.scss +243 -0
  123. data/app/packs/stylesheets/decidim/theme/reset/_definition_data.scss +93 -0
  124. data/app/packs/stylesheets/decidim/theme/reset/_docs-manager.scss +16 -0
  125. data/app/packs/stylesheets/decidim/theme/reset/_dropdown_menu.scss +312 -0
  126. data/app/packs/stylesheets/decidim/theme/reset/_errors.scss +87 -0
  127. data/app/packs/stylesheets/decidim/theme/reset/_extra.scss +56 -0
  128. data/app/packs/stylesheets/decidim/theme/reset/_filters.scss +224 -0
  129. data/app/packs/stylesheets/decidim/theme/reset/_floating_helper.scss +133 -0
  130. data/app/packs/stylesheets/decidim/theme/reset/_form.scss +176 -0
  131. data/app/packs/stylesheets/decidim/theme/reset/_home.scss +416 -0
  132. data/app/packs/stylesheets/decidim/theme/reset/_home_section.scss +23 -0
  133. data/app/packs/stylesheets/decidim/theme/reset/_horizontal-tabs.scss +130 -0
  134. data/app/packs/stylesheets/decidim/theme/reset/_icons.scss +3 -0
  135. data/app/packs/stylesheets/decidim/theme/reset/_inline-filters.scss +77 -0
  136. data/app/packs/stylesheets/decidim/theme/reset/_label.scss +79 -0
  137. data/app/packs/stylesheets/decidim/theme/reset/_labels.scss +53 -0
  138. data/app/packs/stylesheets/decidim/theme/reset/_layout.scss +82 -0
  139. data/app/packs/stylesheets/decidim/theme/reset/_lines_breadcrumb.scss +38 -0
  140. data/app/packs/stylesheets/decidim/theme/reset/_login.scss +3 -0
  141. data/app/packs/stylesheets/decidim/theme/reset/_logo_wrapper.scss +28 -0
  142. data/app/packs/stylesheets/decidim/theme/reset/_main_container.scss +96 -0
  143. data/app/packs/stylesheets/decidim/theme/reset/_metric-chart.scss +25 -0
  144. data/app/packs/stylesheets/decidim/theme/reset/_navbar.scss +763 -0
  145. data/app/packs/stylesheets/decidim/theme/reset/_opinion_toggle.scss +55 -0
  146. data/app/packs/stylesheets/decidim/theme/reset/_order-by.scss +34 -0
  147. data/app/packs/stylesheets/decidim/theme/reset/_org-chart.scss +6 -0
  148. data/app/packs/stylesheets/decidim/theme/reset/_pagination.scss +195 -0
  149. data/app/packs/stylesheets/decidim/theme/reset/_process.scss +20 -0
  150. data/app/packs/stylesheets/decidim/theme/reset/_process_header.scss +97 -0
  151. data/app/packs/stylesheets/decidim/theme/reset/_process_header_phase.scss +13 -0
  152. data/app/packs/stylesheets/decidim/theme/reset/_process_nav.scss +317 -0
  153. data/app/packs/stylesheets/decidim/theme/reset/_progress_bar.scss +89 -0
  154. data/app/packs/stylesheets/decidim/theme/reset/_quill.scss +47 -0
  155. data/app/packs/stylesheets/decidim/theme/reset/_result_per_page.scss +82 -0
  156. data/app/packs/stylesheets/decidim/theme/reset/_results.scss +158 -0
  157. data/app/packs/stylesheets/decidim/theme/reset/_reveal.scss +210 -0
  158. data/app/packs/stylesheets/decidim/theme/reset/_scope-picker.scss +10 -0
  159. data/app/packs/stylesheets/decidim/theme/reset/_select.scss +92 -0
  160. data/app/packs/stylesheets/decidim/theme/reset/_signup.scss +179 -0
  161. data/app/packs/stylesheets/decidim/theme/reset/_statistics.scss +42 -0
  162. data/app/packs/stylesheets/decidim/theme/reset/_switch.scss +272 -0
  163. data/app/packs/stylesheets/decidim/theme/reset/_tabs.scss +4 -0
  164. data/app/packs/stylesheets/decidim/theme/reset/_tags.scss +47 -0
  165. data/app/packs/stylesheets/decidim/theme/reset/_thumbnail.scss +66 -0
  166. data/app/packs/stylesheets/decidim/theme/reset/_timeline.scss +183 -0
  167. data/app/packs/stylesheets/decidim/theme/reset/_title_bar.scss +89 -0
  168. data/app/packs/stylesheets/decidim/theme/reset/_toggle.scss +14 -0
  169. data/app/packs/stylesheets/decidim/theme/reset/_tooltip.scss +173 -0
  170. data/app/packs/stylesheets/decidim/theme/reset/_typography.scss +283 -0
  171. data/app/packs/stylesheets/decidim/theme/reset/_upload_modal.scss +140 -0
  172. data/app/packs/stylesheets/decidim/theme/reset/_user-form.scss +15 -0
  173. data/app/packs/stylesheets/decidim/theme/reset/_user.scss +184 -0
  174. data/app/packs/stylesheets/decidim/theme/reset/_versions.scss +82 -0
  175. data/app/packs/stylesheets/decidim/theme/reset/_wrapper.scss +3 -0
  176. data/config/assets.rb +17 -0
  177. data/config/i18n-tasks.yml +10 -0
  178. data/config/locales/en.yml +62 -0
  179. data/config/locales/fr.yml +11 -0
  180. data/lib/decidim/theme/admin.rb +10 -0
  181. data/lib/decidim/theme/admin_engine.rb +27 -0
  182. data/lib/decidim/theme/engine.rb +29 -0
  183. data/lib/decidim/theme/test/factories.rb +13 -0
  184. data/lib/decidim/theme/version.rb +13 -0
  185. data/lib/decidim/theme.rb +12 -0
  186. metadata +271 -0
data/README.md ADDED
@@ -0,0 +1,104 @@
1
+ ```
2
+ This file is a template for README.md of Octree instances.
3
+ ```
4
+
5
+ <h1 align="center"><img src="https://github.com/octree-gva/meta/blob/main/decidim/static/header.png?raw=true" alt="Decidim - Octree Participatory democracy on a robust and open source solution"></h1>
6
+ <h4 align="center">
7
+ <a href="https://www.octree.ch">Octree</a> |
8
+ <a href="https://octree.ch/en/contact-us/">Contact Us</a> |
9
+ <a href="https://blog.octree.ch">Our Blog (FR)</a><br/><br/>
10
+ <a href="https://decidim.org">Decidim</a> |
11
+ <a href="https://docs.decidim.org/en/">Decidim Docs</a> |
12
+ <a href="https://meta.decidim.org">Participatory Governance (meta decidim)</a><br/><br/>
13
+ <a href="https://matrix.to/#/+decidim:matrix.org">Decidim Community (Matrix+Element.io)</a>
14
+ </h4>
15
+
16
+
17
+ <br/><br/>
18
+ Want to hack Decidim theme? This repo implements a resilient design system on Decidim, allowing you to bootstrap your new theme.
19
+ This repository is a __Decidim module__ for Decidim without redesign.
20
+
21
+ This module is installed by default on all our [voca instances](https://voca.city).
22
+
23
+ ## Installation
24
+
25
+ Add to your Gemfile:
26
+ ```
27
+ gem "deface", ">= 1.5"
28
+ gem "decidim-theme", git: "https://github.com/decidim/decidim-module-theme"
29
+ ```
30
+
31
+ Import the theme settings:
32
+ ```
33
+ // file: app/packs/stylesheets/decidim/_decidim-settings.scss
34
+ @import "stylesheets/decidim/theme/theme_settings"
35
+ ```
36
+
37
+ Add the theme file to override the rest:
38
+ ```
39
+ // file: app/packs/stylesheets/decidim/decidim_application.scss
40
+ @import "stylesheets/decidim/theme/theme"
41
+ ```
42
+
43
+ Add preload tags on `head` for fonts, to have less FOUT:
44
+ ```
45
+ <!-- file: app/views/layouts/decidim/_head_extra.html.erb -->
46
+ <%= preload_link_tag(asset_pack_path("media/images/Inter-Bold.woff2")) %>
47
+ <%= preload_link_tag(asset_pack_path("media/images/Inter-Regular.woff2")) %>
48
+ <%= preload_link_tag(asset_pack_path("media/images/Inter-SemiBold.woff2")) %>
49
+ ```
50
+
51
+
52
+
53
+ # Compatibility
54
+
55
+ This module is tested with Decidim V.0.26 only.
56
+ 0.27 is comming with ruby-3 support soon.
57
+
58
+ # Develop localy
59
+
60
+ ```
61
+ docker-compose up -d
62
+ ```
63
+
64
+ ```
65
+ # Install (first time only)
66
+ docker exec -it decidim-app bundle exec rails db:migrate
67
+ docker exec -it decidim-app bundle exec rails db:seed
68
+ ```
69
+
70
+
71
+ ```
72
+ # Run webpack-dev-server
73
+ docker exec -it decidim-app bin/webpack-dev-server
74
+ ```
75
+
76
+ ```
77
+ # Run rails server
78
+ docker exec -it decidim-app bundle exec rails s -b 0.0.0.0
79
+ ```
80
+
81
+ Wait webpack-dev-server has compiled, and go to [localhost:3000](http://localhost:3000).
82
+
83
+
84
+ # Core Customizations
85
+
86
+ In a perfect world, we would need no core customization. We try hard to keep track on our changes and propose them to the core of Decidim. Our goal is always to come back to a mainstream code. We use the Deface gem to mainly:
87
+
88
+ - Change button classes to have consistent buttons variants.
89
+ - Add class to `wrapper` in [many, many files](./app/overrides/prefix_classes.rb)
90
+
91
+
92
+
93
+
94
+ <br /><br />
95
+ <h4 align="center">
96
+ <br /><br />
97
+ <img src="https://github.com/octree-gva/meta/blob/main/decidim/static/[PROJECT_NAME]/[MOBILE_SCREENSHOTS].png?raw=true" /><br /><br />
98
+ <img src="https://github.com/octree-gva/meta/blob/main/decidim/static/[PROJECT_NAME]/[MOBILE_SCREENSHOTS].png?raw=true" /><br /><br />
99
+ </h4>
100
+
101
+ <br /><br />
102
+ <p align="center">
103
+ <img src="https://raw.githubusercontent.com/octree-gva/meta/main/decidim/static/octree_and_decidim.png" height="90" alt="Decidim Installation by Octree" />
104
+ </p>
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/dev/common_rake"
4
+
5
+ desc "Generates a dummy app for testing"
6
+ task test_app: "decidim:generate_external_test_app"
7
+
8
+ desc "Generates a development app."
9
+ task development_app: "decidim:generate_external_development_app"
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ # This cell renders the meeting card for an instance of a Meeting
6
+ # the default size is the Medium Card (:m)
7
+ # also available the List Item Card (:list_item)
8
+ class MeetingCell < Decidim::ViewModel
9
+ include Decidim::SanitizeHelper
10
+ include MeetingCellsHelper
11
+ include Cell::ViewModel::Partial
12
+
13
+ def show
14
+ cell card_size, model, options
15
+ end
16
+
17
+ private
18
+
19
+ def card_size
20
+ case @options[:size]
21
+ when :highlighted_list_item
22
+ "decidim/meetings/meeting_highlighted_list_item"
23
+ when :list_item
24
+ "decidim/meetings/meeting_list_item"
25
+ when :s
26
+ "decidim/meetings/meeting_s_overrides"
27
+ else
28
+ "decidim/meetings/meeting_m"
29
+ end
30
+ end
31
+
32
+ def resource_icon
33
+ icon "meetings", remove_icon_class: true, width: 40, height: 70
34
+ end
35
+
36
+ def current_component
37
+ model.component
38
+ end
39
+
40
+ def current_participatory_space
41
+ model.component.participatory_space
42
+ end
43
+
44
+ def component_settings
45
+ model.component.settings
46
+ end
47
+
48
+ def component_name
49
+ translated_attribute current_component.name
50
+ end
51
+
52
+ def component_type_name
53
+ model.class.model_name.human
54
+ end
55
+
56
+ def participatory_space_name
57
+ translated_attribute current_participatory_space.title
58
+ end
59
+
60
+ def participatory_space_type_name
61
+ translated_attribute current_participatory_space.model_name.human
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,25 @@
1
+ <div class="card overrides">
2
+ <div class="p-s">
3
+ <div class="card__header">
4
+ <%= link_to meeting_path, class: "card__link" do %>
5
+ <span class="card__title">
6
+ <%= title %>
7
+ </span>
8
+ <% end %>
9
+ </div>
10
+ <div class="card__text">
11
+ <div class="row collapse text-medium">
12
+ <time datetime="<%= l(model.start_time, format: :long) %>" class="column medium-4 icon--container upcoming_meetings--time">
13
+ <%= l start_date, format: :decidim_with_month_name %>
14
+ &nbsp;-&nbsp;
15
+ <%= formatted_start_time %>
16
+ </time>
17
+ <span class="column medium-8">
18
+ <%= participatory_space_class_name %>
19
+ &nbsp;
20
+ <%= link_to participatory_space_title, participatory_space_path %>
21
+ </span>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ # This cell renders the Small (:s) meeting card
6
+ # for an given instance of a Meeting
7
+ class MeetingSOverridesCell < MeetingMCell
8
+ delegate :title, to: :presenter
9
+
10
+ def meeting_path
11
+ resource_locator(model).path
12
+ end
13
+
14
+ def participatory_space_class_name
15
+ model.component.participatory_space.class.model_name.human
16
+ end
17
+
18
+ def participatory_space_title
19
+ translated_attribute model.component.participatory_space.title
20
+ end
21
+
22
+ def participatory_space_path
23
+ resource_locator(model.component.participatory_space).path
24
+ end
25
+
26
+ def presenter
27
+ @presenter ||= Decidim::Meetings::MeetingPresenter.new(model)
28
+ end
29
+
30
+ private
31
+
32
+ def cache_hash
33
+ hash = []
34
+ hash << I18n.locale.to_s
35
+ hash << model.cache_key_with_version
36
+ hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
37
+ hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
38
+ hash << model.comments_count
39
+ hash << model.follows_count
40
+ hash << render_space? ? 1 : 0
41
+
42
+ if current_user
43
+ hash << current_user.cache_key_with_version
44
+ hash << current_user.follows?(model) ? 1 : 0
45
+ end
46
+ hash << Digest::MD5.hexdigest(model.author.cache_key_with_version)
47
+ hash << (model.must_render_translation?(current_organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
48
+
49
+ hash.join(Decidim.cache_key_separator)
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Theme
5
+ module Admin
6
+ # This controller is the abstract class from which all other controllers of
7
+ # this engine inherit.
8
+ #
9
+ # Note that it inherits from `Decidim::Admin::Components::BaseController`, which
10
+ # override its layout and provide all kinds of useful methods.
11
+ class ApplicationController < Decidim::Admin::Components::BaseController
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Theme
5
+ # This controller is the abstract class from which all other controllers of
6
+ # this engine inherit.
7
+ #
8
+ # Note that it inherits from `Decidim::Components::BaseController`, which
9
+ # override its layout and provide all kinds of useful methods.
10
+ class ApplicationController < Decidim::Components::BaseController
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Theme
5
+ # Custom helpers, scoped to the theme engine.
6
+ #
7
+ module ApplicationHelper
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Theme
5
+ # Abstract class from which all models in this engine inherit.
6
+ class ApplicationRecord < ActiveRecord::Base
7
+ self.abstract_class = true
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ Deface::Override.new(
2
+ :virtual_path => "layouts/decidim/_application",
3
+ :name => "insert_javascript_tag",
4
+ :insert_after => 'erb[loud]:contains("data_consent_warning")',
5
+ :text => "<%= javascript_pack_tag \"decidim_theme_polyfill\", defer: false %>"
6
+ )
@@ -0,0 +1,4 @@
1
+ Deface::Override.new(:virtual_path => "layouts/decidim/_language_chooser",
2
+ :name => "language_chooser_icon",
3
+ :surround => "span[aria-hidden=true]",
4
+ :text => "<span class=\"language-chooser-controltext\"><%= icon \"globe\", aria_label: t(\"name\", scope: \"locale\") %> %><%= render_original %></div>")
@@ -0,0 +1,96 @@
1
+ <!-- replace '.main-footer' -->
2
+ <footer id="FooterNavigation">
3
+ <div id="ActivitiesLink" aria-describedBy="ActivitiesLinkLabel" class="footer_nav footer_nav--more">
4
+ <strong id="ActivitiesLinkLabel"><%= t(".sections.activities") %></strong>
5
+
6
+ <%= ::Decidim::MenuPresenter.new(
7
+ :menu,
8
+ self,
9
+ element_class: "footer__navitem",
10
+ active_class: "footer__navitem--active",
11
+ label: t("layouts.decidim.header.main_menu")
12
+ ).render do |menu|
13
+ "heçllo"
14
+ end %>
15
+ </div>
16
+ <nav id="MoreLinks" aria-describedBy="MoreLinksLabel" class="footer_nav footer_nav--more">
17
+ <strong id="MoreLinksLabel"><%= t(".sections.more") %></strong>
18
+ <ul>
19
+ <% if current_user %>
20
+ <% if allowed_to? :read, :admin_dashboard %>
21
+ <li class="footer__navitem"><%= link_to t(".admin_dashboard"), decidim_admin.root_path %></li>
22
+ <% end %>
23
+ <% else %>
24
+ <li class="footer__navitem"><%= link_to t("layouts.decidim.header.sign_in"), decidim.new_user_session_path %></li>
25
+ <% if current_organization.sign_up_enabled? %>
26
+ <li class="footer__navitem"><%= link_to t("layouts.decidim.header.sign_up"), decidim.new_user_registration_path %></li>
27
+ <% end %>
28
+ <% end %>
29
+
30
+ <% organization_pages = current_organization.static_pages_accessible_for(current_user) %>
31
+ <% if organization_pages.any? %>
32
+ <% current_organization.static_page_topics.where(show_in_footer: true).each do |page_topic| %>
33
+ <% topic_pages = page_topic.accessible_pages_for(current_user) %>
34
+ <% if topic_pages.any? %>
35
+ <li class="footer__navitem"><%= link_to translated_attribute(page_topic.title), decidim.page_path(topic_pages.first) %></li>
36
+ <% end %>
37
+ <% end %>
38
+
39
+ <% organization_pages.where(show_in_footer: true).each do |page| %>
40
+ <li class="footer__navitem"><%= link_to translated_attribute(page.title), decidim.page_path(page) %></li>
41
+ <% end %>
42
+ <% end %>
43
+
44
+ <li class="footer__navitem"><%= link_to t("layouts.decidim.footer.download_open_data"), decidim.open_data_download_path %></li>
45
+
46
+ <% if current_user %>
47
+ <li class="footer__navitem"><%= link_to t(".sign_out"), decidim.destroy_user_session_path, method: :delete, class: "sign-out-link", role: "menuitem" %></li>
48
+ <% end %>
49
+ </ul>
50
+ </nav>
51
+ <nav id="SocialLinks" aria-describedBy="SocialLinksLabel" class="footer_nav footer_nav--social">
52
+ <% if current_organization.twitter_handler.present? || current_organization.facebook_handler.present? || current_organization.instagram_handler.present? || current_organization.youtube_handler.present? %>
53
+ <strong id="SocialLinksLabel"><%= t(".sections.social") %></strong>
54
+ <% end %>
55
+ <ul>
56
+ <% if current_organization.twitter_handler.present? %>
57
+ <li class="footer__navitem">
58
+ <a class="footer-social__icon" target="_blank" rel="noopener" href="https://twitter.com/<%= current_organization.twitter_handler %>">
59
+ <%= t("layouts.decidim.social_media_links.twitter", organization: translated_attribute(current_organization.name)) %>
60
+ </a>
61
+ </li>
62
+ <% end %>
63
+ <% if current_organization.facebook_handler.present? %>
64
+ <li class="footer__navitem">
65
+ <a class="footer-social__icon" target="_blank" rel="noopener" href="https://www.facebook.com/<%= current_organization.facebook_handler %>">
66
+ <%= t("layouts.decidim.social_media_links.facebook", organization: translated_attribute(current_organization.name)) %>
67
+ </a>
68
+ </li>
69
+ <% end %>
70
+ <% if current_organization.instagram_handler.present? %>
71
+ <li class="footer__navitem">
72
+ <a target="_blank" rel="noopener" href="https://www.instagram.com/<%= current_organization.instagram_handler %>">
73
+ <%= t("layouts.decidim.social_media_links.instagram", organization: translated_attribute(current_organization.name)) %>
74
+ </a>
75
+ </li>
76
+ <% end %>
77
+ <% if current_organization.youtube_handler.present? %>
78
+ <li class="footer__navitem">
79
+ <a target="_blank" rel="noopener" href="https://www.youtube.com/<%= current_organization.youtube_handler %>">
80
+ <%= t("layouts.decidim.social_media_links.youtube", organization: translated_attribute(current_organization.name)) %>
81
+ </a>
82
+ </li>
83
+ <% end %>
84
+ <% if current_organization.github_handler.present? %>
85
+ <li class="footer__navitem">
86
+ <a target="_blank" rel="noopener" href="https://www.github.com/<%= current_organization.github_handler %>">
87
+ <%= t("layouts.decidim.social_media_links.github", organization: translated_attribute(current_organization.name)) %>
88
+ </a>
89
+ </li>
90
+ <% end %>
91
+ </ul>
92
+ </nav>
93
+ <nav id="LanguageLinks" class="footer_nav footer_nav--language">
94
+ <%= render partial: "layouts/decidim/language_chooser" %>
95
+ </nav>
96
+ </footer>
@@ -0,0 +1,25 @@
1
+ <!-- replace '.mini-footer' -->
2
+ <footer id="FooterCredits" class="credits">
3
+ <div id="PlatformLicense" class="credits__column credits__column--license">
4
+ <a rel="license noopener" class="cc-badge"
5
+ href="http://creativecommons.org/licenses/by-sa/4.0/"
6
+ target="_blank">
7
+ <%= image_pack_tag("media/images/cc-by-sa-4.svg", alt: t("layouts.decidim.footer.cc_by_license")) %>
8
+ </a>
9
+ <a rel="decidim noopener"
10
+ href="https://decidim.org/"
11
+ target="_blank">
12
+ <%= image_pack_tag("media/images/decidim-initial.svg", alt: t("layouts.decidim.footer.decidim_logo")) %>
13
+ </a>
14
+ </div>
15
+ <div id="MadeWith" class="credits__column credits__column--madewith">
16
+ <%= t("layouts.decidim.footer.made_with_open_source").html_safe %>
17
+ </div>
18
+ <div id="MadeBy" class="credits__column credits__column--madeby">
19
+ <% if current_organization.official_img_footer.attached? %>
20
+ <%= link_to current_organization.official_url do %>
21
+ <%= image_tag current_organization.attached_uploader(:official_img_footer).path, alt: current_organization.name %>
22
+ <% end %>
23
+ <% end %>
24
+ </div>
25
+ </footer>
@@ -0,0 +1,36 @@
1
+ Deface::Override.new(
2
+ :virtual_path => "layouts/decidim/mailer",
3
+ :name => "insert_email_css",
4
+ :replace => 'erb[loud]:contains("decidim_email")',
5
+ :text => "<%= stylesheet_pack_tag \"decidim_theme_email\" %>"
6
+ )
7
+ Deface::Override.new(
8
+ :virtual_path => "layouts/decidim/mailer",
9
+ :name => "email_outlook_spacer_1",
10
+ :set_attributes => '.spacer td',
11
+ :attributes => {height: "40"}
12
+ )
13
+ Deface::Override.new(
14
+ :virtual_path => "layouts/decidim/mailer",
15
+ :name => "email_center_footer",
16
+ :set_attributes => '.decidim-logo',
17
+ :attributes => {style: "text-align: center; padding-right: 16px"}
18
+ )
19
+ Deface::Override.new(
20
+ :virtual_path => "layouts/decidim/mailer",
21
+ :name => "email_footer_padding",
22
+ :set_attributes => '.row.content + .row',
23
+ :attributes => {height: "16"}
24
+ )
25
+ # Outlook fix: height must be as attribute, without pixel.
26
+ Deface::Override.new(
27
+ :virtual_path => "layouts/decidim/_mailer_logo",
28
+ :name => "email_header_image",
29
+ :replace => 'erb[loud]:contains("image_tag")',
30
+ :text => "<%= image_tag(
31
+ organization.attached_uploader(:logo).variant_url(:medium, host: organization.host),
32
+ style: \"max-height: 50px\",
33
+ alt: \"\#{organization.name}\",
34
+ height: \"50\"
35
+ ) %>"
36
+ )
@@ -0,0 +1,10 @@
1
+ ##
2
+ # Add classes like .o-sessions--new to all pages,
3
+ # with .o-<controller name> .o-<controller name>--<action-name>
4
+ #
5
+ Deface::Override.new(
6
+ :virtual_path => "layouts/decidim/_application",
7
+ :name => "class_prefixer_application",
8
+ :add_to_attributes => 'body',
9
+ :attributes => {:class => "<%= \"o-\" + params[:controller].split(\"/\").last.underscore + \" o-\" + params[:controller].split(\"/\").last.underscore + \"--\" + params[:action] %>"}
10
+ )
@@ -0,0 +1,63 @@
1
+ ##
2
+ # takes a long list of views, and insert at the root of the template
3
+ # the reference to the view template, to make the CSS work easier.
4
+ view_index = 0
5
+ {
6
+ "accountability/results": ["home", "index", "show"],
7
+ "accountability/versions": ["index", "show"],
8
+ "assemblies/assemblies": ["index", "show"],
9
+ "assemblies/assembly_members": ["index"],
10
+ "blogs/posts": ["index", "show"],
11
+ "budgets/budgets": ["index"],
12
+ "budgets/projects": ["index", "show"],
13
+ # "conferences/conferences": ["index", "show"],
14
+ # "conferences/conference_program": ["show"],
15
+ # "conferences/registration_types": ["index"],
16
+ "account": ["show", "delete"],
17
+ "devise/sessions": ["new"],
18
+ "devise/registrations": ["new"],
19
+ "devise/confirmations": ["new"],
20
+ "devise/unlocks": ["new"],
21
+ "devise/invitations": ["edit"],
22
+ "devise/passwords": ["new", "edit"],
23
+ "groups": ["edit", "new"],
24
+ "homepage": ["show"],
25
+ "last_activities": ["index"],
26
+ "messaging/conversations": ["index", "new", "show"],
27
+ "notifications": ["index"],
28
+ "notifications_settings": ["show"],
29
+ "pages": ["index", "_tabbed", "_standalone"],
30
+ "profiles": ["show"],
31
+ "scopes": ["picker"],
32
+ "searches": ["index"],
33
+ "user_activities": ["index"],
34
+ "user_conversations": ["index", "show"],
35
+ "user_interests": ["show"],
36
+ "user_timeline": ["index"],
37
+ "shared": ["_comments"],
38
+ "debates/debates": ["index", "new", "show"],
39
+ "debates/versions": ["index", "show"],
40
+ "meetings/meetings": ["index", "edit", "new", "show"],
41
+ "meetings/versions": ["index", "show"],
42
+ "participatory_processes/participatory_processes": ["index", "show", "all_metrics"],
43
+ "proposals/proposals": ["edit", "index", "new", "preview", "show", "complete", "compare", "_linked_proposals"],
44
+ "sortitions/sortitions": ["index", "show"]
45
+ }.each do |module_name, views|
46
+ css_module_name = "#{module_name}".gsub("/", "-")
47
+ views.each do |view_name|
48
+ css_suffix = "#{view_name}".gsub("_","")
49
+ css_view_name = "m_#{css_module_name}--#{css_suffix}"
50
+ Deface::Override.new(
51
+ :virtual_path => "decidim/#{module_name}/#{view_name}",
52
+ :name => "class_prefixer_#{view_index+=1}",
53
+ :add_to_attributes => 'div:root,ul:root,article:root,section:root',
54
+ :attributes => {:class => "m_#{css_module_name} #{css_view_name}"}
55
+ )
56
+ Deface::Override.new(
57
+ :virtual_path => "decidim/#{module_name}/#{view_name}",
58
+ :name => "section_prefixer_#{view_index+=1}",
59
+ :add_to_attributes => 'section',
60
+ :attributes => {:class => "m_#{css_module_name} m_#{css_module_name}--section"}
61
+ )
62
+ end
63
+ end
@@ -0,0 +1,10 @@
1
+ ##
2
+ # Add participatory_process class to the wrapper div
3
+ # in participatory_process layouts.
4
+ # This help us to design info tab and components.
5
+ Deface::Override.new(
6
+ :virtual_path => "layouts/decidim/participatory_process",
7
+ :name => "class_prefixer_participatory_process",
8
+ :add_to_attributes => 'div.wrapper',
9
+ :attributes => {:class => "o_participatory_process o_participatory_process--layout"}
10
+ )
@@ -0,0 +1 @@
1
+ import "entrypoints/decidim_theme_email.scss";
@@ -0,0 +1,2 @@
1
+ @import "stylesheets/decidim/theme/email.scss";
2
+
@@ -0,0 +1,5 @@
1
+ import $ from "jquery";
2
+ import "javascripts/has.polyfill.js";
3
+ import "javascripts/empty.polyfill.js";
4
+ require.context("../images", true);
5
+ require.context("../fonts", true);