diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index c536fe5a3..350f19eae 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -14,13 +14,11 @@ class Poll::Question < ActiveRecord::Base belongs_to :proposal validates :title, presence: true - validates :question, presence: true validates :summary, presence: true validates :author, presence: true validates :title, length: { in: 4..Poll::Question.title_max_length } validates :description, length: { maximum: Poll::Question.description_max_length } - validates :question, length: { in: 10..Poll::Question.question_max_length } scope :sort_for_list, -> { order('poll_questions.proposal_id IS NULL', :created_at)} scope :for_render, -> { includes(:author, :proposal) } diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index 942658f28..5d1a0d01c 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -1,16 +1,21 @@ -<% if @question.proposal.present? %> -
- <%= I18n.t("admin.questions.show.proposal") %>: - <%= @question.proposal.title %> -
-<% end %> -
+ <% if @question.proposal.present? %> +
+ <%= I18n.t("admin.questions.show.proposal") %>: + <%= link_to @question.proposal.title, proposal_path(@question.proposal) %> +
+ <% end %> +
<%= I18n.t("admin.questions.show.title") %>: <%= @question.title %>
+
+ <%= I18n.t("admin.questions.show.author") %>: + <%= link_to @question.author.name, user_path(@question.author) %> +
+
<%= I18n.t("admin.questions.show.valid_answers") %>: <%= @question.valid_answers.join(", ") %> @@ -30,7 +35,7 @@ <%= I18n.t("admin.questions.show.geozones") %>: <% @question.geozones.each do |geozone| %>
- <% geozone.name %> + <%= geozone.name %>
<% end %>
diff --git a/app/views/proposals/_proposal.html.erb b/app/views/proposals/_proposal.html.erb index 2c7bb272a..e786d7896 100644 --- a/app/views/proposals/_proposal.html.erb +++ b/app/views/proposals/_proposal.html.erb @@ -57,9 +57,16 @@

<%= t("proposal_ballots.successfull", - voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %> + voting: link_to(t("proposal_ballots.voting"), polls_path)).html_safe %>

+ <% if can? :create, Poll::Question %> +

+ <%= link_to t('poll_questions.create_question'), + new_admin_question_path(proposal_id: proposal.id), + class: "button hollow" %> +

+ <% end %> <% elsif proposal.archived? %>
<%= t("proposals.proposal.supports", count: proposal.total_votes) %> diff --git a/app/views/proposals/_proposal_ballots_banner.html.erb b/app/views/proposals/_proposal_ballots_banner.html.erb index df210a535..1e095b767 100644 --- a/app/views/proposals/_proposal_ballots_banner.html.erb +++ b/app/views/proposals/_proposal_ballots_banner.html.erb @@ -1,5 +1,5 @@