Merge branch 'proposals' of github.com:AyuntamientoMadrid/participacion into proposals
This commit is contained in:
@@ -679,6 +679,7 @@
|
||||
.comment-user {
|
||||
margin-top: rem-calc(6);
|
||||
padding: rem-calc(6) 0;
|
||||
overflow: hidden;
|
||||
|
||||
@each $n in ("1", "2", "3","4", "5") {
|
||||
&.level-#{$n} {
|
||||
|
||||
@@ -925,6 +925,18 @@ form {
|
||||
margin-bottom: rem-calc(12);
|
||||
}
|
||||
|
||||
.note-marked {
|
||||
@extend .note;
|
||||
background: yellow;
|
||||
display: inline-block;
|
||||
|
||||
em {
|
||||
background: white;
|
||||
display: inline-block;
|
||||
padding-left: rem-calc(6);
|
||||
}
|
||||
}
|
||||
|
||||
.ckeditor {
|
||||
min-height: rem-calc(312);
|
||||
}
|
||||
|
||||
@@ -634,6 +634,7 @@
|
||||
.comment-user {
|
||||
margin-top: rem-calc(6);
|
||||
padding: rem-calc(6) 0;
|
||||
overflow: hidden;
|
||||
|
||||
@each $n in ("1", "2", "3","4", "5") {
|
||||
&.level-#{$n} {
|
||||
|
||||
@@ -8,4 +8,14 @@ module ProposalsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def supports_percentage(proposal)
|
||||
percentage = (proposal.cached_votes_up.to_f * 100 / Proposal.votes_needed_for_success)
|
||||
case percentage
|
||||
when 0 then "0%"
|
||||
when 0..(0.1) then "0.1%"
|
||||
when (0.1)..100 then number_to_percentage(percentage, strip_insignificant_zeros: true, precision: 1)
|
||||
else "100%"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,2 +1,3 @@
|
||||
<div><%= t("errors.messages.blank").capitalize %></div>
|
||||
|
||||
<div class="alert-box alert radius">
|
||||
<%= t("errors.messages.blank").capitalize %>
|
||||
</div>
|
||||
|
||||
@@ -32,9 +32,7 @@
|
||||
<div class="row-full subnavigation-container">
|
||||
<section class="subnavigation row">
|
||||
<div class="small-12 medium-8 column">
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to t("layouts.header.welcome"), root_path, class: ("active" if current_page? root_path) %>
|
||||
<% end %>
|
||||
<%= link_to t("layouts.header.highlights"), highlights_path, class: ("active" if current_page? highlights_path) %>
|
||||
<%= link_to t("layouts.header.debates"), debates_path, class: ("active" if current_page?(controller: "/debates")) %>
|
||||
<%= link_to t("layouts.header.proposals"), proposals_path, class: ("active" if current_page?(controller: "/proposals")) %>
|
||||
<%= link_to t("layouts.header.more_information"), "/more_information", class: ("active" if current_page?("/more_information")) %>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #dadfe1; padding: 20px 0;">
|
||||
<a href="#" target="_blank">
|
||||
<%= image_tag('logo_email_gobierno_abierto.png', style: "border: 0; display: block; width: 100%;max-width: 370px") %>
|
||||
<%= image_tag('logo_email_gobierno_abierto.png', style: "border: 0; display: block; width: 100%;max-width: 370px", alt: "Ayuntamiento de Madrid - Participación ciudadana, transparencia y gobierno abierto") %>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -9,10 +9,18 @@
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :question, t("proposals.form.proposal_question") %>
|
||||
<span class="note"><strong>Debe ser resumida en una pregunta cuya respuesta sea Sí o No.</strong> <em>Ej. "¿Está usted de acuerdo en peatonalizar la calle ?"</span>
|
||||
<span class="note-marked">
|
||||
<%= t("proposals.form.proposal_question_example_html") %>
|
||||
</span>
|
||||
<%= f.text_field :question, maxlength: Proposal.question_max_length, placeholder: t("proposals.form.proposal_question"), label: false %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :question, t("proposals.form.proposal_summary") %>
|
||||
<span class="note"><%= t("proposals.form.proposal_summary_note") %></span>
|
||||
<textarea rows="4" placeholder="<%= t('proposals.form.proposal_summary') %>"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="ckeditor small-12 column">
|
||||
<%= f.label :description, t("proposals.form.proposal_text") %>
|
||||
<%= f.cktext_area :description, maxlength: Proposal.description_max_length, ckeditor: { language: I18n.locale }, label: false %>
|
||||
@@ -37,6 +45,7 @@
|
||||
<% if current_user.unverified? %>
|
||||
<div class="small-12 column">
|
||||
<%= f.label :responsible_name, t("proposals.form.proposal_responsible_name") %>
|
||||
<span class="note"><%= t("proposals.form.proposal_responsible_name_note") %></span>
|
||||
<%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<span class="total-supports">
|
||||
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>
|
||||
<!-- percentage of supports -->
|
||||
(0.1%)
|
||||
(<%= supports_percentage(proposal) %>)
|
||||
<!-- /. percentage of supports -->
|
||||
<span>
|
||||
<abbr title="<%= t("proposals.proposal.census_percent") %>">
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
<% end %>
|
||||
<h1><%= t("proposals.new.start_new") %></h1>
|
||||
<div class="alert-box info radius">
|
||||
<%= t("proposals.new.info")%>
|
||||
<%= link_to "/more_information", target: "_blank" do %>
|
||||
<strong><%= t("proposals.new.more_info")%></strong>
|
||||
<%= link_to "/proposals_info", target: "_blank" do %>
|
||||
<%= t("proposals.new.more_info")%>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render "form" %>
|
||||
@@ -22,7 +21,6 @@
|
||||
<li><%= t("proposals.new.recommendation_one") %></li>
|
||||
<li><%= t("proposals.new.recommendation_two") %></li>
|
||||
<li><%= t("proposals.new.recommendation_three") %></li>
|
||||
<li><%= t("proposals.new.recommendation_four") %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ en:
|
||||
locale: "Language:"
|
||||
administration: Administration
|
||||
moderation: Moderation
|
||||
welcome: "Welcome"
|
||||
highlights: "Highlights"
|
||||
more_information: "More information"
|
||||
debates: Debates
|
||||
proposals: Proposals
|
||||
@@ -175,9 +175,13 @@ en:
|
||||
form:
|
||||
proposal_title: Proposal title
|
||||
proposal_question: Proposal question
|
||||
proposal_question_example_html: "Debe ser resumida en una pregunta cuya respuesta sea Sí o No. <em>Ej. '¿Está usted de acuerdo en peatonalizar la calle Mayor?'</em>"
|
||||
proposal_text: Initial text for proposal
|
||||
proposal_external_url: Link to additional documentation
|
||||
proposal_summary: "Proposal summary"
|
||||
proposal_summary_note: "200 chars. maximum"
|
||||
proposal_responsible_name: "First and last name of the person making this proposal"
|
||||
proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)"
|
||||
tags_label: Topics
|
||||
tags_instructions: >
|
||||
Tag this proposal. You can choose among our proposals on the list or add any other topic you want.
|
||||
@@ -202,14 +206,12 @@ en:
|
||||
submit_button: "Save changes"
|
||||
new:
|
||||
start_new: Start a proposal
|
||||
info: "Please explain your proposal crearly. If the proposal get enough support and advances to referendum phase, it must be condensed to a question with a Yes/No anwser. If your proposal is not clear or you just have to share your opinion please consider starting a debate instead"
|
||||
more_info: "More info"
|
||||
more_info: "¿Cómo funcionan las propuestas ciudadanas?"
|
||||
back_link: Back
|
||||
recommendations_title: Tips for creating a proposal
|
||||
recommendation_one: "Do not write the title of the proposal or whole sentences in capital. On the Internet this is considered shouting. And nobody likes to scream."
|
||||
recommendation_two: "Any discussion or comment that involves an illegal act will be eliminated, also intending to sabotage the proposal spaces, everything else is permitted."
|
||||
recommendation_three: "The harsh criticism are very welcome. This is a space of thought but we recommend preserving the elegance and intelligence. The world is better with them present."
|
||||
recommendation_four: "Enjoy this space, voices that fill it, it is yours too."
|
||||
recommendation_three: "Enjoy this space, voices that fill it, it is yours too."
|
||||
form:
|
||||
submit_button: "Start a proposal"
|
||||
create:
|
||||
|
||||
@@ -27,7 +27,7 @@ es:
|
||||
locale: "Idioma:"
|
||||
administration: Administrar
|
||||
moderation: Moderar
|
||||
welcome: "Portada"
|
||||
highlights: "Destacados"
|
||||
more_information: "Más información"
|
||||
debates: Debates
|
||||
proposals: Propuestas ciudadanas
|
||||
@@ -138,7 +138,7 @@ es:
|
||||
submit_button: "Guardar cambios"
|
||||
proposals:
|
||||
index:
|
||||
start_proposal: Empieza una propuesta
|
||||
start_proposal: Crea una propuesta
|
||||
select_order: Ordenar por
|
||||
select_order_long: Estás viendo las propuestas
|
||||
orders:
|
||||
@@ -175,9 +175,13 @@ es:
|
||||
form:
|
||||
proposal_title: Título de la propuesta
|
||||
proposal_question: Pregunta de la propuesta
|
||||
proposal_text: Texto inicial de la propuesta
|
||||
proposal_question_example_html: "Debe ser resumida en una pregunta cuya respuesta sea Sí o No. <em>Ej. '¿Está usted de acuerdo en peatonalizar la calle Mayor?'</em>"
|
||||
proposal_summary: "Resumen de la propuesta"
|
||||
proposal_summary_note: "(máximo 200 caracteres)"
|
||||
proposal_text: Texto desarrollado de la propuesta
|
||||
proposal_external_url: Enlace a documentación adicional
|
||||
proposal_responsible_name: "Nombre y apellidos de la persona que hace esta propuesta"
|
||||
proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)"
|
||||
tags_label: Temas
|
||||
tags_instructions: >
|
||||
Etiqueta esta propuesta. Puedes elegir entre nuestras propuestas o introducir las que desees.
|
||||
@@ -201,20 +205,18 @@ es:
|
||||
form:
|
||||
submit_button: "Guardar cambios"
|
||||
new:
|
||||
start_new: Empezar una propuesta
|
||||
info: "Si quieres que tu propuesta consiga apoyos has de explicarla claramente y de forma que se entienda. Si consigue el número adecuado de apoyos y es llevada a consulta debe ser resumida en una pregunta cuya respuesta sea Sí o No."
|
||||
more_info: "Más información"
|
||||
start_new: Crear una propuesta
|
||||
more_info: "¿Cómo funcionan las propuestas ciudadanas?"
|
||||
back_link: Volver
|
||||
recommendations_title: Recomendaciones para crear una propuesta
|
||||
recommendation_one: "No escribas el título de la propuesta o frases enteras en mayúsculas. En internet eso se considera gritar. Y a nadie le gusta que le griten."
|
||||
recommendation_two: "Cualquier propuesta o comentario que implique una acción ilegal será eliminada, también las que tengan la intención de sabotear los espacios de propuesta, todo lo demás está permitido."
|
||||
recommendation_three: "Las críticas despiadadas son muy bienvenidas. Este es un espacio de pensamiento. Pero te recomendamos conservar la elegancia y la inteligencia. El mundo es mejor con ellas presentes."
|
||||
recommendation_four: "Disfruta de este espacio, de las voces que lo llenan, también es tuyo."
|
||||
recommendation_three: "Disfruta de este espacio, de las voces que lo llenan, también es tuyo."
|
||||
form:
|
||||
submit_button: "Empieza una propuesta"
|
||||
submit_button: "Crear propuesta"
|
||||
create:
|
||||
form:
|
||||
submit_button: "Empieza una propuesta"
|
||||
submit_button: "Crear propuesta"
|
||||
update:
|
||||
form:
|
||||
submit_button: "Guardar cambios"
|
||||
|
||||
@@ -3,7 +3,6 @@ require 'rails_helper'
|
||||
describe ProposalsHelper do
|
||||
|
||||
describe "#progress_bar_percentage" do
|
||||
|
||||
it "should be 0 if no votes" do
|
||||
proposal = create(:proposal)
|
||||
expect(progress_bar_percentage(proposal)).to eq 0
|
||||
@@ -20,4 +19,26 @@ describe ProposalsHelper do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#supports_percentage" do
|
||||
it "should be 0 if no votes" do
|
||||
proposal = create(:proposal)
|
||||
expect(supports_percentage(proposal)).to eq "0%"
|
||||
end
|
||||
|
||||
it "should be a between 0.1 from 1 to 0.1% of needed votes" do
|
||||
proposal = create(:proposal, cached_votes_up: 1)
|
||||
expect(supports_percentage(proposal)).to eq "0.1%"
|
||||
end
|
||||
|
||||
it "should be a between 1 and 100 if there are votes but less than needed" do
|
||||
proposal = create(:proposal, cached_votes_up: Proposal.votes_needed_for_success/2)
|
||||
expect(supports_percentage(proposal)).to eq "50%"
|
||||
end
|
||||
|
||||
it "should be 100 if there are more votes than needed" do
|
||||
proposal = create(:proposal, cached_votes_up: Proposal.votes_needed_for_success*2)
|
||||
expect(supports_percentage(proposal)).to eq "100%"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user