Adds styles and missing i18n for admin homepage
This commit is contained in:
@@ -279,7 +279,7 @@ $sidebar-active: #f4fcd0;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.no-margin-bottom {
|
.no-margin-bottom {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 02. Sidebar
|
// 02. Sidebar
|
||||||
|
|||||||
@@ -319,7 +319,8 @@
|
|||||||
.legislation-process-new,
|
.legislation-process-new,
|
||||||
.legislation-process-edit,
|
.legislation-process-edit,
|
||||||
.milestone-new,
|
.milestone-new,
|
||||||
.milestone-edit {
|
.milestone-edit,
|
||||||
|
.image-form {
|
||||||
@include direct-uploads;
|
@include direct-uploads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ module AdminHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def menu_customization?
|
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
|
end
|
||||||
|
|
||||||
def official_level_options
|
def official_level_options
|
||||||
|
|||||||
@@ -167,10 +167,10 @@
|
|||||||
</a>
|
</a>
|
||||||
<ul <%= "class=is-active" if menu_customization? &&
|
<ul <%= "class=is-active" if menu_customization? &&
|
||||||
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
controller.class.parent != Admin::Poll::Questions::Answers %>>
|
||||||
<li <%= "class=active" if controller_name == "homepage" %>>
|
<li <%= "class=active" if menu_homepage? %>>
|
||||||
<%= link_to "Homepage", admin_homepage_path %>
|
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li <%= "class=active" if controller_name == "pages" %>>
|
<li <%= "class=active" if controller_name == "pages" %>>
|
||||||
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
|
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
|
||||||
</li>
|
</li>
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
<li <%= "class=active" if controller_name == "content_blocks" %>>
|
<li <%= "class=active" if controller_name == "content_blocks" %>>
|
||||||
<%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path%>
|
<%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path%>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
<tr id="<%= dom_id(card) %>" class="card">
|
<tr id="<%= dom_id(card) %>" class="card">
|
||||||
<td><%= card.title %></td>
|
<td><%= card.title %></td>
|
||||||
<td><%= card.description %></td>
|
<td><%= card.description %></td>
|
||||||
<td><%= card.link_text %></td>
|
|
||||||
<td><%= card.link_url %></td>
|
|
||||||
|
|
||||||
<!-- remove conditional once specs have image validations -->
|
|
||||||
<td><% if card.image.present? %>
|
|
||||||
<%= image_tag(card.image_url(:thumb),
|
|
||||||
class: "margin",
|
|
||||||
alt: card.image.title) %>
|
|
||||||
<% end %></td>
|
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<%= card.link_text %><br>
|
||||||
<%= link_to "Edit", edit_admin_widget_card_path(card) %>
|
<%= card.link_url %>
|
||||||
<div>
|
|
||||||
<%= link_to "Remove", admin_widget_card_path(card),
|
|
||||||
method: :delete,
|
|
||||||
data: { confirm: t('admin.actions.confirm') } %>
|
|
||||||
<div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
|
||||||
|
<!-- remove conditional once specs have image validations -->
|
||||||
|
<td>
|
||||||
|
<% if card.image.present? %>
|
||||||
|
<%= link_to t("admin.shared.show_image"), card.image_url(:large),
|
||||||
|
title: card.image.title, target: "_blank" %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= 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" %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<thead>
|
||||||
<th>title</th>
|
<tr>
|
||||||
<th>text</th>
|
<th><%= t("admin.homepage.cards.title") %></th>
|
||||||
<th>link text</th>
|
<th class="small-4"><%= t("admin.homepage.cards.description") %></th>
|
||||||
<th>link</th>
|
<th><%= t("admin.homepage.cards.link_text") %> / <%= t("admin.homepage.cards.link_url") %></th>
|
||||||
<th>image</th>
|
<th><%= t("admin.shared.image") %></th>
|
||||||
<th>actions</th>
|
<th><%= t("admin.shared.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
<% cards.each do |card| %>
|
</thead>
|
||||||
<%= render "card", card: card %>
|
<tbody>
|
||||||
<% end %>
|
<% cards.each do |card| %>
|
||||||
</table>
|
<%= render "card", card: card %>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<div id="<%= dom_id(setting) %>">
|
<div id="<%= dom_id(setting) %>">
|
||||||
<%= form_for(setting, url: admin_setting_path(setting), method: :put) do |f| %>
|
<%= form_for(setting, url: admin_setting_path(setting), method: :put) do |f| %>
|
||||||
|
|
||||||
<%= f.hidden_field :value,
|
<%= f.hidden_field :value,
|
||||||
value: (setting.enabled? ? "" : "active") %>
|
value: (setting.enabled? ? "" : "active") %>
|
||||||
|
|
||||||
<%= f.submit(t("admin.settings.index.features.#{setting.enabled? ? 'disable' : 'enable'}"),
|
<%= 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")}) %>
|
data: {confirm: t("admin.actions.confirm")}) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,35 +1,48 @@
|
|||||||
<h1>Homepage</h1>
|
<h2><%= t("admin.homepage.title") %></h2>
|
||||||
|
|
||||||
<p>The active modules appear in the homepage in the same order as here.</p>
|
<p><%= t("admin.homepage.description") %></p>
|
||||||
|
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<% if @header.present? %>
|
<h3 class="inline-block"><%= t("admin.homepage.header_title") %></h3>
|
||||||
<%= render "cards", cards: @header %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>Cards</h2>
|
<div class="float-right">
|
||||||
|
<%= link_to t("admin.homepage.create_header"), new_admin_widget_card_path(header_card: true), class: "button" %>
|
||||||
<div>
|
|
||||||
<%= link_to "Create header", new_admin_widget_card_path(header_card: true) %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<%= link_to "Create card", new_admin_widget_card_path %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="cards">
|
|
||||||
<% if @cards.present? %>
|
|
||||||
<%= render "cards", cards: @cards %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<% @settings.each do |setting| %>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<strong><%= t("settings.#{setting.key}") %></strong>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render "setting", setting: setting %>
|
<% if @header.present? %>
|
||||||
<% end %>
|
<%= render "cards", cards: @header %>
|
||||||
|
<% else %>
|
||||||
|
<div class="callout primary clear">
|
||||||
|
<%= t("admin.homepage.no_header") %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div id="cards">
|
||||||
|
<h3 class="inline-block"><%= t("admin.homepage.cards_title") %></h3>
|
||||||
|
|
||||||
|
<div class="float-right">
|
||||||
|
<%= link_to t("admin.homepage.create_card"), new_admin_widget_card_path, class: "button" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% if @cards.present? %>
|
||||||
|
<%= render "cards", cards: @cards %>
|
||||||
|
<% else %>
|
||||||
|
<div class="callout primary clear">
|
||||||
|
<%= t("admin.homepage.no_cards") %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<% @settings.each do |setting| %>
|
||||||
|
<div class="callout">
|
||||||
|
<h3 class="inline-block"><%= t("settings.#{setting.key}") %></h3>
|
||||||
|
<div class="float-right">
|
||||||
|
<%= render "setting", setting: setting %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
<%= form_for [:admin, @card] do |f| %>
|
<%= form_for [:admin, @card] do |f| %>
|
||||||
<%= f.text_field :title %>
|
<%= f.text_field :title %>
|
||||||
<%= f.text_area :description %>
|
|
||||||
<%= f.text_field :link_text %>
|
<%= f.text_area :description, rows: 5 %>
|
||||||
<%= f.text_field :link_url %>
|
|
||||||
<%= f.hidden_field :header, value: @card.header? %>
|
<div class="small-12 medium-6">
|
||||||
<div class="images small-12 column">
|
<%= f.text_field :link_text %>
|
||||||
<%= render 'images/nested_image', imageable: @card, f: f %>
|
|
||||||
</div>
|
</div>
|
||||||
<%= f.submit %>
|
|
||||||
<% end %>
|
<div class="small-12 medium-6">
|
||||||
|
<%= f.text_field :link_url %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= f.hidden_field :header, value: @card.header? %>
|
||||||
|
|
||||||
|
<div class="image-form">
|
||||||
|
<div class="image small-12 column">
|
||||||
|
<%= render 'images/nested_image', imageable: @card, f: f %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= f.submit(t("admin.homepage.#{action_name}.#{@card.header? ? 'submit_header' : 'submit_card'}"), class: "button success") %>
|
||||||
|
<% end %>
|
||||||
|
|||||||
@@ -1,2 +1,9 @@
|
|||||||
Edit
|
<h2>
|
||||||
|
<% if @card.header? %>
|
||||||
|
<%= t("admin.homepage.edit.header_title") %>
|
||||||
|
<% else %>
|
||||||
|
<%= t("admin.homepage.edit.card_title") %>
|
||||||
|
<% end %>
|
||||||
|
</h2>
|
||||||
|
|
||||||
<%= render "form" %>
|
<%= render "form" %>
|
||||||
@@ -1,2 +1,9 @@
|
|||||||
New
|
<h2>
|
||||||
<%= render "form" %>
|
<% if @card.header? %>
|
||||||
|
<%= t("admin.homepage.new.header_title") %>
|
||||||
|
<% else %>
|
||||||
|
<%= t("admin.homepage.new.card_title") %>
|
||||||
|
<% end %>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<%= render "form" %>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<div class="top-bar-title">
|
<div class="top-bar-title">
|
||||||
<h1>
|
<h1>
|
||||||
<%= link_to namespaced_root_path do %>
|
<%= link_to admin_root_path do %>
|
||||||
<%= setting['org_name'] %>
|
<%= setting['org_name'] %>
|
||||||
<br><small><%= namespaced_header_title %></small>
|
<br><small><%= namespaced_header_title %></small>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ ignore_unused:
|
|||||||
- 'admin.settings.index.features.*'
|
- 'admin.settings.index.features.*'
|
||||||
- 'admin.polls.*.submit_button'
|
- 'admin.polls.*.submit_button'
|
||||||
- 'admin.booths.*.submit_button'
|
- 'admin.booths.*.submit_button'
|
||||||
|
- 'admin.homepage.*'
|
||||||
- 'moderation.comments.index.filter*'
|
- 'moderation.comments.index.filter*'
|
||||||
- 'moderation.comments.index.order*'
|
- 'moderation.comments.index.order*'
|
||||||
- 'moderation.debates.index.filter*'
|
- 'moderation.debates.index.filter*'
|
||||||
|
|||||||
@@ -245,6 +245,11 @@ en:
|
|||||||
subject: Subject
|
subject: Subject
|
||||||
from: From
|
from: From
|
||||||
body: Email content
|
body: Email content
|
||||||
|
widget/card:
|
||||||
|
title: Title
|
||||||
|
description: Description
|
||||||
|
link_text: Link text
|
||||||
|
link_url: Link URL
|
||||||
errors:
|
errors:
|
||||||
models:
|
models:
|
||||||
user:
|
user:
|
||||||
|
|||||||
@@ -499,6 +499,7 @@ en:
|
|||||||
stats: Statistics
|
stats: Statistics
|
||||||
signature_sheets: Signature Sheets
|
signature_sheets: Signature Sheets
|
||||||
site_customization:
|
site_customization:
|
||||||
|
homepage: Homepage
|
||||||
pages: Custom Pages
|
pages: Custom Pages
|
||||||
images: Custom Images
|
images: Custom Images
|
||||||
content_blocks: Custom content blocks
|
content_blocks: Custom content blocks
|
||||||
@@ -958,6 +959,8 @@ en:
|
|||||||
actions: Actions
|
actions: Actions
|
||||||
title: Title
|
title: Title
|
||||||
description: Description
|
description: Description
|
||||||
|
image: Image
|
||||||
|
show_image: Show image
|
||||||
spending_proposals:
|
spending_proposals:
|
||||||
index:
|
index:
|
||||||
geozone_filter_all: All zones
|
geozone_filter_all: All zones
|
||||||
@@ -1212,3 +1215,27 @@ en:
|
|||||||
status_draft: Draft
|
status_draft: Draft
|
||||||
status_published: Published
|
status_published: Published
|
||||||
locale: Language
|
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
|
||||||
|
|||||||
@@ -845,3 +845,6 @@ en:
|
|||||||
proposal: "Proposal"
|
proposal: "Proposal"
|
||||||
debate: "Debate"
|
debate: "Debate"
|
||||||
budget_investment: "Budget investment"
|
budget_investment: "Budget investment"
|
||||||
|
admin/widget:
|
||||||
|
header:
|
||||||
|
title: Administration
|
||||||
@@ -241,6 +241,11 @@ es:
|
|||||||
subject: Asunto
|
subject: Asunto
|
||||||
from: Enviado por
|
from: Enviado por
|
||||||
body: Contenido del email
|
body: Contenido del email
|
||||||
|
widget/card:
|
||||||
|
title: Título
|
||||||
|
description: Descripción
|
||||||
|
link_text: Texto del enlace
|
||||||
|
link_url: URL del enlace
|
||||||
errors:
|
errors:
|
||||||
models:
|
models:
|
||||||
user:
|
user:
|
||||||
|
|||||||
@@ -499,6 +499,7 @@ es:
|
|||||||
stats: Estadísticas
|
stats: Estadísticas
|
||||||
signature_sheets: Hojas de firmas
|
signature_sheets: Hojas de firmas
|
||||||
site_customization:
|
site_customization:
|
||||||
|
homepage: Homepage
|
||||||
pages: Personalizar páginas
|
pages: Personalizar páginas
|
||||||
images: Personalizar imágenes
|
images: Personalizar imágenes
|
||||||
content_blocks: Personalizar bloques
|
content_blocks: Personalizar bloques
|
||||||
@@ -958,6 +959,8 @@ es:
|
|||||||
actions: Acciones
|
actions: Acciones
|
||||||
title: Título
|
title: Título
|
||||||
description: Descripción
|
description: Descripción
|
||||||
|
image: Imagen
|
||||||
|
show_image: Mostrar imagen
|
||||||
spending_proposals:
|
spending_proposals:
|
||||||
index:
|
index:
|
||||||
geozone_filter_all: Todos los ámbitos de actuación
|
geozone_filter_all: Todos los ámbitos de actuación
|
||||||
@@ -1212,3 +1215,27 @@ es:
|
|||||||
status_draft: Borrador
|
status_draft: Borrador
|
||||||
status_published: Publicada
|
status_published: Publicada
|
||||||
locale: Idioma
|
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
|
||||||
|
|||||||
@@ -844,3 +844,6 @@ es:
|
|||||||
proposal: "Propuesta"
|
proposal: "Propuesta"
|
||||||
debate: "Debate"
|
debate: "Debate"
|
||||||
budget_investment: "Proyecto de gasto"
|
budget_investment: "Proyecto de gasto"
|
||||||
|
admin/widget:
|
||||||
|
header:
|
||||||
|
title: Administración
|
||||||
Reference in New Issue
Block a user