decidim-core 0.0.1.alpha9 → 0.0.1

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.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -25
  3. data/app/assets/config/decidim_core_manifest.js +1 -0
  4. data/app/assets/fonts/decidim/Source_Sans_Pro_400.eot +0 -0
  5. data/app/assets/fonts/decidim/Source_Sans_Pro_400.svg +345 -0
  6. data/app/assets/fonts/decidim/Source_Sans_Pro_400.ttf +0 -0
  7. data/app/assets/fonts/decidim/Source_Sans_Pro_400.woff +0 -0
  8. data/app/assets/fonts/decidim/Source_Sans_Pro_400.woff2 +0 -0
  9. data/app/assets/fonts/decidim/Source_Sans_Pro_600.eot +0 -0
  10. data/app/assets/fonts/decidim/Source_Sans_Pro_600.svg +339 -0
  11. data/app/assets/fonts/decidim/Source_Sans_Pro_600.ttf +0 -0
  12. data/app/assets/fonts/decidim/Source_Sans_Pro_600.woff +0 -0
  13. data/app/assets/fonts/decidim/Source_Sans_Pro_600.woff2 +0 -0
  14. data/app/assets/fonts/decidim/Source_Sans_Pro_900.eot +0 -0
  15. data/app/assets/fonts/decidim/Source_Sans_Pro_900.svg +342 -0
  16. data/app/assets/fonts/decidim/Source_Sans_Pro_900.ttf +0 -0
  17. data/app/assets/fonts/decidim/Source_Sans_Pro_900.woff +0 -0
  18. data/app/assets/fonts/decidim/Source_Sans_Pro_900.woff2 +0 -0
  19. data/app/assets/images/decidim/default-avatar.svg +14 -0
  20. data/app/assets/javascripts/decidim.js.es6 +5 -5
  21. data/app/assets/javascripts/decidim/editor.js.es6 +46 -0
  22. data/app/assets/stylesheets/decidim/_variables.scss +12 -13
  23. data/app/assets/stylesheets/decidim/application.sass +4 -1
  24. data/app/assets/stylesheets/decidim/editor.sass +4 -0
  25. data/app/assets/stylesheets/decidim/modules/_card-grid.scss +4 -1
  26. data/app/assets/stylesheets/decidim/modules/_cards.scss +5 -0
  27. data/app/assets/stylesheets/decidim/modules/_navbar.scss +1 -0
  28. data/app/assets/stylesheets/decidim/modules/_process-header.scss +24 -75
  29. data/app/assets/stylesheets/decidim/modules/_process-nav.scss +0 -1
  30. data/app/assets/stylesheets/decidim/modules/_process-phase.scss +80 -0
  31. data/app/assets/stylesheets/decidim/utils/_fontface.scss +39 -1
  32. data/app/assets/stylesheets/decidim/utils/_helpers.scss +25 -0
  33. data/app/assets/stylesheets/decidim/utils/_keyframes.scss +21 -0
  34. data/app/assets/stylesheets/decidim/utils/_mixins.scss +37 -0
  35. data/app/assets/stylesheets/decidim/utils/_settings.scss +11 -5
  36. data/app/commands/decidim/authorize_user.rb +2 -2
  37. data/app/constraints/decidim/current_feature.rb +48 -0
  38. data/app/controllers/concerns/decidim/form_factory.rb +80 -0
  39. data/app/controllers/concerns/decidim/locale_switcher.rb +17 -10
  40. data/app/controllers/concerns/decidim/needs_participatory_process.rb +33 -0
  41. data/app/controllers/decidim/application_controller.rb +1 -1
  42. data/app/controllers/decidim/devise/confirmations_controller.rb +1 -1
  43. data/app/controllers/decidim/devise/passwords_controller.rb +1 -1
  44. data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
  45. data/app/controllers/decidim/devise/sessions_controller.rb +16 -2
  46. data/app/controllers/decidim/pages_controller.rb +14 -0
  47. data/app/controllers/decidim/participatory_processes_controller.rb +7 -0
  48. data/app/forms/decidim/form.rb +15 -0
  49. data/app/forms/translatable_presence_validator.rb +31 -0
  50. data/app/helpers/decidim/application_helper.rb +17 -2
  51. data/app/helpers/decidim/layout_helper.rb +8 -1
  52. data/app/helpers/decidim/localized_locales_helper.rb +43 -0
  53. data/app/helpers/decidim/participatory_process_helper.rb +16 -0
  54. data/app/helpers/decidim/translations_helper.rb +17 -0
  55. data/app/models/decidim/category.rb +35 -0
  56. data/app/models/decidim/component.rb +51 -0
  57. data/app/models/decidim/feature.rb +30 -0
  58. data/app/models/decidim/organization.rb +20 -1
  59. data/app/models/decidim/participatory_process.rb +43 -4
  60. data/app/models/decidim/participatory_process_attachment.rb +56 -0
  61. data/app/models/decidim/scope.rb +14 -0
  62. data/app/models/decidim/static_page.rb +56 -0
  63. data/app/models/decidim/user.rb +2 -0
  64. data/app/queries/decidim/organization_participatory_processes.rb +17 -0
  65. data/app/services/decidim/authorization_handler.rb +2 -2
  66. data/app/types/decidim/process_step_type.rb +24 -0
  67. data/app/types/decidim/process_type.rb +16 -0
  68. data/app/types/decidim/user_type.rb +14 -0
  69. data/app/uploaders/decidim/attachment_uploader.rb +70 -0
  70. data/app/uploaders/decidim/avatar_uploader.rb +14 -0
  71. data/app/uploaders/decidim/banner_image_uploader.rb +1 -1
  72. data/app/uploaders/decidim/hero_image_uploader.rb +1 -1
  73. data/app/uploaders/decidim/homepage_image_uploader.rb +11 -0
  74. data/app/uploaders/decidim/image_uploader.rb +46 -0
  75. data/app/uploaders/decidim/organization_logo_uploader.rb +9 -0
  76. data/app/views/decidim/devise/registrations/new.html.erb +1 -1
  77. data/app/views/decidim/participatory_processes/_documents.html.erb +26 -0
  78. data/app/views/decidim/participatory_processes/_photos.html.erb +16 -0
  79. data/app/views/decidim/participatory_processes/_promoted_process.html.erb +1 -1
  80. data/app/views/decidim/participatory_processes/show.html.erb +16 -11
  81. data/app/views/kaminari/decidim/_first_page.html.erb +11 -0
  82. data/app/views/kaminari/decidim/_gap.html.erb +8 -0
  83. data/app/views/kaminari/decidim/_last_page.html.erb +11 -0
  84. data/app/views/kaminari/decidim/_next_page.html.erb +11 -0
  85. data/app/views/kaminari/decidim/_page.html.erb +12 -0
  86. data/app/views/kaminari/decidim/_paginator.html.erb +25 -0
  87. data/app/views/kaminari/decidim/_prev_page.html.erb +11 -0
  88. data/app/views/layouts/decidim/_application.html.erb +17 -0
  89. data/app/views/layouts/decidim/_footer.html.erb +5 -3
  90. data/app/views/layouts/decidim/_header.html.erb +8 -21
  91. data/app/views/layouts/decidim/_language_chooser.html.erb +14 -0
  92. data/app/views/layouts/decidim/_logo.html.erb +17 -13
  93. data/app/views/layouts/decidim/_process_header.html.erb +34 -0
  94. data/app/views/layouts/decidim/_process_header_steps.html.erb +26 -0
  95. data/app/views/layouts/decidim/_user_menu.html.erb +2 -0
  96. data/app/views/layouts/decidim/application.html.erb +3 -0
  97. data/app/views/layouts/decidim/participatory_process.html.erb +15 -0
  98. data/app/views/pages/decidim_page.html.erb +12 -0
  99. data/app/views/pages/home.html.erb +106 -2
  100. data/config/i18n-tasks.yml +3 -1
  101. data/config/locales/ca.yml +40 -10
  102. data/config/locales/en.yml +39 -4
  103. data/config/locales/es.yml +44 -14
  104. data/config/routes.rb +14 -1
  105. data/db/migrate/20160919104837_create_decidim_organizations.rb +4 -0
  106. data/db/migrate/20161005153007_add_description_to_organizations.rb +1 -3
  107. data/db/migrate/20161010102356_translate_processes.rb +4 -4
  108. data/db/migrate/20161017085822_add_participatory_process_steps.rb +3 -3
  109. data/db/migrate/20161107152228_remove_not_null_on_step_position.rb +5 -0
  110. data/db/migrate/20161108093802_create_decidim_static_pages.rb +11 -0
  111. data/db/migrate/20161110092735_add_index_for_process_slug_organization.rb +8 -0
  112. data/db/migrate/20161110105712_create_decidim_features.rb +9 -0
  113. data/db/migrate/20161116115156_create_attachments.rb +18 -0
  114. data/db/migrate/20161123085134_add_categories.rb +10 -0
  115. data/db/migrate/20161130105257_create_decidim_scopes.rb +9 -0
  116. data/db/migrate/20161209134715_make_organization_description_optional.rb +5 -0
  117. data/db/migrate/20161213094244_add_avatar_to_users.rb +5 -0
  118. data/db/migrate/20161214152811_add_logo_to_organizations.rb +5 -0
  119. data/db/seeds.rb +36 -6
  120. data/db/seeds/Exampledocument.pdf +0 -0
  121. data/{app/assets/images/decidim/hero-home.jpg → db/seeds/homepage_image.jpg} +0 -0
  122. data/lib/decidim/core.rb +55 -2
  123. data/lib/decidim/core/engine.rb +16 -2
  124. data/lib/decidim/core/version.rb +11 -2
  125. data/lib/decidim/feature_manifest.rb +71 -0
  126. data/lib/decidim/features.rb +8 -0
  127. data/lib/decidim/features/base_controller.rb +32 -0
  128. data/lib/decidim/features/namer.rb +35 -0
  129. data/lib/decidim/form_builder.rb +140 -6
  130. data/lib/decidim/page_finder.rb +48 -0
  131. data/lib/decidim/query_extensions.rb +33 -0
  132. data/lib/decidim/translatable_attributes.rb +1 -24
  133. data/vendor/assets/javascripts/quill.min.js +14 -0
  134. data/vendor/assets/javascripts/quill.min.js.map +1 -0
  135. data/vendor/assets/stylesheets/quill.bubble.css +843 -0
  136. data/vendor/assets/stylesheets/quill.core.css +362 -0
  137. data/vendor/assets/stylesheets/quill.snow.css +881 -0
  138. metadata +164 -32
  139. data/LICENSE.txt +0 -619
  140. data/app/views/decidim/participatory_processes/_process_header_home.html.erb +0 -18
  141. data/app/views/pages/terms.ca.html.erb +0 -4
  142. data/app/views/pages/terms.en.html.erb +0 -4
  143. data/app/views/pages/terms.es.html.erb +0 -4
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This type represents a User.
4
+ UserType = GraphQL::ObjectType.define do
5
+ name "User"
6
+ description "A user"
7
+
8
+ field :name, types.String, "The user's name"
9
+
10
+ field :avatarUrl, !types.String, "The user's avatar url" do
11
+ resolve ->(obj, _args, _ctx) { obj.avatar.url }
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # This class deals with uploading attachments to a ParticipatoryProcess.
5
+ class AttachmentUploader < ApplicationUploader
6
+ include CarrierWave::MiniMagick
7
+
8
+ process :set_content_type_and_size_in_model
9
+ process :validate_dimensions
10
+ version :thumbnail, if: :image? do
11
+ process resize_to_fit: [nil, 237]
12
+ end
13
+ version :big, if: :image? do
14
+ process resize_to_limit: [nil, 1000]
15
+ end
16
+
17
+ protected
18
+
19
+ # CarrierWave automatically calls this method and validates the content
20
+ # type fo the temp file to match against any of these options.
21
+ def content_type_whitelist
22
+ [
23
+ %r{image\/},
24
+ %r{application\/vnd.oasis.opendocument},
25
+ %r{application\/vnd.ms-},
26
+ %r{application\/msword},
27
+ %r{application\/vnd.ms-word},
28
+ %r{application\/vnd.openxmlformats-officedocument},
29
+ %r{application\/vnd.oasis.opendocument},
30
+ %r{application\/pdf},
31
+ %r{application\/rtf}
32
+ ]
33
+ end
34
+
35
+ # Checks if the file is an image based on the content type. We need this so
36
+ # we only create different versions of the file when it's an image.
37
+ #
38
+ # new_file - The uploaded file.
39
+ #
40
+ # Returns a Boolean.
41
+ def image?(new_file)
42
+ new_file.content_type.start_with? "image"
43
+ end
44
+
45
+ # Copies the content type and file size to the model where this is mounted.
46
+ #
47
+ # Returns nothing.
48
+ def set_content_type_and_size_in_model
49
+ model.content_type = file.content_type if file.content_type
50
+ model.file_size = file.size
51
+ end
52
+
53
+ # A simple check to avoid DoS with maliciously crafted images, or just to
54
+ # avoid reckless users that upload gigapixels images.
55
+ #
56
+ # See https://hackerone.com/reports/390
57
+ def validate_dimensions
58
+ return unless image?(self)
59
+
60
+ manipulate! do |image|
61
+ raise CarrierWave::IntegrityError, I18n.t("carrierwave.errors.image_too_big") if image.dimensions.any? { |dimension| dimension > max_image_height_or_width }
62
+ image
63
+ end
64
+ end
65
+
66
+ def max_image_height_or_width
67
+ 8000
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # This class deals with uploading avatars to a User.
5
+ class AvatarUploader < ImageUploader
6
+ include CarrierWave::MiniMagick
7
+
8
+ process :validate_dimensions
9
+
10
+ def default_url(*)
11
+ ActionController::Base.helpers.asset_path("decidim/default-avatar.svg")
12
+ end
13
+ end
14
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Decidim
3
3
  # This class deals with uploading banner images to ParticipatoryProcesses.
4
- class BannerImageUploader < ApplicationUploader
4
+ class BannerImageUploader < ImageUploader
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Decidim
3
3
  # This class deals with uploading hero images to ParticipatoryProcesses.
4
- class HeroImageUploader < ApplicationUploader
4
+ class HeroImageUploader < ImageUploader
5
5
  end
6
6
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This class deals with uploading hero images to ParticipatoryProcesses.
4
+ class HomepageImageUploader < ImageUploader
5
+ include CarrierWave::MiniMagick
6
+
7
+ version :big do
8
+ process resize_to_limit: [nil, 2000]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This class deals with uploading hero images to ParticipatoryProcesses.
4
+ class ImageUploader < ApplicationUploader
5
+ include CarrierWave::MiniMagick
6
+
7
+ process :validate_size, :validate_dimensions
8
+
9
+ # CarrierWave automatically calls this method and validates the content
10
+ # type fo the temp file to match against any of these options.
11
+ def content_type_whitelist
12
+ [
13
+ %r{image\/}
14
+ ]
15
+ end
16
+
17
+ # A simple check to avoid DoS with maliciously crafted images, or just to
18
+ # avoid reckless users that upload gigapixels images.
19
+ #
20
+ # See https://hackerone.com/reports/390
21
+ def validate_dimensions
22
+ manipulate! do |image|
23
+ validation_error!(I18n.t("carrierwave.errors.image_too_big")) if image.dimensions.any? { |dimension| dimension > max_image_height_or_width }
24
+ image
25
+ end
26
+ end
27
+
28
+ def validate_size
29
+ manipulate! do |image|
30
+ validation_error!(I18n.t("carrierwave.errors.image_too_big")) if image.size > 10.megabytes
31
+ image
32
+ end
33
+ end
34
+
35
+ def max_image_height_or_width
36
+ 8000
37
+ end
38
+
39
+ private
40
+
41
+ def validation_error!(text)
42
+ model.errors.add(mounted_as, text)
43
+ raise CarrierWave::IntegrityError, text
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This class deals with uploading hero images to ParticipatoryProcesses.
4
+ class OrganizationLogoUploader < ImageUploader
5
+ version :medium do
6
+ process resize_to_limit: [140, 45]
7
+ end
8
+ end
9
+ end
@@ -38,7 +38,7 @@
38
38
 
39
39
  <fieldset>
40
40
  <div class="field">
41
- <%= f.check_box :tos_agreement, label: t(".tos_agreement", link: link_to(t(".terms"), page_path(:terms))) %>
41
+ <%= f.check_box :tos_agreement, label: t(".tos_agreement", link: link_to(t(".terms"), page_path("terms-and-conditions"))) %>
42
42
  </div>
43
43
  </fieldset>
44
44
 
@@ -0,0 +1,26 @@
1
+ <% if documents.any? %>
2
+ <div class="section documents">
3
+ <h4 class="section-heading"><%= t(".related_documents") %></h4>
4
+ <div class="card card--list">
5
+ <% documents.each do |document| %>
6
+ <div class="card--list__item">
7
+ <div class="card--list__text">
8
+ <div>
9
+ <a href="<%= document.url %>" class="card__link">
10
+ <h6 class="card--list__heading heading6">
11
+ <%= translated_attribute(document.title) %> <small><%= document.file_type %> <%= number_to_human_size(document.file_size) %></small>
12
+ </h6>
13
+ <span class="text-small"><%= translated_attribute(document.description) %></span>
14
+ </a>
15
+ </div>
16
+ </div>
17
+ <div class="card--list__data">
18
+ <%= link_to document.url, class: "card--list__data__icon" do %>
19
+ <%= icon "cloud-download" %>
20
+ <% end %>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ </div>
26
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <% if photos.any? %>
2
+ <div class="section images">
3
+ <h4 class="section-heading"><%= t(".related_photos") %></h4>
4
+ <div class="gallery row">
5
+ <% photos.in_groups_of(3, false).each do |group| %>
6
+ <% group.each_with_index do |photo, index| %>
7
+ <div class="columns small-6 medium-4 <%= (index == 2 || photo == group.last ? "end" : "") %>">
8
+ <%= link_to photo.big_url do %>
9
+ <%= image_tag photo.thumbnail_url, class:"thumbnail", alt: strip_tags(translated_attribute(photo.description)) %>
10
+ <% end %>
11
+ </div>
12
+ <% end %>
13
+ <% end %>
14
+ </div>
15
+ </div>
16
+ <% end %>
@@ -5,7 +5,7 @@
5
5
  <%= link_to participatory_process_path(promoted_process), class: "card__link" do %>
6
6
  <h2 class="card__title"><%= translated_attribute promoted_process.title %></h2>
7
7
  <% end %>
8
- <%= truncate(translated_attribute(promoted_process.description).html_safe, length: 630, separator: ' ') %>
8
+ <%== html_truncate(translated_attribute(promoted_process.description), length: 630, separator: ' ') %>
9
9
  <%= link_to participatory_process_path(promoted_process), class: "button secondary small hollow card__button" do %>
10
10
  <%= t(".more_info", scope: "layouts") %>
11
11
  <% end %>
@@ -1,15 +1,20 @@
1
- <main class="wrapper">
2
- <%= render partial: "process_header_home" %>
3
- <div class="row column">
4
- <div class="row">
5
- <div class="columns medium-7 mediumlarge-8">
6
- <div class="section">
7
- <div class="lead">
8
- <%== translated_attribute(participatory_process.short_description) %>
9
- </div>
10
- <%== translated_attribute(participatory_process.description) %>
1
+ <div class="row column">
2
+ <div class="row">
3
+ <div class="columns medium-7 mediumlarge-8">
4
+ <div class="section">
5
+ <div class="lead">
6
+ <%== translated_attribute(participatory_process.short_description) %>
11
7
  </div>
8
+ <%== translated_attribute(participatory_process.description) %>
12
9
  </div>
13
10
  </div>
14
11
  </div>
15
- </main>
12
+ </div>
13
+ <% if participatory_process.attachments.any? %>
14
+ <div class="row attachments">
15
+ <div class="columns large-8">
16
+ <%= render partial: "documents", locals: { documents: participatory_process.documents } %>
17
+ <%= render partial: "photos", locals: { photos: participatory_process.photos } %>
18
+ </div>
19
+ </div>
20
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "First" page
2
+ - available local variables
3
+ url: url to the first page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="first">
10
+ <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote %>
11
+ </li>
@@ -0,0 +1,8 @@
1
+ <%# Non-link tag that stands for skipped pages...
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ -%>
8
+ <li class="page gap"><%= t('views.pagination.truncate').html_safe %></li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Last" page
2
+ - available local variables
3
+ url: url to the last page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="last">
10
+ <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote %>
11
+ </li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Next" page
2
+ - available local variables
3
+ url: url to the next page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="pagination-next">
10
+ <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote %>
11
+ </li>
@@ -0,0 +1,12 @@
1
+ <%# Link showing page number
2
+ - available local variables
3
+ page: a page object for "this" page
4
+ url: url to this page
5
+ current_page: a page object for the currently displayed page
6
+ total_pages: total number of pages
7
+ per_page: number of items to fetch per page
8
+ remote: data-remote
9
+ -%>
10
+ <li class="page<%= ' current' if page.current? %>">
11
+ <%= link_to_unless page.current?, page, url, {remote: remote, rel: page.rel} %>
12
+ </li>
@@ -0,0 +1,25 @@
1
+ <%# The container tag
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ paginator: the paginator that renders the pagination tags inside
8
+ -%>
9
+ <%= paginator.render do -%>
10
+ <ul class="pagination text-center" role="navigation" aria-label="Pagination">
11
+ <%= first_page_tag unless current_page.first? %>
12
+ <%= prev_page_tag unless current_page.first? %>
13
+ <% each_page do |page| -%>
14
+ <% if page.display_tag? -%>
15
+ <%= page_tag page %>
16
+ <% elsif !page.was_truncated? -%>
17
+ <%= gap_tag %>
18
+ <% end -%>
19
+ <% end -%>
20
+ <% unless current_page.out_of_range? %>
21
+ <%= next_page_tag unless current_page.last? %>
22
+ <%= last_page_tag unless current_page.last? %>
23
+ <% end %>
24
+ </ul>
25
+ <% end -%>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Previous" page
2
+ - available local variables
3
+ url: url to the previous page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="pagination-previous">
10
+ <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote %>
11
+ </li>
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= decidim_page_title %></title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
+ <%= render partial: 'layouts/decidim/meta' %>
10
+ </head>
11
+
12
+ <body>
13
+ <%= render partial: 'layouts/decidim/header' %>
14
+ <%= yield %>
15
+ <%= render partial: 'layouts/decidim/footer' %>
16
+ </body>
17
+ </html>
@@ -3,11 +3,13 @@
3
3
  <div class="main-footer">
4
4
  <div class="row">
5
5
  <div class="medium-8 large-6 large-offset-3 column main__footer__nav">
6
+ <% if current_organization.static_pages.any? %>
6
7
  <ul class="footer-nav">
7
- <li><%= link_to t('.about'), page_path("about") %></a></li>
8
- <li><%= link_to t('.terms_of_use'), page_path("terms") %></a></li>
9
- <li><%= link_to t('.accessibility'), page_path("accessibility") %></a></li>
8
+ <% current_organization.static_pages.each do |page| %>
9
+ <li><%= link_to translated_attribute(page.title), decidim.page_path(page) %></a></li>
10
+ <% end %>
10
11
  </ul>
12
+ <% end %>
11
13
  </div>
12
14
  </div>
13
15
  </div>
@@ -23,20 +23,7 @@
23
23
  <div class="logo-wrapper">
24
24
  <%= render partial: "layouts/decidim/logo" %>
25
25
  </div>
26
- <div class="topbar__dropmenu language-choose">
27
- <ul class="dropdown menu" data-dropdown-menu>
28
- <li class="is-dropdown-submenu-parent">
29
- <%= link_to t(current_locale, scope: "locales") %>
30
- <% if available_locales.length > 1 %>
31
- <ul class="menu is-dropdown-submenu">
32
- <% available_locales.each do |locale| %>
33
- <li><%= link_to t(locale, scope: "locales"), locale_path(locale: locale), method: :post%></li>
34
- <% end %>
35
- <% end %>
36
- </ul>
37
- </li>
38
- </ul>
39
- </div>
26
+ <%= render partial: "layouts/decidim/language_chooser" %>
40
27
  <div class="hide-for-medium topbar__menu">
41
28
  <button type="button" data-toggle="offCanvas">
42
29
  <%= icon "menu", aria_label: t('.navigation'), role: "img" %>
@@ -46,14 +33,14 @@
46
33
  <div class="topbar__dropmenu topbar__user__logged">
47
34
  <ul class="dropdown menu" data-dropdown-menu>
48
35
  <li class="is-dropdown-submenu-parent show-for-medium">
49
- <%= link_to current_user.name, account_path %>
36
+ <%= link_to current_user.name, decidim.account_path %>
50
37
  <ul class="menu is-dropdown-subeenu js-append usermenu-off-canvas">
51
- <li><%= link_to t('.sign_out'), destroy_user_session_path, method: :delete, class: "sign-out-link" %></li>
38
+ <%= render partial: "layouts/decidim/user_menu" %>
52
39
  </ul>
53
40
  <span data-set="nav-login-holder" class="show-for-medium">
54
41
  <!-- Repeated due to dropdown limitations -->
55
42
  <ul class="menu is-dropdown-submenu js-append usermenu-off-canvas">
56
- <li><%= link_to t('.sign_out'), destroy_user_session_path, method: :delete, class: "sign-out-link" %></li>
43
+ <%= render partial: "layouts/decidim/user_menu" %>
57
44
  </ul>
58
45
  </span>
59
46
  </li>
@@ -62,8 +49,8 @@
62
49
  <% else %>
63
50
  <div class="topbar__user show-for-medium" data-set="nav-login-holder">
64
51
  <div class="topbar__user__login js-append">
65
- <%= link_to t('.sign_up'), new_user_registration_path, class: "sign-up-link" %>
66
- <%= link_to t('.sign_in'), new_user_session_path, class: "sign-in-link" %>
52
+ <%= link_to t('.sign_up'), decidim.new_user_registration_path, class: "sign-up-link" %>
53
+ <%= link_to t('.sign_in'), decidim.new_user_session_path, class: "sign-in-link" %>
67
54
  </div>
68
55
  </div>
69
56
  <% end %>
@@ -74,10 +61,10 @@
74
61
  <div class="row">
75
62
  <ul class="main-nav">
76
63
  <li>
77
- <%= active_link_to t("menu.home", scope: "decidim"), root_path, active: :exact, class: "main-nav__link", class_active: "main-nav__link-active" %>
64
+ <%= active_link_to t("menu.home", scope: "decidim"), decidim.root_path, active: :exact, class: "main-nav__link", class_active: "main-nav__link--active" %>
78
65
  </li>
79
66
  <li>
80
- <%= active_link_to t("menu.processes", scope: "decidim"), participatory_processes_path, active: :inclusive, class: "main-nav__link", class_active: "main-nav__link--active" %>
67
+ <%= active_link_to t("menu.processes", scope: "decidim"), decidim.participatory_processes_path, active: :inclusive, class: "main-nav__link", class_active: "main-nav__link--active" %>
81
68
  </li>
82
69
  </ul>
83
70
  </div>