diff --git a/app/assets/stylesheets/pages/_legislation.scss b/app/assets/stylesheets/pages/_legislation.scss index d25eb25..25b3a2a 100644 --- a/app/assets/stylesheets/pages/_legislation.scss +++ b/app/assets/stylesheets/pages/_legislation.scss @@ -264,6 +264,15 @@ button{ margin-right: 10px } +.medium-font{ + font-weight: bold; + font-size: 15px +} + +.small-font{ + font-size: 13px; +} + @media only screen and (max-width: 600px) { .title .jumbotron { diff --git a/app/views/consultations/new.html.erb b/app/views/consultations/new.html.erb index 33ddb65..6cbcbc9 100644 --- a/app/views/consultations/new.html.erb +++ b/app/views/consultations/new.html.erb @@ -35,7 +35,7 @@
  • -

    Toma en cuenta que para leer los artículos modificados sólo debes pasar el cursor sobre el botón MODIFICADO. Al hacerlo, se abrirá una ventana con el contenido propuesto por la Concertación Nacional para el Desarrollo.

    +

    Toma en cuenta que para leer los artículos modificados sólo debes pasar el cursor sobre el botón VER MODIFICADO. Al hacerlo, se abrirá una ventana con el contenido propuesto por la Concertación Nacional para el Desarrollo.

  • Nota: Si lo deseas, puedes bajar el PDF del texto aquí.

    @@ -44,7 +44,7 @@
    -
    +

    Cuando veas esta escala, toma en cuenta que:

    1 = no me gusta en absoluto 👎🏽

    5 = estoy absolutamente de acuerdo 👍🏽

    @@ -52,10 +52,10 @@
    -
    +

    Lee el documento a tu propio ritmo

    No hay ningun requerimiento de participación. Todos están invitados a colaborar y a leer y comentar todas las veces que quieran. Cualquier idea es aceptada para mejorar el país.

    -

    Has "click" en cuando termines de leer el texto.

    +

    Has "click" en cuando termines de leer el texto.

    diff --git a/app/views/legislations/show.html.erb b/app/views/legislations/show.html.erb index 003b278..f029351 100644 --- a/app/views/legislations/show.html.erb +++ b/app/views/legislations/show.html.erb @@ -62,7 +62,7 @@ <%# @metadata = Metadatum.find_by(article: article) %>
    Artículo <%= article.number %>
    -

    +

    <% else %> <% if article.new == true %> @@ -103,58 +103,59 @@
    - <% unless article.questions[0].answers.exists?(consultation: current_user.consultations.last) %> + <% unless article.questions.find_by(number: 1).answers.exists?(consultation: current_user.consultations.last) %>
    - <%= article.questions[0].content %>

    (1 = no me gusta en absoluto, 5 = estoy absolutamente de acuerdo)

    +

    <%= article.questions.find_by(number: 1).content %>

    +

    (1 = no me gusta en absoluto, 5 = estoy absolutamente de acuerdo)

    <%= form_for @answer, html: { id: "reportform" }, remote: true, update: { success: "response", failure: "error"}, method: :post do |f| %> <%= f.hidden_field :user_id, :value => current_user.id %> - <%= f.hidden_field :question_id, :value => article.questions[0].id %> + <%= f.hidden_field :question_id, :value => article.questions.find_by(number: 1).id %> <%= f.hidden_field :consultation_id, :value => @consultation.id %> <%= hidden_field_tag :authenticity_token, form_authenticity_token %> <% end %>
    <% end %> - <% unless article.questions[1].answers.exists?(consultation: current_user.consultations.last) %> + <% unless article.questions.find_by(number: 2).answers.exists?(consultation: current_user.consultations.last) %>
    - <%= article.questions[1].content %>

    (1 = not at all, 5 = very much)

    +

    <%= article.questions.find_by(number: 2).content %>

    <%= form_for @answer, html: { id: "reportform" }, remote: true, update: { success: "response", failure: "error"} do |f| %> <%= f.hidden_field :user_id, :value => current_user.id %> - <%= f.hidden_field :question_id, :value => article.questions[1].id %> + <%= f.hidden_field :question_id, :value => article.questions.find_by(number: 2).id %> <%= f.hidden_field :consultation_id, :value => @consultation.id %> <%= hidden_field_tag :authenticity_token, form_authenticity_token %> <% end %>
    <% end %> - <% unless article.questions[2].answers.exists?(consultation: current_user.consultations.last) %> + <% unless article.questions.find_by(number: 3).answers.exists?(consultation: current_user.consultations.last) %>
    -

    ¿Quisieras sugerir algún comentario sobre el artículo?

    +

    ¿Quisieras sugerir algún comentario sobre el artículo?

    @@ -162,16 +163,16 @@
    - <%= article.questions[2].content %> +

    <%= article.questions.find_by(number: 3).content %>

    <%= form_for Answer.new, html: { id: "reportform" }, remote: true, update: { success: "response", failure: "error"} do |f| %>
    <%= f.hidden_field :user_id, :value => current_user.id %> - <%= f.hidden_field :question_id, :value => article.questions[2].id %> + <%= f.hidden_field :question_id, :value => article.questions.find_by(number: 3).id %> <%= f.hidden_field :consultation_id, :value => @consultation.id %> <%= hidden_field_tag :authenticity_token, form_authenticity_token %> <%= f.text_area :content, :name => "content", required: true, :class => 'form-control', placeholder: "Me parece que este artículo es bueno/malo porque .... Esto se podría arreglar agregando/quitando ...." %> - <%= f.submit 'Sugiere tu revisión', :class => 'btn-primary' %> + <%= f.submit 'sugiere tu revisión', :class => 'btn-primary' %>
    <% end %> diff --git a/config/initializers/active_admin.rb b/config/initializers/active_admin.rb index c853103..dbbeff6 100644 --- a/config/initializers/active_admin.rb +++ b/config/initializers/active_admin.rb @@ -112,7 +112,7 @@ # roots for each namespace. # # Default: - config.root_to = 'general_feedbacks#index' + config.root_to = 'answers#index' # == Admin Comments # diff --git a/db/migrate/20190825001535_add_number_to_questions.rb b/db/migrate/20190825001535_add_number_to_questions.rb new file mode 100644 index 0000000..d130ab6 --- /dev/null +++ b/db/migrate/20190825001535_add_number_to_questions.rb @@ -0,0 +1,5 @@ +class AddNumberToQuestions < ActiveRecord::Migration[5.2] + def change + add_column :questions, :number, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 850dda3..9844921 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_16_135412) do +ActiveRecord::Schema.define(version: 2019_08_25_001535) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -132,6 +132,7 @@ t.bigint "article_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "number" t.index ["article_id"], name: "index_questions_on_article_id" end diff --git a/db/seeds.rb b/db/seeds.rb index 7ff2fc4..e4f78f5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -4811,7 +4811,7 @@ # La ultima pregunta referirá a un Si/No sobre si el ciudadano quiere escribir alguna sugerencia. puts 'Creating questions for each article' Article.all.each do |article| - Question.create!(content: "¿Tienes alguna sugerencia?", article: article) - Question.create!(content: "¿Piensas que este artículo beneficia a Panamá a largo plazo?", article: article) - Question.create!(content: "¿Sientes que este artículo representa tu opinión sobre este tema?", article: article) + Question.create!(content: "¿Tienes alguna sugerencia?", article: article, number: 3) + Question.create!(content: "¿Piensas que este artículo beneficia a Panamá a largo plazo?", article: article, number: 2) + Question.create!(content: "¿Sientes que este artículo representa tu opinión sobre este tema?", article: article, number: 1) end