Merge pull request #4552 from consul/table_icons_with_text
Use icons with text in admin table actions
This commit is contained in:
@@ -74,6 +74,7 @@ $outline-focus: 3px solid #ffbf47 !default;
|
||||
|
||||
$input-height: $line-height * 2 !default;
|
||||
|
||||
$font-icon-margin: rem-calc(4) !default;
|
||||
$icon-width: $line-height * 2 !default;
|
||||
|
||||
$off-screen-left: -1000rem !default;
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
.preview-link {
|
||||
@include has-fa-icon(eye, regular);
|
||||
@include hollow-button;
|
||||
|
||||
&::before {
|
||||
margin-right: $font-icon-margin;
|
||||
}
|
||||
}
|
||||
|
||||
.publish-link {
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
&::after {
|
||||
bottom: $padding / 2;
|
||||
color: $white;
|
||||
margin-right: 0;
|
||||
position: absolute;
|
||||
right: calc(#{$padding} + #{$quote-padding});
|
||||
}
|
||||
|
||||
@@ -6,33 +6,22 @@
|
||||
}
|
||||
|
||||
a {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 0.9em;
|
||||
line-height: $global-lineheight;
|
||||
margin-right: 1em;
|
||||
position: relative;
|
||||
|
||||
> :first-child {
|
||||
@include bottom-tooltip;
|
||||
left: $off-screen-left;
|
||||
opacity: 0;
|
||||
transform: translateX(-50%);
|
||||
transition: opacity 0.3s, left 0s 0.3s;
|
||||
}
|
||||
text-align: center;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $link-hover;
|
||||
|
||||
> :first-child {
|
||||
left: 50%;
|
||||
opacity: 1;
|
||||
transition: opacity 0.4s 0.2s;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(:focus) > :first-child:hover {
|
||||
left: $off-screen-left;
|
||||
}
|
||||
|
||||
&::before {
|
||||
font-size: rem-calc(18);
|
||||
font-size: 1.6em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +31,14 @@
|
||||
|
||||
.destroy-link {
|
||||
@include has-fa-icon(trash-alt, regular);
|
||||
color: $alert-color;
|
||||
}
|
||||
|
||||
.destroy-link,
|
||||
.destroy-role-link,
|
||||
.destroy-officer-link,
|
||||
.reject-link,
|
||||
.confirm-hide-link {
|
||||
color: darken($alert-color, 5%);
|
||||
}
|
||||
|
||||
.show-link,
|
||||
@@ -66,17 +62,23 @@
|
||||
.destroy-officer-link,
|
||||
.reject-link {
|
||||
@include has-fa-icon(user-times, solid);
|
||||
color: $alert-color;
|
||||
}
|
||||
|
||||
.restore-link {
|
||||
@include has-fa-icon(undo, solid);
|
||||
color: $warning-color;
|
||||
}
|
||||
|
||||
.restore-link,
|
||||
.investments-link {
|
||||
color: darken($warning-color, 20%);
|
||||
|
||||
&::before {
|
||||
color: $warning-color;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-hide-link {
|
||||
@include has-fa-icon(flag, regular);
|
||||
color: $alert-color;
|
||||
}
|
||||
|
||||
.verify-link {
|
||||
@@ -108,7 +110,6 @@
|
||||
|
||||
.investments-link {
|
||||
@include has-fa-icon(coins, solid);
|
||||
color: $warning-color;
|
||||
}
|
||||
|
||||
.groups-link,
|
||||
|
||||
@@ -33,10 +33,6 @@
|
||||
position: absolute;
|
||||
right: $close-icon-margin;
|
||||
top: $close-icon-margin;
|
||||
|
||||
&::before {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
&::after {
|
||||
font-size: 2em;
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
transform: translateY(-25%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,9 @@
|
||||
color: $brand-secondary;
|
||||
font-weight: bold;
|
||||
margin-top: $line-height;
|
||||
|
||||
&::before {
|
||||
margin-right: $font-icon-margin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,6 @@
|
||||
&::after {
|
||||
font-weight: bold;
|
||||
margin-left: 0.5em;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1470,6 +1470,7 @@ table {
|
||||
|
||||
&::before {
|
||||
font-size: rem-calc(24);
|
||||
margin-right: $font-icon-margin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1863,6 +1864,7 @@ table {
|
||||
|
||||
.show-children::before,
|
||||
.collapse-children::before {
|
||||
margin-right: $font-icon-margin;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
@@ -1891,6 +1893,7 @@ table {
|
||||
}
|
||||
|
||||
&::before {
|
||||
margin-right: $font-icon-margin;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
}
|
||||
@@ -2456,6 +2459,10 @@ table {
|
||||
@include has-fa-icon(times, solid);
|
||||
color: $color-alert;
|
||||
}
|
||||
|
||||
&::before {
|
||||
margin-right: $font-icon-margin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
%font-icon {
|
||||
@extend %fa-icon;
|
||||
font-family: "Font Awesome 5 Free";
|
||||
margin-right: rem-calc(4);
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
@include has-fa-icon(circle, solid, after);
|
||||
|
||||
&::before {
|
||||
@include breakpoint(medium) {
|
||||
margin-right: 0;
|
||||
@include breakpoint(small only) {
|
||||
margin-right: $font-icon-margin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
color: #ecf00b;
|
||||
font-size: $circle-icon-size;
|
||||
margin-right: 0;
|
||||
position: absolute;
|
||||
left: $notification-icon-size - rem-calc(5);
|
||||
top: $menu-link-top-padding - $circle-icon-size / 2;
|
||||
|
||||
@@ -1215,7 +1215,6 @@
|
||||
|
||||
&::after {
|
||||
margin-left: $line-height / 4;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(phase,
|
||||
actions: [:edit],
|
||||
edit_path: edit_path(phase),
|
||||
edit_text: t("admin.budgets.edit.edit_phase")
|
||||
edit_path: edit_path(phase)
|
||||
) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<%= render Admin::TableActionsComponent.new(budget,
|
||||
edit_text: t("admin.budgets.index.edit_budget"),
|
||||
destroy_confirmation: t("admin.actions.confirm_delete", resource_name: t("admin.budgets.shared.resource_name"),
|
||||
name: budget.name)
|
||||
) do %>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Budgets::TableActionsComponent < ApplicationComponent
|
||||
include TableActionLink
|
||||
attr_reader :budget
|
||||
|
||||
def initialize(budget)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::HiddenTableActionsComponent < ApplicationComponent
|
||||
include TableActionLink
|
||||
attr_reader :record
|
||||
|
||||
def initialize(record)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Organizations::TableActionsComponent < ApplicationComponent
|
||||
include TableActionLink
|
||||
delegate :can?, to: :controller
|
||||
attr_reader :organization
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::Roles::TableActionsComponent < ApplicationComponent
|
||||
include TableActionLink
|
||||
attr_reader :record, :actions
|
||||
|
||||
def initialize(record, actions: [:destroy])
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::TableActionsComponent < ApplicationComponent
|
||||
include TableActionLink
|
||||
include Admin::Namespace
|
||||
attr_reader :record, :options
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
module TableActionLink
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def link_to(text, url, **options)
|
||||
super(tag.span(text), url, options)
|
||||
end
|
||||
end
|
||||
@@ -20,12 +20,7 @@
|
||||
<tr>
|
||||
<td><%= banner.post_started_at %></td>
|
||||
<td><%= banner.post_ended_at %></td>
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(banner,
|
||||
edit_text: t("admin.banners.index.edit"),
|
||||
destroy_text: t("admin.banners.index.delete")
|
||||
) %>
|
||||
</td>
|
||||
<td><%= render Admin::TableActionsComponent.new(banner) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
|
||||
@@ -53,11 +53,7 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(milestone,
|
||||
destroy_text: t("admin.milestones.index.delete")
|
||||
) %>
|
||||
</td>
|
||||
<td><%= render Admin::TableActionsComponent.new(milestone) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(
|
||||
actions: [:edit],
|
||||
edit_path: edit_admin_official_path(official),
|
||||
edit_text: t("admin.officials.search.edit_official")
|
||||
edit_path: edit_admin_official_path(official)
|
||||
) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<%= render Admin::TableActionsComponent.new(
|
||||
actions: [:edit],
|
||||
edit_path: edit_admin_official_path(user),
|
||||
edit_text: user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official")
|
||||
edit_text: (t("admin.officials.search.make_official") unless user.official?)
|
||||
) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -13,10 +13,7 @@
|
||||
class: "shifts-link" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render Admin::TableActionsComponent.new(booth,
|
||||
actions: [:edit],
|
||||
edit_text: t("admin.booths.booth.edit")
|
||||
) %>
|
||||
<%= render Admin::TableActionsComponent.new(booth, actions: [:edit]) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -34,10 +34,7 @@
|
||||
<td><%= link_to "#{content_block.name} (#{content_block.locale})", edit_admin_site_customization_content_block_path(content_block) %></td>
|
||||
<td><%= raw content_block.body %></td>
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(content_block,
|
||||
actions: [:destroy],
|
||||
destroy_text: t("admin.site_customization.content_blocks.index.delete")
|
||||
) %>
|
||||
<%= render Admin::TableActionsComponent.new(content_block, actions: [:destroy]) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -48,7 +45,6 @@
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(
|
||||
actions: [:destroy],
|
||||
destroy_text: t("admin.site_customization.content_blocks.index.delete"),
|
||||
destroy_path: admin_site_customization_delete_heading_content_block_path(content_block)
|
||||
) %>
|
||||
</td>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<% end %>
|
||||
</td>
|
||||
<td id="tag_<%= tag.id %>">
|
||||
<%= render Admin::TableActionsComponent.new(tag, actions: [:destroy], destroy_text: t("admin.tags.destroy")) %>
|
||||
<%= render Admin::TableActionsComponent.new(tag, actions: [:destroy]) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -21,8 +21,6 @@ en:
|
||||
index:
|
||||
title: Banners
|
||||
create: Create banner
|
||||
edit: Edit banner
|
||||
delete: Delete banner
|
||||
filters:
|
||||
all: All
|
||||
with_active: Active
|
||||
@@ -69,7 +67,7 @@ en:
|
||||
no_activity: There are no moderators activity.
|
||||
budgets:
|
||||
actions:
|
||||
preview: "Preview budget"
|
||||
preview: "Preview"
|
||||
index:
|
||||
title: Participatory budgets
|
||||
new_link: Create new budget
|
||||
@@ -78,7 +76,7 @@ en:
|
||||
all: All
|
||||
open: Open
|
||||
finished: Finished
|
||||
budget_investments: Manage projects
|
||||
budget_investments: Investment projects
|
||||
table_budget_type: "Type"
|
||||
table_completed: Completed
|
||||
table_draft: "Draft"
|
||||
@@ -89,9 +87,8 @@ en:
|
||||
type_multiple: "Multiple headings"
|
||||
type_pending: "Pending: No headings yet"
|
||||
type_single: "Single heading"
|
||||
edit_groups: Edit headings groups
|
||||
edit_budget: Edit budget
|
||||
admin_ballots: Admin ballots
|
||||
edit_groups: Heading groups
|
||||
admin_ballots: Ballots
|
||||
no_budgets: "There are no budgets."
|
||||
create:
|
||||
notice: New participatory budget created successfully!
|
||||
@@ -109,7 +106,6 @@ en:
|
||||
duration: "Duration"
|
||||
enabled: Enabled
|
||||
actions: Actions
|
||||
edit_phase: Edit phase
|
||||
enable_phase: "Enable %{phase} phase"
|
||||
active: Active
|
||||
blank_dates: Dates are blank
|
||||
@@ -156,7 +152,7 @@ en:
|
||||
budget_groups:
|
||||
name: "Name"
|
||||
headings_name: "Headings"
|
||||
headings_manage: "Manage headings"
|
||||
headings_manage: "Headings"
|
||||
no_groups: "There are no groups."
|
||||
amount:
|
||||
one: "There is 1 group"
|
||||
@@ -354,7 +350,6 @@ en:
|
||||
table_publication_date: "Publication date"
|
||||
table_status: Status
|
||||
table_actions: "Actions"
|
||||
delete: "Delete milestone"
|
||||
no_milestones: "Don't have defined milestones"
|
||||
image: "Image"
|
||||
show_image: "Show image"
|
||||
@@ -1207,7 +1202,6 @@ en:
|
||||
location: "Location"
|
||||
booth:
|
||||
shifts: "Manage shifts"
|
||||
edit: "Edit booth"
|
||||
officials:
|
||||
edit:
|
||||
destroy: Remove "Official" status
|
||||
@@ -1229,7 +1223,6 @@ en:
|
||||
level_4: Level 4
|
||||
level_5: Level 5
|
||||
search:
|
||||
edit_official: Edit official
|
||||
make_official: Make official
|
||||
title: "Official positions: User search"
|
||||
no_results: Official positions not found.
|
||||
@@ -1513,7 +1506,6 @@ en:
|
||||
title: "Sustainable Development Goals - Stats"
|
||||
tags:
|
||||
create: Create topic
|
||||
destroy: Delete topic
|
||||
index:
|
||||
add_tag: Add a new proposal topic
|
||||
title: Proposal topics
|
||||
@@ -1601,7 +1593,7 @@ en:
|
||||
create: Create new page
|
||||
delete: Delete page
|
||||
title: Custom Pages
|
||||
see_page: See page
|
||||
see_page: View
|
||||
new:
|
||||
title: Create new custom page
|
||||
slug_help: "Text to identify this page on URL, for example <code>https://consulproject.org/page-slug</code>"
|
||||
@@ -1611,7 +1603,7 @@ en:
|
||||
updated_at: Updated at
|
||||
title: Title
|
||||
slug: Slug
|
||||
see_cards: See Cards
|
||||
see_cards: Manage cards
|
||||
cards:
|
||||
cards_title: cards
|
||||
create_card: Create card
|
||||
|
||||
@@ -21,8 +21,6 @@ es:
|
||||
index:
|
||||
title: Banners
|
||||
create: Crear un banner
|
||||
edit: Editar banner
|
||||
delete: Eliminar banner
|
||||
filters:
|
||||
all: Todos
|
||||
with_active: Activos
|
||||
@@ -69,7 +67,7 @@ es:
|
||||
no_activity: No hay actividad de moderadores.
|
||||
budgets:
|
||||
actions:
|
||||
preview: "Previsualizar presupuesto"
|
||||
preview: "Previsualizar"
|
||||
index:
|
||||
title: Presupuestos participativos
|
||||
new_link: Crear nuevo presupuesto
|
||||
@@ -78,7 +76,7 @@ es:
|
||||
all: Todos
|
||||
open: Abiertos
|
||||
finished: Terminados
|
||||
budget_investments: Gestionar proyectos de gasto
|
||||
budget_investments: Proyectos de gasto
|
||||
table_budget_type: "Tipo"
|
||||
table_completed: Completado
|
||||
table_draft: "Borrador"
|
||||
@@ -89,9 +87,8 @@ es:
|
||||
type_multiple: "Múltiples partidas"
|
||||
type_pending: "Pendiente: Aún no hay partidas"
|
||||
type_single: "Partida única"
|
||||
edit_groups: Editar grupos de partidas
|
||||
edit_budget: Editar presupuesto
|
||||
admin_ballots: Gestionar urnas
|
||||
edit_groups: Grupos de partidas
|
||||
admin_ballots: Urnas
|
||||
no_budgets: "No hay presupuestos participativos."
|
||||
create:
|
||||
notice: '¡Presupuestos participativos creados con éxito!'
|
||||
@@ -109,7 +106,6 @@ es:
|
||||
duration: "Duración"
|
||||
enabled: Habilitada
|
||||
actions: Acciones
|
||||
edit_phase: Editar fase
|
||||
enable_phase: "Habilitar fase de %{phase}"
|
||||
active: Activa
|
||||
blank_dates: Sin fechas
|
||||
@@ -156,7 +152,7 @@ es:
|
||||
budget_groups:
|
||||
name: "Nombre"
|
||||
headings_name: "Partidas"
|
||||
headings_manage: "Gestionar partidas"
|
||||
headings_manage: "Partidas"
|
||||
no_groups: "No hay grupos."
|
||||
amount:
|
||||
one: "Hay 1 grupo de partidas presupuestarias"
|
||||
@@ -354,7 +350,6 @@ es:
|
||||
table_publication_date: "Fecha de publicación"
|
||||
table_status: Estado
|
||||
table_actions: "Acciones"
|
||||
delete: "Eliminar hito"
|
||||
no_milestones: "No hay hitos definidos"
|
||||
image: "Imagen"
|
||||
show_image: "Mostrar imagen"
|
||||
@@ -1206,7 +1201,6 @@ es:
|
||||
location: "Ubicación"
|
||||
booth:
|
||||
shifts: "Asignar turnos"
|
||||
edit: "Editar urna"
|
||||
officials:
|
||||
edit:
|
||||
destroy: Eliminar condición de 'Cargo Público'
|
||||
@@ -1228,7 +1222,6 @@ es:
|
||||
level_4: Nivel 4
|
||||
level_5: Nivel 5
|
||||
search:
|
||||
edit_official: Editar cargo público
|
||||
make_official: Convertir en cargo público
|
||||
title: "Cargos Públicos: Búsqueda de usuarios"
|
||||
no_results: No se han encontrado cargos públicos.
|
||||
@@ -1512,7 +1505,6 @@ es:
|
||||
title: "Objetivos de Desarrollo Sostenible - Estadísticas"
|
||||
tags:
|
||||
create: Crear tema
|
||||
destroy: Eliminar tema
|
||||
index:
|
||||
add_tag: Añade un nuevo tema de propuesta
|
||||
title: Temas de propuesta
|
||||
@@ -1600,7 +1592,7 @@ es:
|
||||
create: Crear nueva página
|
||||
delete: Borrar página
|
||||
title: Páginas
|
||||
see_page: Ver página
|
||||
see_page: Ver
|
||||
new:
|
||||
title: Página nueva
|
||||
slug_help: "Texto que identifica esta página en la URL, por ejemplo <code>https://consulproject.org/slug-de-pagina</code>"
|
||||
@@ -1610,7 +1602,7 @@ es:
|
||||
updated_at: Última actualización
|
||||
title: Título
|
||||
slug: Slug
|
||||
see_cards: Ver tarjetas
|
||||
see_cards: Tarjetas
|
||||
cards:
|
||||
cards_title: tarjetas
|
||||
create_card: Crear tarjeta
|
||||
|
||||
@@ -12,18 +12,18 @@ describe Admin::Budgets::TableActionsComponent, type: :component do
|
||||
render_inline component
|
||||
|
||||
expect(page).to have_css "a", count: 6
|
||||
expect(page).to have_link "Manage projects", href: /investments/
|
||||
expect(page).to have_link "Edit headings groups", href: /groups/
|
||||
expect(page).to have_link "Edit budget", href: /edit/
|
||||
expect(page).to have_link "Admin ballots"
|
||||
expect(page).to have_link "Preview budget", href: /budgets/
|
||||
expect(page).to have_link "Investment projects", href: /investments/
|
||||
expect(page).to have_link "Heading groups", href: /groups/
|
||||
expect(page).to have_link "Edit", href: /edit/
|
||||
expect(page).to have_link "Ballots"
|
||||
expect(page).to have_link "Preview", href: /budgets/
|
||||
expect(page).to have_link "Delete", href: /budgets/
|
||||
end
|
||||
|
||||
it "renders link to create new poll for budgets without polls" do
|
||||
render_inline component
|
||||
|
||||
expect(page).to have_css "a[href*='polls'][data-method='post']", text: "Admin ballots"
|
||||
expect(page).to have_css "a[href*='polls'][data-method='post']", text: "Ballots"
|
||||
end
|
||||
|
||||
it "renders link to manage ballots for budgets with polls" do
|
||||
@@ -31,6 +31,6 @@ describe Admin::Budgets::TableActionsComponent, type: :component do
|
||||
|
||||
render_inline component
|
||||
|
||||
expect(page).to have_link "Admin ballots", href: /booth_assignments/
|
||||
expect(page).to have_link "Ballots", href: /booth_assignments/
|
||||
end
|
||||
end
|
||||
|
||||
@@ -108,12 +108,12 @@ shared_examples "admin_milestoneable" do |factory_name, path_name|
|
||||
end
|
||||
|
||||
context "Delete" do
|
||||
scenario "Remove milestone", :no_js do
|
||||
scenario "Remove milestone" do
|
||||
create(:milestone, milestoneable: milestoneable, title: "Title will it remove")
|
||||
|
||||
visit path
|
||||
|
||||
click_link "Delete milestone"
|
||||
accept_confirm { click_link "Delete" }
|
||||
|
||||
expect(page).not_to have_content "Title will it remove"
|
||||
end
|
||||
|
||||
@@ -104,7 +104,7 @@ describe "Admin banners magement", :admin do
|
||||
fill_in "Post ended at", with: Date.current + 1.week
|
||||
|
||||
click_button "Save changes"
|
||||
click_link "Edit banner"
|
||||
click_link "Edit"
|
||||
|
||||
expect_to_have_language_selected "Français"
|
||||
expect(page).to have_field "Title", with: "En Français"
|
||||
@@ -137,7 +137,7 @@ describe "Admin banners magement", :admin do
|
||||
click_link "Manage banners"
|
||||
end
|
||||
|
||||
click_link "Edit banner"
|
||||
click_link "Edit"
|
||||
|
||||
fill_in "Title", with: "Modified title"
|
||||
fill_in "Description", with: "Edited text"
|
||||
@@ -173,7 +173,7 @@ describe "Admin banners magement", :admin do
|
||||
|
||||
expect(page).to have_content "Ugly banner"
|
||||
|
||||
accept_confirm { click_link "Delete banner" }
|
||||
accept_confirm { click_link "Delete" }
|
||||
|
||||
visit admin_root_path
|
||||
expect(page).not_to have_content "Ugly banner"
|
||||
|
||||
@@ -37,21 +37,21 @@ describe "Admin budget groups", :admin do
|
||||
expect(page).to have_content(group1.name)
|
||||
expect(page).to have_content(group1.max_votable_headings)
|
||||
expect(page).to have_content(group1.headings.count)
|
||||
expect(page).to have_link "Manage headings"
|
||||
expect(page).to have_link "Headings"
|
||||
end
|
||||
|
||||
within "#budget_group_#{group2.id}" do
|
||||
expect(page).to have_content(group2.name)
|
||||
expect(page).to have_content(group2.max_votable_headings)
|
||||
expect(page).to have_content(group2.headings.count)
|
||||
expect(page).to have_link "Manage headings"
|
||||
expect(page).to have_link "Headings"
|
||||
end
|
||||
|
||||
within "#budget_group_#{group3.id}" do
|
||||
expect(page).to have_content(group3.name)
|
||||
expect(page).to have_content(group3.max_votable_headings)
|
||||
expect(page).to have_content(group3.headings.count)
|
||||
expect(page).to have_link "Manage headings"
|
||||
expect(page).to have_link "Headings"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ describe "Admin budget phases" do
|
||||
expect(page).to have_content "Accepting projects"
|
||||
expect(page).not_to have_content "My phase custom name"
|
||||
|
||||
within("tr", text: "Accepting projects") { click_link "Edit phase" }
|
||||
within("tr", text: "Accepting projects") { click_link "Edit" }
|
||||
end
|
||||
|
||||
expect(page).to have_css "h2", exact_text: "Edit phase - Accepting projects"
|
||||
|
||||
@@ -116,7 +116,7 @@ describe "Admin budgets", :admin do
|
||||
scenario "Can preview budget before it is published" do
|
||||
visit edit_admin_budget_path(budget)
|
||||
|
||||
within_window(window_opened_by { click_link "Preview budget" }) do
|
||||
within_window(window_opened_by { click_link "Preview" }) do
|
||||
expect(page).to have_current_path budget_path(budget)
|
||||
end
|
||||
end
|
||||
@@ -130,7 +130,7 @@ describe "Admin budgets", :admin do
|
||||
expect(page).not_to have_content "This participatory budget is in draft mode"
|
||||
expect(page).not_to have_link "Publish budget"
|
||||
|
||||
within_window(window_opened_by { click_link "Preview budget" }) do
|
||||
within_window(window_opened_by { click_link "Preview" }) do
|
||||
expect(page).to have_current_path budget_path(budget)
|
||||
end
|
||||
end
|
||||
@@ -227,7 +227,7 @@ describe "Admin budgets", :admin do
|
||||
|
||||
within_table "Phases" do
|
||||
within "tr", text: "Information" do
|
||||
expect(page).to have_link "Edit phase"
|
||||
expect(page).to have_link "Edit"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -88,10 +88,10 @@ describe "Budgets wizard, first step", :admin do
|
||||
expect(page).to have_content "New participatory budget created successfully!"
|
||||
|
||||
within("#side_menu") { click_link "Participatory budgets" }
|
||||
within("tr", text: "M30 - Summer campaign") { click_link "Edit budget" }
|
||||
within("tr", text: "M30 - Summer campaign") { click_link "Edit" }
|
||||
|
||||
expect(page).to have_content "This participatory budget is in draft mode"
|
||||
expect(page).to have_link "Preview budget"
|
||||
expect(page).to have_link "Preview"
|
||||
expect(page).to have_link "Publish budget"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -56,7 +56,7 @@ describe "Budgets wizard, phases step", :admin do
|
||||
|
||||
expect(page).to have_css ".creation-timeline"
|
||||
|
||||
within("tr", text: "Selecting projects") { click_link "Edit phase" }
|
||||
within("tr", text: "Selecting projects") { click_link "Edit" }
|
||||
fill_in "Name", with: "Choosing projects"
|
||||
click_button "Save changes"
|
||||
|
||||
@@ -86,7 +86,7 @@ describe "Budgets wizard, phases step", :admin do
|
||||
scenario "update phase in single heading budget" do
|
||||
visit admin_budgets_wizard_budget_budget_phases_path(budget, mode: "single")
|
||||
|
||||
within("tr", text: "Selecting projects") { click_link "Edit phase" }
|
||||
within("tr", text: "Selecting projects") { click_link "Edit" }
|
||||
fill_in "Name", with: "Choosing projects"
|
||||
click_button "Save changes"
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@ describe "Budgets creation wizard", :admin do
|
||||
expect(page).to have_content "Phases configured successfully"
|
||||
|
||||
within "tr", text: "Single heading budget" do
|
||||
click_link "Edit headings groups"
|
||||
click_link "Heading groups"
|
||||
end
|
||||
|
||||
expect(page).to have_content "There is 1 group"
|
||||
|
||||
within "tr", text: "Single heading budget" do
|
||||
click_link "Manage headings"
|
||||
click_link "Headings"
|
||||
end
|
||||
|
||||
expect(page).to have_content "There is 1 heading"
|
||||
@@ -107,7 +107,7 @@ describe "Budgets creation wizard", :admin do
|
||||
|
||||
expect(page).to have_css ".budget-phases-table"
|
||||
|
||||
within("tr", text: "Voting projects") { click_link "Edit phase" }
|
||||
within("tr", text: "Voting projects") { click_link "Edit" }
|
||||
fill_in "Name", with: "Custom phase name"
|
||||
uncheck "Phase enabled"
|
||||
click_button "Save changes"
|
||||
@@ -124,7 +124,7 @@ describe "Budgets creation wizard", :admin do
|
||||
expect(page).to have_content "Phases configured successfully"
|
||||
|
||||
within "tr", text: "Multiple headings budget" do
|
||||
click_link "Edit headings groups"
|
||||
click_link "Heading groups"
|
||||
end
|
||||
|
||||
expect(page).to have_content "There are 2 groups"
|
||||
@@ -135,7 +135,7 @@ describe "Budgets creation wizard", :admin do
|
||||
end
|
||||
|
||||
within "tr", text: "Districts" do
|
||||
click_link "Manage headings"
|
||||
click_link "Headings"
|
||||
end
|
||||
|
||||
expect(page).to have_content "There are 2 headings"
|
||||
|
||||
@@ -15,7 +15,7 @@ describe "Admin officials", :admin do
|
||||
|
||||
scenario "Edit an official" do
|
||||
visit admin_officials_path
|
||||
click_link "Edit official"
|
||||
click_link "Edit"
|
||||
|
||||
expect(page).to have_current_path(edit_admin_official_path(official))
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ describe "Admin booths", :admin do
|
||||
|
||||
expect(page).to have_content booth_for_current_poll.name
|
||||
expect(page).not_to have_content booth_for_expired_poll.name
|
||||
expect(page).not_to have_link "Edit booth"
|
||||
expect(page).not_to have_link "Edit"
|
||||
end
|
||||
|
||||
scenario "Show" do
|
||||
@@ -82,7 +82,7 @@ describe "Admin booths", :admin do
|
||||
|
||||
within("#booth_#{booth.id}") do
|
||||
expect(page).not_to have_link "Manage shifts"
|
||||
click_link "Edit booth"
|
||||
click_link "Edit"
|
||||
end
|
||||
|
||||
fill_in "poll_booth_name", with: "Next booth"
|
||||
|
||||
@@ -91,7 +91,7 @@ describe "Admin custom content blocks", :admin do
|
||||
expect(page).to have_content("#{block.name} (#{block.locale})")
|
||||
expect(page).to have_content(block.body)
|
||||
|
||||
accept_confirm { click_link "Delete block" }
|
||||
accept_confirm { click_link "Delete" }
|
||||
|
||||
expect(page).not_to have_content("#{block.name} (#{block.locale})")
|
||||
expect(page).not_to have_content(block.body)
|
||||
|
||||
@@ -39,7 +39,7 @@ describe "Admin tags", :admin do
|
||||
expect(page).to have_content "bad tag"
|
||||
|
||||
within("#tag_#{tag2.id}") do
|
||||
accept_confirm { click_link "Delete topic" }
|
||||
accept_confirm { click_link "Delete" }
|
||||
end
|
||||
|
||||
expect(page).not_to have_content "bad tag"
|
||||
@@ -57,7 +57,7 @@ describe "Admin tags", :admin do
|
||||
expect(page).to have_content "bad tag"
|
||||
|
||||
within("#tag_#{tag2.id}") do
|
||||
accept_confirm { click_link "Delete topic" }
|
||||
accept_confirm { click_link "Delete" }
|
||||
end
|
||||
|
||||
expect(page).not_to have_content "bad tag"
|
||||
|
||||
@@ -163,7 +163,7 @@ describe "Cards", :admin do
|
||||
visit admin_site_customization_pages_path
|
||||
|
||||
within "#site_customization_page_#{custom_page.id}" do
|
||||
click_link "See Cards"
|
||||
click_link "Manage cards"
|
||||
end
|
||||
|
||||
click_link "Create card"
|
||||
|
||||
@@ -8,7 +8,7 @@ describe "Admin Budgets", :admin do
|
||||
|
||||
visit admin_budgets_path
|
||||
|
||||
click_link "Admin ballots"
|
||||
click_link "Ballots"
|
||||
|
||||
expect(page).to have_current_path(/admin\/polls\/\d+/)
|
||||
expect(page).to have_content(budget.name)
|
||||
@@ -37,7 +37,7 @@ describe "Admin Budgets", :admin do
|
||||
visit admin_budgets_path
|
||||
|
||||
within "#budget_#{budget.id}" do
|
||||
expect(page).to have_link "Admin ballots", href: admin_poll_booth_assignments_path(poll)
|
||||
expect(page).to have_link "Ballots", href: admin_poll_booth_assignments_path(poll)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user