fixes typo

This commit is contained in:
rgarcia
2016-11-19 14:03:10 +01:00
parent 724dac4df2
commit e12f183775
17 changed files with 67 additions and 67 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 %>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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">

View File

@@ -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 %>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -289,16 +289,16 @@ feature 'Users' do
scenario 'Sign in, admin with password expired' do scenario 'Sign in, admin with password expired' do
user = create(:user, password_changed_at: Time.now - 1.year) user = create(:user, password_changed_at: Time.now - 1.year)
admin = create(:administrator, user: user) admin = create(:administrator, user: user)
login_as(admin.user) login_as(admin.user)
visit root_path visit root_path
expect(page).to have_content "Your password is expired" expect(page).to have_content "Your password is expired"
fill_in 'user_current_password', with: 'judgmentday' fill_in 'user_current_password', with: 'judgmentday'
fill_in 'user_password', with: '123456789' fill_in 'user_password', with: '123456789'
fill_in 'user_password_confirmation', with: '123456789' fill_in 'user_password_confirmation', with: '123456789'
click_button 'Change your password' click_button 'Change your password'
expect(page).to have_content "Password successfully updated" expect(page).to have_content "Password successfully updated"
@@ -307,37 +307,37 @@ feature 'Users' do
scenario 'Sign in, admin without password expired' do scenario 'Sign in, admin without password expired' do
user = create(:user, password_changed_at: Time.now - 360.days) user = create(:user, password_changed_at: Time.now - 360.days)
admin = create(:administrator, user: user) admin = create(:administrator, user: user)
login_as(admin.user) login_as(admin.user)
visit root_path visit root_path
expect(page).to_not have_content "Your password is expired" expect(page).to_not have_content "Your password is expired"
end end
scenario 'Sign in, user with password expired' do scenario 'Sign in, user with password expired' do
user = create(:user, password_changed_at: Time.now - 1.year) user = create(:user, password_changed_at: Time.now - 1.year)
login_as(user) login_as(user)
visit root_path visit root_path
expect(page).to_not have_content "Your password is expired" expect(page).to_not have_content "Your password is expired"
end end
scenario 'Admin with password expired trying to use same password' do scenario 'Admin with password expired trying to use same password' do
user = create(:user, password_changed_at: Time.now - 1.year, password: '123456789') user = create(:user, password_changed_at: Time.now - 1.year, password: '123456789')
admin = create(:administrator, user: user) admin = create(:administrator, user: user)
login_as(admin.user) login_as(admin.user)
visit root_path visit root_path
expect(page).to have_content "Your password is expired" expect(page).to have_content "Your password is expired"
fill_in 'user_current_password', with: 'judgmentday' fill_in 'user_current_password', with: 'judgmentday'
fill_in 'user_password', with: '123456789' fill_in 'user_password', with: '123456789'
fill_in 'user_password_confirmation', with: '123456789' fill_in 'user_password_confirmation', with: '123456789'
click_button 'Change your password' click_button 'Change your password'
expect(page).to have_content "must be different than the current password." expect(page).to have_content "must be different than the current password."
end end
end end

View File

@@ -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