cherry picks creating poll question from successful proposals
This commit is contained in:
@@ -846,7 +846,7 @@
|
||||
// ------------
|
||||
|
||||
.featured-debates, .featured-proposals,
|
||||
.proposals-ballot, .proposals-ballot-list {
|
||||
.enquiries-list {
|
||||
padding: $line-height/2 0;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
@@ -953,6 +953,11 @@
|
||||
padding-bottom: $line-height;
|
||||
}
|
||||
|
||||
&.enquiries {
|
||||
background: #2D3E50 image-url('heading_enquiries.jpg') no-repeat;
|
||||
background-position: 70%;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
|
||||
@@ -971,7 +976,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.featured-proposals-ballot-banner {
|
||||
.sucessfull-proposals-banner {
|
||||
background: #2D3E50 image-url("ballot_tiny.gif") no-repeat;
|
||||
background-position: 75% 0;
|
||||
position: relative;
|
||||
@@ -995,7 +1000,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.featured-proposals-ballot-banner,
|
||||
.sucessfull-proposals-banner,
|
||||
.successfull .panel {
|
||||
|
||||
.icon-successfull {
|
||||
@@ -1019,9 +1024,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
.proposals-ballot-list {
|
||||
.enquiries-list {
|
||||
|
||||
.proposal-sucessfull {
|
||||
.enquiry {
|
||||
background: white;
|
||||
border-top: 1px solid $border;
|
||||
padding: $line-height 0;
|
||||
|
||||
@@ -28,7 +28,7 @@ class ProposalsController < ApplicationController
|
||||
def index_customization
|
||||
discard_archived
|
||||
load_retired
|
||||
load_proposal_ballots
|
||||
load_successfull_proposals
|
||||
load_featured unless @proposal_successfull_exists
|
||||
end
|
||||
|
||||
@@ -103,7 +103,7 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def load_proposal_ballots
|
||||
def load_successfull_proposals
|
||||
@proposal_successfull_exists = Proposal.successfull.exists?
|
||||
end
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
<% end %>
|
||||
|
||||
<% if @proposal_successfull_exists %>
|
||||
<%= render "proposals/proposal_ballots_banner" %>
|
||||
<%= render "proposals/successfull_banner" %>
|
||||
<% end %>
|
||||
|
||||
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_ballots.present? || @proposal_successfull_exists %>
|
||||
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_successfull_exists %>
|
||||
<%= render "featured_debates" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
41
app/views/enquiries/index.html.erb
Normal file
41
app/views/enquiries/index.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<div class="expanded no-margin-top margin-bottom dark-heading enquiries padding">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<h2>
|
||||
<%= t("enquiries.index.title") %>
|
||||
</h2>
|
||||
<p>
|
||||
<%= t("enquiries.index.description_html").html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render 'shared/filter_subnav', i18n_namespace: "enquiries.index" %>
|
||||
|
||||
<% if @enquiries.present? %>
|
||||
<div class="enquiries-list">
|
||||
<% @enquiries.each do |enquiry| %>
|
||||
<div class="enquiry">
|
||||
<h3><%= link_to enquiry.title, enquiry %></h3>
|
||||
<div class="info">
|
||||
<%= t('enquiries.index.dates',
|
||||
open_at: l(enquiry.open_at.to_date),
|
||||
closed_at: l(enquiry.closed_at.to_date)).html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= paginate @enquiries %>
|
||||
<% else %>
|
||||
<div class="callout primary">
|
||||
<%= t("enquiries.index.no_enquiries_#{@current_filter}") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@@ -56,8 +56,8 @@
|
||||
<% if proposal.successfull? %>
|
||||
<div class="message">
|
||||
<p>
|
||||
<%= t("proposal_ballots.successfull",
|
||||
voting: link_to(t("proposal_ballots.voting"), polls_path)).html_safe %>
|
||||
<%= t("proposals.proposal.successfull",
|
||||
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<% if can? :create, Poll::Question %>
|
||||
|
||||
9
app/views/proposals/_successfull_banner.html.erb
Normal file
9
app/views/proposals/_successfull_banner.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div id="next-voting" class="row sucessfull-proposals-banner">
|
||||
<%= link_to polls_path do %>
|
||||
<div class="small-12 column padding">
|
||||
<div class="icon-successfull"></div>
|
||||
<h2><%= t("enquiries.banner.featured_title") %></h2>
|
||||
<p><%= t("enquiries.banner.info") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if @proposal_successfull_exists %>
|
||||
<%= render "proposal_ballots_banner" %>
|
||||
<%= render "successfull_banner" %>
|
||||
<% elsif @featured_proposals.present? %>
|
||||
<div id="featured-proposals" class="row featured-proposals">
|
||||
<div class="small-12 column">
|
||||
|
||||
@@ -105,9 +105,16 @@
|
||||
<div id="<%= dom_id(@proposal) %>_votes">
|
||||
<% if @proposal.successfull? %>
|
||||
<p>
|
||||
<%= t("proposal_ballots.successfull",
|
||||
voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %>
|
||||
<%= t("proposals.proposal.successfull",
|
||||
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
|
||||
</p>
|
||||
<% if can? :create, Poll::Question %>
|
||||
<p class="text-center">
|
||||
<%= link_to t('poll_questions.create_enquiry'),
|
||||
new_admin_question_path(proposal_id: @proposal.id),
|
||||
class: "button hollow expanded" %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% elsif @proposal.archived? %>
|
||||
<p class="text-center">
|
||||
<strong><%= t("proposals.proposal.supports", count: @proposal.total_votes) %></strong>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= link_to t("layouts.header.proposals"), proposals_path, class: ("active" if controller_name == "proposals"), accesskey: "p" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to t("layouts.header.proposal_ballot"), polls_path, class: ("active" if controller_name == "proposal_ballots"), accesskey: "v" %>
|
||||
<%= link_to t("layouts.header.poll_questions"), polls_path, class: ("active" if controller_name == "polls"), accesskey: "v" %>
|
||||
</li>
|
||||
<% if feature?(:spending_proposals) %>
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user