diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index 5538a2c59..d0367a8c1 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -279,7 +279,7 @@ $sidebar-active: #f4fcd0;
}
.no-margin-bottom {
- margin-bottom: 0 !important;
+ margin-bottom: 0 !important;
}
// 02. Sidebar
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 9ecf29802..8a6867565 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -319,7 +319,8 @@
.legislation-process-new,
.legislation-process-edit,
.milestone-new,
-.milestone-edit {
+.milestone-edit,
+.image-form {
@include direct-uploads;
}
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index b1f07dd05..c88deba56 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -37,7 +37,11 @@ module AdminHelper
end
def menu_customization?
- ["pages", "images", "content_blocks"].include?(controller_name)
+ ["pages", "images", "content_blocks"].include?(controller_name) || menu_homepage?
+ end
+
+ def menu_homepage?
+ ["homepage", "cards"].include?(controller_name)
end
def official_level_options
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb
index 7336aad77..e59244e48 100644
--- a/app/views/admin/_menu.html.erb
+++ b/app/views/admin/_menu.html.erb
@@ -167,10 +167,10 @@
>
- - >
- <%= link_to "Homepage", admin_homepage_path %>
+
- >
+ <%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
-
+
- >
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
@@ -183,7 +183,7 @@
- >
<%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path%>
-
+
diff --git a/app/views/admin/homepage/_card.html.erb b/app/views/admin/homepage/_card.html.erb
index d1986d8f7..449bdbad5 100644
--- a/app/views/admin/homepage/_card.html.erb
+++ b/app/views/admin/homepage/_card.html.erb
@@ -1,22 +1,27 @@
| <%= card.title %> |
<%= card.description %> |
- <%= card.link_text %> |
- <%= card.link_url %> |
-
-
- <% if card.image.present? %>
- <%= image_tag(card.image_url(:thumb),
- class: "margin",
- alt: card.image.title) %>
- <% end %> |
-
- <%= link_to "Edit", edit_admin_widget_card_path(card) %>
-
- <%= link_to "Remove", admin_widget_card_path(card),
- method: :delete,
- data: { confirm: t('admin.actions.confirm') } %>
-
+ <%= card.link_text %>
+ <%= card.link_url %>
|
-
\ No newline at end of file
+
+
+
+ <% if card.image.present? %>
+ <%= link_to t("admin.shared.show_image"), card.image_url(:large),
+ title: card.image.title, target: "_blank" %>
+ <% end %>
+ |
+
+ <%= link_to t("admin.actions.edit"),
+ edit_admin_widget_card_path(card),
+ class: "button hollow" %>
+
+ <%= link_to t("admin.actions.delete"),
+ admin_widget_card_path(card),
+ method: :delete,
+ data: { confirm: t('admin.actions.confirm') },
+ class: "button hollow alert" %>
+ |
+
diff --git a/app/views/admin/homepage/_cards.html.erb b/app/views/admin/homepage/_cards.html.erb
index e6f2a7eac..ab75445fa 100644
--- a/app/views/admin/homepage/_cards.html.erb
+++ b/app/views/admin/homepage/_cards.html.erb
@@ -1,13 +1,16 @@
-
- | title |
- text |
- link text |
- link |
- image |
- actions |
-
- <% cards.each do |card| %>
- <%= render "card", card: card %>
- <% end %>
-
\ No newline at end of file
+
+
+ | <%= t("admin.homepage.cards.title") %> |
+ <%= t("admin.homepage.cards.description") %> |
+ <%= t("admin.homepage.cards.link_text") %> / <%= t("admin.homepage.cards.link_url") %> |
+ <%= t("admin.shared.image") %> |
+ <%= t("admin.shared.actions") %> |
+
+
+
+ <% cards.each do |card| %>
+ <%= render "card", card: card %>
+ <% end %>
+
+
diff --git a/app/views/admin/homepage/_setting.html.erb b/app/views/admin/homepage/_setting.html.erb
index 89221e793..1398f6951 100644
--- a/app/views/admin/homepage/_setting.html.erb
+++ b/app/views/admin/homepage/_setting.html.erb
@@ -1,11 +1,11 @@
<%= form_for(setting, url: admin_setting_path(setting), method: :put) do |f| %>
- <%= f.hidden_field :value,
- value: (setting.enabled? ? "" : "active") %>
-
+ <%= f.hidden_field :value,
+ value: (setting.enabled? ? "" : "active") %>
+
<%= f.submit(t("admin.settings.index.features.#{setting.enabled? ? 'disable' : 'enable'}"),
- class: "button expanded #{setting.enabled? ? 'hollow alert' : 'success'}",
+ class: "button #{setting.enabled? ? 'hollow alert' : 'success'}",
data: {confirm: t("admin.actions.confirm")}) %>
<% end %>
-
\ No newline at end of file
+
diff --git a/app/views/admin/homepage/show.html.erb b/app/views/admin/homepage/show.html.erb
index 0d6e3fc9f..b209a0ec6 100644
--- a/app/views/admin/homepage/show.html.erb
+++ b/app/views/admin/homepage/show.html.erb
@@ -1,35 +1,48 @@
-Homepage
+<%= t("admin.homepage.title") %>
-The active modules appear in the homepage in the same order as here.
+<%= t("admin.homepage.description") %>
+ <%= t("admin.homepage.header_title") %>
-Cards
-
-
- <%= link_to "Create header", new_admin_widget_card_path(header_card: true) %>
-
-
-
- <%= link_to "Create card", new_admin_widget_card_path %>
-
-
-
- <% if @cards.present? %>
- <%= render "cards", cards: @cards %>
- <% end %>
-
-
-
-<% @settings.each do |setting| %>
-
-
-
<%= t("settings.#{setting.key}") %>
+
+ <%= link_to t("admin.homepage.create_header"), new_admin_widget_card_path(header_card: true), class: "button" %>
- <%= render "setting", setting: setting %>
-<% end %>
\ No newline at end of file
+ <% if @header.present? %>
+ <%= render "cards", cards: @header %>
+ <% else %>
+
+ <%= t("admin.homepage.no_header") %>
+
+ <% end %>
+
+
+
+
+
+
<%= t("admin.homepage.cards_title") %>
+
+
+ <%= link_to t("admin.homepage.create_card"), new_admin_widget_card_path, class: "button" %>
+
+
+ <% if @cards.present? %>
+ <%= render "cards", cards: @cards %>
+ <% else %>
+
+ <%= t("admin.homepage.no_cards") %>
+
+ <% end %>
+
+
+
+
+<% @settings.each do |setting| %>
+
+
<%= t("settings.#{setting.key}") %>
+
+ <%= render "setting", setting: setting %>
+
+
+<% end %>
diff --git a/app/views/admin/widget/cards/_form.html.erb b/app/views/admin/widget/cards/_form.html.erb
index 2e8a70295..ec10bd0f9 100644
--- a/app/views/admin/widget/cards/_form.html.erb
+++ b/app/views/admin/widget/cards/_form.html.erb
@@ -1,11 +1,23 @@
<%= form_for [:admin, @card] do |f| %>
<%= f.text_field :title %>
- <%= f.text_area :description %>
- <%= f.text_field :link_text %>
- <%= f.text_field :link_url %>
- <%= f.hidden_field :header, value: @card.header? %>
-
- <%= render 'images/nested_image', imageable: @card, f: f %>
+
+ <%= f.text_area :description, rows: 5 %>
+
+
+ <%= f.text_field :link_text %>
- <%= f.submit %>
-<% end %>
\ No newline at end of file
+
+
+ <%= f.text_field :link_url %>
+
+
+ <%= f.hidden_field :header, value: @card.header? %>
+
+
+
+ <%= f.submit(t("admin.homepage.#{action_name}.#{@card.header? ? 'submit_header' : 'submit_card'}"), class: "button success") %>
+<% end %>
diff --git a/app/views/admin/widget/cards/edit.html.erb b/app/views/admin/widget/cards/edit.html.erb
index 259dc7b82..b9e6045c9 100644
--- a/app/views/admin/widget/cards/edit.html.erb
+++ b/app/views/admin/widget/cards/edit.html.erb
@@ -1,2 +1,9 @@
-Edit
+
+ <% if @card.header? %>
+ <%= t("admin.homepage.edit.header_title") %>
+ <% else %>
+ <%= t("admin.homepage.edit.card_title") %>
+ <% end %>
+
+
<%= render "form" %>
\ No newline at end of file
diff --git a/app/views/admin/widget/cards/new.html.erb b/app/views/admin/widget/cards/new.html.erb
index dae2d7b9f..9e7ee40b2 100644
--- a/app/views/admin/widget/cards/new.html.erb
+++ b/app/views/admin/widget/cards/new.html.erb
@@ -1,2 +1,9 @@
-New
-<%= render "form" %>
\ No newline at end of file
+
+ <% if @card.header? %>
+ <%= t("admin.homepage.new.header_title") %>
+ <% else %>
+ <%= t("admin.homepage.new.card_title") %>
+ <% end %>
+
+
+<%= render "form" %>
diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb
index ebfe32db9..1e677045f 100644
--- a/app/views/layouts/_admin_header.html.erb
+++ b/app/views/layouts/_admin_header.html.erb
@@ -16,7 +16,7 @@
- <%= link_to namespaced_root_path do %>
+ <%= link_to admin_root_path do %>
<%= setting['org_name'] %>
<%= namespaced_header_title %>
<% end %>
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml
index 04adffb48..2ad35f3c1 100644
--- a/config/i18n-tasks.yml
+++ b/config/i18n-tasks.yml
@@ -143,6 +143,7 @@ ignore_unused:
- 'admin.settings.index.features.*'
- 'admin.polls.*.submit_button'
- 'admin.booths.*.submit_button'
+ - 'admin.homepage.*'
- 'moderation.comments.index.filter*'
- 'moderation.comments.index.order*'
- 'moderation.debates.index.filter*'
diff --git a/config/locales/en/activerecord.yml b/config/locales/en/activerecord.yml
index 2d5163cb0..b26e0552b 100644
--- a/config/locales/en/activerecord.yml
+++ b/config/locales/en/activerecord.yml
@@ -245,6 +245,11 @@ en:
subject: Subject
from: From
body: Email content
+ widget/card:
+ title: Title
+ description: Description
+ link_text: Link text
+ link_url: Link URL
errors:
models:
user:
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index 0292df944..809fddec6 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -499,6 +499,7 @@ en:
stats: Statistics
signature_sheets: Signature Sheets
site_customization:
+ homepage: Homepage
pages: Custom Pages
images: Custom Images
content_blocks: Custom content blocks
@@ -958,6 +959,8 @@ en:
actions: Actions
title: Title
description: Description
+ image: Image
+ show_image: Show image
spending_proposals:
index:
geozone_filter_all: All zones
@@ -1212,3 +1215,27 @@ en:
status_draft: Draft
status_published: Published
locale: Language
+ homepage:
+ title: Homepage
+ description: The active modules appear in the homepage in the same order as here.
+ header_title: Header
+ no_header: There is no header.
+ create_header: Create header
+ cards_title: Cards
+ create_card: Create card
+ no_cards: There is no cards.
+ cards:
+ title: Title
+ description: Description
+ link_text: Link text
+ link_url: Link URL
+ new:
+ header_title: New header
+ submit_header: Create header
+ card_title: New card
+ submit_card: Create card
+ edit:
+ header_title: Edit header
+ submit_header: Save header
+ card_title: Edit card
+ submit_card: Save card
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index d99e5c60a..24f0bdfda 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -845,3 +845,6 @@ en:
proposal: "Proposal"
debate: "Debate"
budget_investment: "Budget investment"
+ admin/widget:
+ header:
+ title: Administration
\ No newline at end of file
diff --git a/config/locales/es/activerecord.yml b/config/locales/es/activerecord.yml
index d3a0c776a..0b247f4be 100644
--- a/config/locales/es/activerecord.yml
+++ b/config/locales/es/activerecord.yml
@@ -241,6 +241,11 @@ es:
subject: Asunto
from: Enviado por
body: Contenido del email
+ widget/card:
+ title: Título
+ description: Descripción
+ link_text: Texto del enlace
+ link_url: URL del enlace
errors:
models:
user:
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index 5d44c9a17..9487996ef 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -499,6 +499,7 @@ es:
stats: Estadísticas
signature_sheets: Hojas de firmas
site_customization:
+ homepage: Homepage
pages: Personalizar páginas
images: Personalizar imágenes
content_blocks: Personalizar bloques
@@ -958,6 +959,8 @@ es:
actions: Acciones
title: Título
description: Descripción
+ image: Imagen
+ show_image: Mostrar imagen
spending_proposals:
index:
geozone_filter_all: Todos los ámbitos de actuación
@@ -1212,3 +1215,27 @@ es:
status_draft: Borrador
status_published: Publicada
locale: Idioma
+ homepage:
+ title: Homepage
+ description: Los módulos activos aparecerán en la homepage en el mismo orden que aquí.
+ header_title: Encabezado
+ create_header: Crear encabezado
+ no_header: No hay encabezado.
+ cards_title: Tarjetas
+ create_card: Crear tarjeta
+ no_cards: No hay tarjetas.
+ cards:
+ title: Título
+ description: Descripción
+ link_text: Texto del enlace
+ link_url: URL del enlace
+ new:
+ header_title: Nuevo encabezado
+ submit_header: Crear encabezado
+ card_title: Nueva tarjeta
+ submit_card: Crear tarjeta
+ edit:
+ header_title: Editar encabezado
+ submit_header: Guardar encabezado
+ card_title: Editar tarjeta
+ submit_card: Guardar tarjeta
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index eeca5f5d9..81e37d53d 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -844,3 +844,6 @@ es:
proposal: "Propuesta"
debate: "Debate"
budget_investment: "Proyecto de gasto"
+ admin/widget:
+ header:
+ title: Administración
\ No newline at end of file