Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help texs, links and new message section to improve UX #3573

Merged
merged 7 commits into from
Jun 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/stylesheets/legislation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}

.legislation-calendar {
background: #e5ecf2;
background: $highlight;
padding-top: 1rem;

h4 {
Expand Down
26 changes: 25 additions & 1 deletion app/assets/stylesheets/legislation_process.scss
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
}

.quiz-title {
background: #e5ecf2;
background: $highlight;

.quiz-header-title {
font-size: $small-font-size;
Expand Down Expand Up @@ -982,3 +982,27 @@
margin-top: 0;
}
}

.process-proposal {
margin-bottom: $line-height;

.header {
background: $highlight;
padding: $line-height;

@include breakpoint(medium) {
height: $line-height * 4;
}
}

.process-title {
font-size: $small-font-size;
margin-bottom: 0;
text-transform: uppercase;
}

.process-link {
font-size: rem-calc(19);
font-weight: bold;
}
}
12 changes: 8 additions & 4 deletions app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class DashboardController < Dashboard::BaseController
helper_method :dashboard_action, :active_resources, :course
before_action :set_done_and_pending_actions, only: [:recommended_actions, :progress]
before_action :authorize_dashboard, only: [:show, :progress, :community, :recommended_actions, :messages]

def show
authorize! :dashboard, proposal
end

def publish
Expand All @@ -14,15 +14,15 @@ def publish
end

def progress
authorize! :dashboard, proposal
end

def community
authorize! :dashboard, proposal
end

def recommended_actions
authorize! :dashboard, proposal
end

def messages
end

private
Expand All @@ -42,4 +42,8 @@ def set_done_and_pending_actions
@done_actions = proposed_actions.joins(:proposals).where("proposals.id = ?", proposal.id)
@pending_actions = proposed_actions - @done_actions
end

def authorize_dashboard
authorize! :dashboard, proposal
end
end
4 changes: 4 additions & 0 deletions app/helpers/proposals_dashboard_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def community_menu_active?
controller_name == "dashboard" && action_name == "community"
end

def messages_menu_active?
controller_name == "dashboard" && action_name == "messages"
end

def progress_menu_active?
is_proposed_action_request? || (controller_name == "dashboard" && action_name == "progress")
end
Expand Down
11 changes: 9 additions & 2 deletions app/views/comments/_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@

<% end %>

&nbsp;&bull;&nbsp;<span><%= l comment.created_at.to_datetime, format: :datetime %></span>
&nbsp;&bull;&nbsp;
<span>
<%= link_to comment_path(comment) do %>
<%= l comment.created_at.to_datetime, format: :datetime %>
<% end %>
</span>
</div>

<div class="comment-user
Expand All @@ -81,7 +86,9 @@
<%= link_to "", class: "js-toggle-children relative", data: {"id": "#{dom_id(comment)}"} do %>
<span class="show-for-sr js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
<span class="show-for-sr js-child-toggle"><%= t("shared.hide") %></span>
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %>
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span>
<span class="js-child-toggle" style="display: none;"><%= t("comments.comment.responses_show", count: comment.children.size) %></span>
<span class="js-child-toggle"><%= t("comments.comment.responses_collapse", count: comment.children.size) %></span>
<% end %>
<% else %>
<%= t("comments.comment.responses", count: 0) %>
Expand Down
8 changes: 0 additions & 8 deletions app/views/communities/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
</div>

<aside class="small-12 medium-3 column hide-for-small-only">
<% if @community.proposal.present? %>
<div class="sidebar-divider"></div>
<h2><%= t("communities.show.author") %></h2>
<%= link_to t("communities.show.send_notification"),
new_proposal_notification_path(proposal_id: @community.proposal.id),
class: "button expanded hollow" %>
<% end %>

<div class="sidebar-divider"></div>
<h2><%= t("community.show.sidebar.participate") %></h2>
<%= link_to t("community.show.sidebar.new_topic"),
Expand Down
27 changes: 17 additions & 10 deletions app/views/dashboard/_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
<ul class="no-bullet resources">
<% if can?(:manage_polls, proposal) %>
<li>
<%= link_to proposal_dashboard_polls_path(proposal.to_param),
class: "#{'submenu-active' if polls_menu_active?}" do %>
<span data-tooltip title="<%= Setting['proposals.poll_short_title'] ||
<%= link_to proposal_dashboard_polls_path(proposal),
class: "#{"submenu-active" if polls_menu_active?}" do %>
<span data-tooltip title="<%= Setting["proposals.poll_short_title"] ||
t("dashboard.menu.polls") %>">
<%= t("dashboard.menu.polls") %>
</span>
Expand All @@ -47,9 +47,9 @@

<% if can?(:manage_mailing, proposal) %>
<li>
<%= link_to new_proposal_dashboard_mailing_path(proposal.to_param),
class: "#{'submenu-active' if mailing_menu_active?}" do %>
<span data-tooltip title="<%= Setting['proposals.email_short_title'] ||
<%= link_to new_proposal_dashboard_mailing_path(proposal),
class: "#{"submenu-active" if mailing_menu_active?}" do %>
<span data-tooltip title="<%= Setting["proposals.email_short_title"] ||
t("dashboard.menu.mailing") %>">
<%= t("dashboard.menu.mailing") %>
</span>
Expand All @@ -59,9 +59,9 @@

<% if can?(:manage_poster, proposal) %>
<li>
<%= link_to new_proposal_dashboard_poster_path(proposal.to_param),
class: "#{'submenu-active' if poster_menu_active?}" do %>
<span data-tooltip title="<%= Setting['proposals.poster_short_title'] ||
<%= link_to new_proposal_dashboard_poster_path(proposal),
class: "#{"submenu-active" if poster_menu_active?}" do %>
<span data-tooltip title="<%= Setting["proposals.poster_short_title"] ||
t("dashboard.menu.poster") %>">
<%= t("dashboard.menu.poster") %>
</span>
Expand All @@ -85,8 +85,15 @@

<li class="section-title <%= 'is-active' if community_menu_active? %>">
<span class="icon-organizations"></span>
<%= link_to community_proposal_dashboard_path(proposal.to_param) do %>
<%= link_to community_proposal_dashboard_path(proposal) do %>
<strong><%= t("dashboard.menu.community") %></strong>
<% end %>
</li>

<li class="section-title <%= "is-active" if messages_menu_active? %>">
<span class="icon-letter"></span>
<%= link_to messages_proposal_dashboard_path(proposal) do %>
<strong><%= t("dashboard.menu.messages") %></strong>
<% end %>
</li>
</ul>
7 changes: 7 additions & 0 deletions app/views/dashboard/messages.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :action_title, t("dashboard.menu.messages") %>

<%= link_to t("dashboard.messages.send_notification"),
new_proposal_notification_path(proposal_id: proposal.id), class: "button" %>

<%= link_to t("dashboard.messages.previous_notifications"),
proposal_path(proposal, anchor: "tab-notifications"), class: "button hollow" %>
11 changes: 11 additions & 0 deletions app/views/legislation/proposals/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
<%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %>
<% end %>

<div class="row process-proposal">
<div class="small-12 column">
<div class="header">
<p class="process-title">
<strong><%= t("legislation.proposals.process_title") %></strong>
</p>
<%= link_to @process.title, @process, class: "process-link" %>
</div>
</div>
</div>

<% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @legislation_proposal_votes] do %>
<div class="proposal-show legislation-proposal-show">
<div id="<%= dom_id(@proposal) %>" class="row">
Expand Down
14 changes: 12 additions & 2 deletions config/locales/en/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ en:
one: 1 response
other: "%{count} responses"
zero: No responses
responses_show:
one: "1 response (show)"
other: "%{count} responses (show)"
zero: No responses
responses_collapse:
one: "1 response (collapse)"
other: "%{count} responses (collapse)"
zero: No responses
user_deleted: User deleted
votes:
one: 1 vote
Expand Down Expand Up @@ -475,6 +483,7 @@ en:
mailing: E-mail
poster: Poster
recommended_actions: Recommended actions
messages: Message to users
form:
request: Request
create_request:
Expand Down Expand Up @@ -536,6 +545,9 @@ en:
debates: Debates
comments: Comments
latest_comments: Latest messages
messages:
send_notification: Send message to proposal supporters
previous_notifications: See previous notifications
polls:
index:
title: Polls
Expand Down Expand Up @@ -1011,8 +1023,6 @@ en:
url_placeholder: Link address
communities:
show:
send_notification: Send message to the community
author: Author
surveys: Surveys
complete_survey: Complete the survey
subnav:
Expand Down
1 change: 1 addition & 0 deletions config/locales/en/legislation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ en:
form:
tags_label: "Categories"
not_verified: "For vote proposals %{verify_account}."
process_title: Collaborative legislation process
6 changes: 3 additions & 3 deletions config/locales/en/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ en:
poll_link: Additional information link
poll_link_description: Añade un enlace de información adicional a la funcionalidad de encuestas del panel de control
email_short_title: Email
email_short_title_description: Short description of the email feature. Allows users to send an email to promote their proposal
email_short_title_description: 'Short description of the email feature. Allows users to send an email to promote their proposal. You can find all the content of this email in "/app/views/dashboard/mailer/forward.html.erb"'
email_description: Email description
email_description_description: Detailed description of the email feature
poster_short_title: Poster
poster_short_title_description: Short description of the poster feature. Allows users to download a poster on PDF format to promote their proposal
poster_short_title_description: 'Short description of the poster feature. Allows users to download a poster on PDF format to promote their proposal. You can find all the content of this poster in "/app/views/dashboard/poster/index.pdf.erb"'
poster_description: Poster description
poster_description_description: Detailed description of the poster feature
analytics_url: "Analytics URL"
Expand Down Expand Up @@ -137,7 +137,7 @@ en:
polls_description: "Citizens' polls are a participatory mechanism by which citizens with voting rights can make direct decisions"
budgets: "Participatory budgeting"
budgets_description: "With participatory budgets, citizens decide which projects presented by their neighbours will receive a part of the budget"
legislation: "Legislation"
legislation: "Collaborative Legislation"
legislation_description: "In participatory processes, citizens are offered the opportunity to participate in the drafting and modification of regulations that affect the society and to give their opinion on certain actions that are planned to be carried out"
html:
per_page_code_head: "Code to be included on every page (<head>)"
Expand Down
18 changes: 14 additions & 4 deletions config/locales/es/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,16 @@ es:
moderator: Moderador
responses:
zero: Sin respuestas
one: 1 Respuesta
other: "%{count} Respuestas"
one: 1 respuesta
other: "%{count} respuestas"
responses_show:
one: "1 respuesta (mostrar)"
other: "%{count} respuestas (mostrar)"
zero: Sin respuestas
responses_collapse:
one: "1 respuesta (colapsar)"
other: "%{count} respuestas (colapsar)"
zero: Sin respuestas
user_deleted: Usuario eliminado
votes:
zero: Sin votos
Expand Down Expand Up @@ -475,6 +483,7 @@ es:
mailing: Correo electrónico
poster: Póster
recommended_actions: Acciones recomendadas
messages: Mensajes a usuarios
form:
request: Solicitar
create_request:
Expand Down Expand Up @@ -536,6 +545,9 @@ es:
debates: Debates
comments: Comentarios
latest_comments: Últimos mensajes
messages:
send_notification: Enviar mensaje a los que han apoyado la propuesta
previous_notifications: Ver notificaciones anteriores
polls:
index:
title: Encuestas
Expand Down Expand Up @@ -1011,8 +1023,6 @@ es:
url_placeholder: Dirección del enlace
communities:
show:
send_notification: Enviar mensaje a la Comunidad
author: Autor
surveys: Encuestas
complete_survey: Completa la encuesta
subnav:
Expand Down
1 change: 1 addition & 0 deletions config/locales/es/legislation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ es:
form:
tags_label: "Categorías"
not_verified: "Para votar propuestas %{verify_account}."
process_title: Proceso de legislación colaborativa
6 changes: 3 additions & 3 deletions config/locales/es/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ es:
poll_link: Enlace de información adicional
poll_link_description: Añade un enlace de información adicional a la funcionalidad de encuestas del panel de control
email_short_title: Correo electrónico
email_short_title_description: Breve descripción de la funcionalidad de correo electrónico. Permite a los usuarios enviar un email para difundir su propuesta
email_short_title_description: 'Breve descripción de la funcionalidad de correo electrónico. Permite a los usuarios enviar un email para difundir su propuesta. Puedes encontrar todo el contenido de este correo electrónico en "/app/views/dashboard/mailer/forward.html.erb"'
email_description: Descripción correo electrónico
email_description_description: Descripción detallada de la funcionalidad de correo electrónico
poster_short_title: Póster
poster_short_title_description: Breve descripción de la funcionalidad de póster. Permite a los usuarios descargar un póster en formato PDF para difundir su propuesta
poster_short_title_description: 'Breve descripción de la funcionalidad de póster. Permite a los usuarios descargar un póster en formato PDF para difundir su propuesta. Puedes encontrar todo el contenido de este póster en "/app/views/dashboard/poster/index.pdf.erb"'
poster_description: Descripción póster
poster_description_description: Descripción detallada de la funcionalidad de póster
feature:
Expand Down Expand Up @@ -137,7 +137,7 @@ es:
polls_description: "Las votaciones ciudadanas son un mecanismo de participación por el que la ciudadanía con derecho a voto puede tomar decisiones de forma directa"
budgets: "Presupuestos participativos"
budgets_description: "Con los presupuestos participativos la ciudadanía decide a qué proyectos presentados por los vecinos y vecinas va destinada una parte del presupuesto"
legislation: "Legislación"
legislation: "Legislación colaborativa"
legislation_description: "En los procesos participativos se ofrece a la ciudadanía la oportunidad de participar en la elaboración y modificación de normativa que afecta a la sociedad y de dar su opinión sobre ciertas actuaciones que se tiene previsto llevar a cabo"
html:
per_page_code_head: "Código a incluir en cada página (<head>)"
Expand Down
1 change: 1 addition & 0 deletions config/routes/proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
get :progress
get :community
get :recommended_actions
get :messages
end

resources :resources, only: [:index], controller: "dashboard/resources"
Expand Down