Skip to content

Commit

Permalink
Merge pull request consuldemocracy#78 from AyuntamientoMadrid/deactiv…
Browse files Browse the repository at this point in the history
…ate-survey

Deactivate survey
  • Loading branch information
xuanxu committed Mar 8, 2016
2 parents 08f58c8 + 5561e3e commit 4ec01db
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 29 deletions.
6 changes: 3 additions & 3 deletions app/assets/stylesheets/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ $button-sizes: (
default: 0.9rem,
large: 1.25rem,
);
$button-opacity-disabled: 0.25;
$button-opacity-disabled: 1;

// 12. Button Group
// ----------------
Expand Down Expand Up @@ -339,12 +339,12 @@ $input-font-family: inherit;
$input-font-size: rem-calc(16);
$input-background: $white;
$input-background-focus: $white;
$input-background-disabled: $light-gray;
$input-background-disabled: $medium-gray;
$input-border: 1px solid $medium-gray;
$input-border-focus: 1px solid $dark-gray;
$input-shadow: inset 0 1px 2px rgba($black, 0.1);
$input-shadow-focus: 0 0 5px $medium-gray;
$input-cursor-disabled: default;
$input-cursor-disabled: not-allowed;
$input-transition: box-shadow 0.5s, border-color 0.25s ease-in-out;
$input-number-spinners: true;
$input-radius: $global-radius;
Expand Down
5 changes: 1 addition & 4 deletions app/models/abilities/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(user)

can :suggest, Debate
can :suggest, Proposal

can [:flag, :unflag], Comment
cannot [:flag, :unflag], Comment, user_id: user.id

Expand All @@ -46,11 +46,8 @@ def initialize(user)
can :create, SpendingProposal

can :read, SurveyAnswer
can :create, SurveyAnswer
can :vote, SurveyAnswer

can :read, OpenAnswer
can :vote, OpenAnswer
end

can :create, Annotation
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/processes_plaza_espana.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h1><%= t("pages.processes.process_2.title") %></h1>
<%= markdown t("pages.processes.process_2.text") %>

<p><strong>Lo que se decida mayoritariamente definirá de manera vinculante las bases del concurso de remodelación de la plaza.</strong></p>
<p><strong>La encuesta ha finalizado. Próximamente publicaremos los resultados, que definirán de manera vinculante las bases del concurso de remodelación de la plaza.</strong></p>
<div class="medium-6">
<%= link_to t("pages.processes.process_2.button"), encuesta_plaza_espana_path, class: "button expanded" %>
</div>
Expand Down
17 changes: 5 additions & 12 deletions app/views/survey_answers/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<% end %>

<h1><%= t("pages.processes.process_2.title") %></h1>
<h3>Contesta las preguntas que quieras (no tienen por qué ser todas) y pulsa "Enviar respuesta"</h3>
<p>Puedes <a href="/processes_plaza_espana">ver toda la información relacionada con el proceso</a>, y mucha información útil para responder lo mejor posible a las siguientes preguntas.</p>
<h3>La encuesta ha finalizado. Próximamente publicaremos los resultados. Entretanto, más abajo puedes leer las preguntas que se realizaron en la encuesta.</h3>
<p>Puedes <a href="/processes_plaza_espana">ver toda la información relacionada con el proceso</a>, y mucha información útil sobre las preguntas del cuestionario.</p>
</div>
<div class="small-12 medium-4 column text-center margin-top">
<h3>¡Comparte esta encuesta!</h3>
Expand All @@ -26,19 +26,12 @@

<div id="login_required" class="callout primary absolute-survey" style="display:none">
<div id="login_required_text">
Solo los usuarios verificados pueden responder a la encuesta,
<% if user_signed_in? %>
<%= link_to "verifica tu cuenta", verification_path %>
<% else %>
necesitas <%= link_to "iniciar sesión", new_user_session_path %>
o <%= link_to "registrarte", new_user_registration_path %>
para continuar.
<% end %>
Esta encuesta ha finalizado.
</div>
</div>

<div id="survey" data-verified-id="<%= current_user.id if can?(:create, SurveyAnswer) %>" class="survey-questions small-12 medium-9 column end">
<%= form_tag encuesta_plaza_espana_gracias_path, class: "js-enter-disabled" %>
<%= form_tag class: "js-enter-disabled" %>
<article>
<h3>1a. ¿Crees necesario reformar la Plaza de España?</h3>
<label>
Expand Down Expand Up @@ -968,7 +961,7 @@
</span>
</label>
</article>
<input type="submit" value="Enviar respuesta" class="button large margin-top">
<input type="submit" disabled="true" value="Encuesta finalizada" class="button large margin-top">
</form>
</div>
</div>
2 changes: 1 addition & 1 deletion config/locales/pages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ en:
process_2:
title: Remodeling of the Plaza de España
text: We count on you for filling out a short survey decide how you want it this new space in your city.
button: Decides!
button: View survey
titles:
accessibility: Accessibility
conditions: Terms of use
Expand Down
2 changes: 1 addition & 1 deletion config/locales/pages.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ es:
process_2:
title: Remodelación de Plaza España
text: Contamos contigo para que decidas cómo debe ser este nuevo espacio en tu ciudad.
button: Decide
button: Ver las preguntas de la encuesta
titles:
accessibility: Accesibilidad
conditions: Condiciones de uso
Expand Down
7 changes: 1 addition & 6 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,9 @@

resources :survey_answers, only: [:new, :create]

resources :open_answers, only: [:show, :index] do
member do
post :vote
end
end
resources :open_answers, only: [:show, :index]

get "encuesta-plaza-espana", to: "survey_answers#new", as: :encuesta_plaza_espana
post "encuesta-plaza-espana/gracias", to: "survey_answers#create", as: :encuesta_plaza_espana_gracias
get "encuesta-plaza-espana/respuestas", to: "open_answers#index", as: :encuesta_plaza_espana_respuestas
get "encuesta-plaza-espana/respuesta/:id", to: "open_answers#show", as: :encuesta_plaza_espana_respuesta

Expand Down
2 changes: 1 addition & 1 deletion spec/features/spain_square_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

feature 'Spain square' do
xfeature 'Spain square' do

context "Fill out survey" do

Expand Down

0 comments on commit 4ec01db

Please sign in to comment.