fixes typo
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
// 03. Show participation
|
// 03. Show participation
|
||||||
// 04. List participation
|
// 04. List participation
|
||||||
// 05. Featured
|
// 05. Featured
|
||||||
// 06. Proposals successfull
|
// 06. Proposals successful
|
||||||
//
|
//
|
||||||
|
|
||||||
// 01. Votes and supports
|
// 01. Votes and supports
|
||||||
@@ -942,7 +942,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 06. Proposals successfull
|
// 06. Proposals successful
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
.dark-heading {
|
.dark-heading {
|
||||||
@@ -1001,9 +1001,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sucessfull-proposals-banner,
|
.sucessfull-proposals-banner,
|
||||||
.successfull .panel {
|
.successful .panel {
|
||||||
|
|
||||||
.icon-successfull {
|
.icon-successful {
|
||||||
border-right: 60px solid #FFD200;
|
border-right: 60px solid #FFD200;
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
border-bottom: 60px solid transparent;
|
border-bottom: 60px solid transparent;
|
||||||
@@ -1034,7 +1034,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.successfull {
|
.successful {
|
||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class DebatesController < ApplicationController
|
|||||||
|
|
||||||
def index_customization
|
def index_customization
|
||||||
@featured_debates = @debates.featured
|
@featured_debates = @debates.featured
|
||||||
@proposal_successfull_exists = Proposal.successfull.exists?
|
@proposal_successful_exists = Proposal.successful.exists?
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class ProposalsController < ApplicationController
|
|||||||
def index_customization
|
def index_customization
|
||||||
discard_archived
|
discard_archived
|
||||||
load_retired
|
load_retired
|
||||||
load_successfull_proposals
|
load_successful_proposals
|
||||||
load_featured unless @proposal_successfull_exists
|
load_featured unless @proposal_successful_exists
|
||||||
end
|
end
|
||||||
|
|
||||||
def vote
|
def vote
|
||||||
@@ -103,8 +103,8 @@ class ProposalsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_successfull_proposals
|
def load_successful_proposals
|
||||||
@proposal_successfull_exists = Proposal.successfull.exists?
|
@proposal_successful_exists = Proposal.successful.exists?
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class Proposal < ActiveRecord::Base
|
|||||||
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
|
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
|
||||||
scope :retired, -> { where.not(retired_at: nil) }
|
scope :retired, -> { where.not(retired_at: nil) }
|
||||||
scope :not_retired, -> { where(retired_at: nil) }
|
scope :not_retired, -> { where(retired_at: nil) }
|
||||||
scope :successfull, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)}
|
scope :successful, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)}
|
||||||
|
|
||||||
def to_param
|
def to_param
|
||||||
"#{id}-#{title}".parameterize
|
"#{id}-#{title}".parameterize
|
||||||
@@ -159,7 +159,7 @@ class Proposal < ActiveRecord::Base
|
|||||||
Setting['votes_for_proposal_success'].to_i
|
Setting['votes_for_proposal_success'].to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def successfull?
|
def successful?
|
||||||
total_votes >= Proposal.votes_needed_for_success
|
total_votes >= Proposal.votes_needed_for_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@
|
|||||||
<%= render "shared/banner" %>
|
<%= render "shared/banner" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if @proposal_successfull_exists %>
|
<% if @proposal_successful_exists %>
|
||||||
<%= render "proposals/successfull_banner" %>
|
<%= render "proposals/successful_banner" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_successfull_exists %>
|
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_successful_exists %>
|
||||||
<%= render "featured_debates" %>
|
<%= render "featured_debates" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<div id="<%= dom_id(proposal) %>"
|
<div id="<%= dom_id(proposal) %>"
|
||||||
class="proposal clear <%= ("successfull" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
|
class="proposal clear <%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
|
||||||
data-type="proposal">
|
data-type="proposal">
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="icon-successfull"></div>
|
<div class="icon-successful"></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
@@ -53,10 +53,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column">
|
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column">
|
||||||
<% if proposal.successfull? %>
|
<% if proposal.successful? %>
|
||||||
<div class="message">
|
<div class="message">
|
||||||
<p>
|
<p>
|
||||||
<%= t("proposals.proposal.successfull",
|
<%= t("proposals.proposal.successful",
|
||||||
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
|
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div id="next-voting" class="row featured-proposals-ballot-banner">
|
<div id="next-voting" class="row featured-proposals-ballot-banner">
|
||||||
<%= link_to polls_path do %>
|
<%= link_to polls_path do %>
|
||||||
<div class="small-12 column padding">
|
<div class="small-12 column padding">
|
||||||
<div class="icon-successfull"></div>
|
<div class="icon-successful"></div>
|
||||||
<h2><%= t("proposal_ballots.featured_title") %></h2>
|
<h2><%= t("proposal_ballots.featured_title") %></h2>
|
||||||
<p><%= t("proposal_ballots.info") %></p>
|
<p><%= t("proposal_ballots.info") %></p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div id="next-voting" class="row sucessfull-proposals-banner">
|
<div id="next-voting" class="row sucessfull-proposals-banner">
|
||||||
<%= link_to polls_path do %>
|
<%= link_to polls_path do %>
|
||||||
<div class="small-12 column padding">
|
<div class="small-12 column padding">
|
||||||
<div class="icon-successfull"></div>
|
<div class="icon-successful"></div>
|
||||||
<h2><%= t("enquiries.banner.featured_title") %></h2>
|
<h2><%= t("enquiries.banner.featured_title") %></h2>
|
||||||
<p><%= t("enquiries.banner.info") %></p>
|
<p><%= t("enquiries.banner.info") %></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
<%= render "shared/banner" %>
|
<%= render "shared/banner" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if @proposal_successfull_exists %>
|
<% if @proposal_successful_exists %>
|
||||||
<%= render "successfull_banner" %>
|
<%= render "successful_banner" %>
|
||||||
<% elsif @featured_proposals.present? %>
|
<% elsif @featured_proposals.present? %>
|
||||||
<div id="featured-proposals" class="row featured-proposals">
|
<div id="featured-proposals" class="row featured-proposals">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
|
|||||||
@@ -103,9 +103,9 @@
|
|||||||
<div class="sidebar-divider"></div>
|
<div class="sidebar-divider"></div>
|
||||||
<h3><%= t("votes.supports") %></h3>
|
<h3><%= t("votes.supports") %></h3>
|
||||||
<div id="<%= dom_id(@proposal) %>_votes">
|
<div id="<%= dom_id(@proposal) %>_votes">
|
||||||
<% if @proposal.successfull? %>
|
<% if @proposal.successful? %>
|
||||||
<p>
|
<p>
|
||||||
<%= t("proposals.proposal.successfull",
|
<%= t("proposals.proposal.successful",
|
||||||
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
|
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
|
||||||
</p>
|
</p>
|
||||||
<% if can? :create, Poll::Question %>
|
<% if can? :create, Poll::Question %>
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ en:
|
|||||||
supports_necessary: "%{number} supports needed"
|
supports_necessary: "%{number} supports needed"
|
||||||
total_percent: 100%
|
total_percent: 100%
|
||||||
archived: "This proposal has been archived and can't collect supports."
|
archived: "This proposal has been archived and can't collect supports."
|
||||||
successfull: "This proposal has reached the required supports and will be voted in the %{voting}."
|
successful: "This proposal has reached the required supports and will be voted in the %{voting}."
|
||||||
voting: "next voting"
|
voting: "next voting"
|
||||||
show:
|
show:
|
||||||
author_deleted: User deleted
|
author_deleted: User deleted
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ es:
|
|||||||
supports_necessary: "%{number} apoyos necesarios"
|
supports_necessary: "%{number} apoyos necesarios"
|
||||||
total_percent: 100%
|
total_percent: 100%
|
||||||
archived: "Esta propuesta ha sido archivada y ya no puede recoger apoyos."
|
archived: "Esta propuesta ha sido archivada y ya no puede recoger apoyos."
|
||||||
successfull: "Esta propuesta ha alcanzado los apoyos necesarios y pasará a la %{voting}."
|
successful: "Esta propuesta ha alcanzado los apoyos necesarios y pasará a la %{voting}."
|
||||||
voting: "próxima votación"
|
voting: "próxima votación"
|
||||||
show:
|
show:
|
||||||
author_deleted: Usuario eliminado
|
author_deleted: Usuario eliminado
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ puts "Creating Poll Question from Proposals"
|
|||||||
puts " #{question.title} (from proposal)"
|
puts " #{question.title} (from proposal)"
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Creating Successfull Proposals"
|
puts "Creating Successful Proposals"
|
||||||
|
|
||||||
(1..10).each do |i|
|
(1..10).each do |i|
|
||||||
proposal = Proposal.reorder("RANDOM()").first
|
proposal = Proposal.reorder("RANDOM()").first
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ feature 'Proposal ballots' do
|
|||||||
expect(page).to_not have_css("#next-voting")
|
expect(page).to_not have_css("#next-voting")
|
||||||
expect(page).to have_css("#featured-proposals")
|
expect(page).to have_css("#featured-proposals")
|
||||||
|
|
||||||
create_successfull_proposals
|
create_successful_proposals
|
||||||
|
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
|
|
||||||
@@ -18,12 +18,12 @@ feature 'Proposal ballots' do
|
|||||||
expect(page).to_not have_css("#featured-proposals")
|
expect(page).to_not have_css("#featured-proposals")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Successfull proposals do not show support buttons in index' do
|
scenario 'Successful proposals do not show support buttons in index' do
|
||||||
successfull_proposals = create_successfull_proposals
|
successful_proposals = create_successful_proposals
|
||||||
|
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
within("#proposal_#{proposal.id}_votes") do
|
within("#proposal_#{proposal.id}_votes") do
|
||||||
expect(page).to_not have_css(".supports")
|
expect(page).to_not have_css(".supports")
|
||||||
expect(page).to have_content "This proposal has reached the required supports"
|
expect(page).to have_content "This proposal has reached the required supports"
|
||||||
@@ -31,10 +31,10 @@ feature 'Proposal ballots' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Successfull proposals do not show support buttons in show' do
|
scenario 'Successful proposals do not show support buttons in show' do
|
||||||
successfull_proposals = create_successfull_proposals
|
successful_proposals = create_successful_proposals
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
visit proposal_path(proposal)
|
visit proposal_path(proposal)
|
||||||
within("#proposal_#{proposal.id}_votes") do
|
within("#proposal_#{proposal.id}_votes") do
|
||||||
expect(page).to_not have_css(".supports")
|
expect(page).to_not have_css(".supports")
|
||||||
@@ -43,12 +43,12 @@ feature 'Proposal ballots' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Successfull proposals are listed in the proposal ballots index' do
|
scenario 'Successful proposals are listed in the proposal ballots index' do
|
||||||
successfull_proposals = create_successfull_proposals
|
successful_proposals = create_successful_proposals
|
||||||
|
|
||||||
visit proposal_ballots_path
|
visit proposal_ballots_path
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
expect(page).to have_content(proposal.title)
|
expect(page).to have_content(proposal.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1489,7 +1489,7 @@ feature 'Proposals' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature 'Successfull proposals' do
|
feature 'Successful proposals' do
|
||||||
|
|
||||||
scenario 'Banner shows in proposal index' do
|
scenario 'Banner shows in proposal index' do
|
||||||
create_featured_proposals
|
create_featured_proposals
|
||||||
@@ -1498,7 +1498,7 @@ feature 'Successfull proposals' do
|
|||||||
expect(page).to_not have_css("#next-voting")
|
expect(page).to_not have_css("#next-voting")
|
||||||
expect(page).to have_css("#featured-proposals")
|
expect(page).to have_css("#featured-proposals")
|
||||||
|
|
||||||
create_successfull_proposals
|
create_successful_proposals
|
||||||
|
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
|
|
||||||
@@ -1506,12 +1506,12 @@ feature 'Successfull proposals' do
|
|||||||
expect(page).to_not have_css("#featured-proposals")
|
expect(page).to_not have_css("#featured-proposals")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Successfull proposals do not show support buttons in index' do
|
scenario 'Successful proposals do not show support buttons in index' do
|
||||||
successfull_proposals = create_successfull_proposals
|
successful_proposals = create_successful_proposals
|
||||||
|
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
within("#proposal_#{proposal.id}_votes") do
|
within("#proposal_#{proposal.id}_votes") do
|
||||||
expect(page).to_not have_css(".supports")
|
expect(page).to_not have_css(".supports")
|
||||||
expect(page).to have_content "This proposal has reached the required supports"
|
expect(page).to have_content "This proposal has reached the required supports"
|
||||||
@@ -1519,10 +1519,10 @@ feature 'Successfull proposals' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Successfull proposals do not show support buttons in show' do
|
scenario 'Successful proposals do not show support buttons in show' do
|
||||||
successfull_proposals = create_successfull_proposals
|
successful_proposals = create_successful_proposals
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
visit proposal_path(proposal)
|
visit proposal_path(proposal)
|
||||||
within("#proposal_#{proposal.id}_votes") do
|
within("#proposal_#{proposal.id}_votes") do
|
||||||
expect(page).to_not have_css(".supports")
|
expect(page).to_not have_css(".supports")
|
||||||
@@ -1531,12 +1531,12 @@ feature 'Successfull proposals' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Successfull proposals show create enquiry button to admin users' do
|
scenario 'Successful proposals show create enquiry button to admin users' do
|
||||||
successfull_proposals = create_successfull_proposals
|
successful_proposals = create_successful_proposals
|
||||||
|
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
within("#proposal_#{proposal.id}_votes") do
|
within("#proposal_#{proposal.id}_votes") do
|
||||||
expect(page).to_not have_link "Create question"
|
expect(page).to_not have_link "Create question"
|
||||||
end
|
end
|
||||||
@@ -1546,7 +1546,7 @@ feature 'Successfull proposals' do
|
|||||||
|
|
||||||
visit proposals_path
|
visit proposals_path
|
||||||
|
|
||||||
successfull_proposals.each do |proposal|
|
successful_proposals.each do |proposal|
|
||||||
within("#proposal_#{proposal.id}_votes") do
|
within("#proposal_#{proposal.id}_votes") do
|
||||||
expect(page).to have_link "Create question"
|
expect(page).to have_link "Create question"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ module CommonActions
|
|||||||
create(:debate, :with_confidence_score, cached_votes_up: 80)]
|
create(:debate, :with_confidence_score, cached_votes_up: 80)]
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_successfull_proposals
|
def create_successful_proposals
|
||||||
[create(:proposal, title: "Winter is coming", question: "Do you speak it?", cached_votes_up: Proposal.votes_needed_for_success + 100),
|
[create(:proposal, title: "Winter is coming", question: "Do you speak it?", cached_votes_up: Proposal.votes_needed_for_success + 100),
|
||||||
create(:proposal, title: "Fire and blood", question: "You talking to me?", cached_votes_up: Proposal.votes_needed_for_success + 1)]
|
create(:proposal, title: "Fire and blood", question: "You talking to me?", cached_votes_up: Proposal.votes_needed_for_success + 1)]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user