Merge pull request #538 from AyuntamientoMadrid/share_proposal

Adds social share for supported proposals
This commit is contained in:
Enrique García
2015-09-22 17:32:45 +02:00
5 changed files with 46 additions and 9 deletions

View File

@@ -1393,6 +1393,37 @@ table {
}
}
.share-supported {
.social-share-button {
display: inline-block;
}
.social-share-button-twitter {
@extend .social-share-button-twitter;
background: none;
color: white;
height: rem-calc(24);
width: rem-calc(48);
}
.social-share-button-facebook {
@extend .social-share-button-facebook;
background: none;
color: white;
height: rem-calc(24);
width: rem-calc(48);
}
.social-share-button-google_plus {
@extend .social-share-button-google_plus;
background: none;
color: white;
height: rem-calc(24);
width: rem-calc(48);
}
}
// 16. Pages
// - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -19,8 +19,8 @@
<div class="in-favor">
<% if voted_for?(@proposal_votes, proposal) %>
<div class="supported">
<%= t("proposals.proposal.already_supported") %>
</div>
<%= t("proposals.proposal.already_supported") %>
</div>
<% else %>
<%= link_to vote_proposal_path(proposal, value: 'yes'),
class: "button button-support tiny radius expand",
@@ -50,4 +50,10 @@
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% if voted_for?(@proposal_votes, proposal) %>
<div class="share-supported">
<%= social_share_button_tag(proposal.title) %>
</div>
<% end %>
</div>

View File

@@ -179,7 +179,7 @@ en:
supports_necessary: "53.726 necessary supports"
census_percent: "2% of census"
total_percent: "100%"
already_supported: "You already supported this proposal!"
already_supported: "You already supported this proposal, share it!"
form:
proposal_title: Proposal title
proposal_question: Proposal question

View File

@@ -179,7 +179,7 @@ es:
supports_necessary: "53.726 apoyos necesarios"
census_percent: "2% del Censo"
total_percent: "100%"
already_supported: "¡Ya has apoyado esta propuesta!"
already_supported: "¡Ya has apoyado esta propuesta, compártela!"
form:
proposal_title: Título de la propuesta
proposal_question: Pregunta de la propuesta

View File

@@ -232,15 +232,15 @@ feature 'Votes' do
within("#proposals") do
within("#proposal_#{proposal1.id}_votes") do
expect(page).to have_content "You already supported this proposal!"
expect(page).to have_content "You already supported this proposal, share it!"
end
within("#proposal_#{proposal2.id}_votes") do
expect(page).to_not have_content "You already supported this proposal!"
expect(page).to_not have_content "You already supported this proposal, share it!"
end
within("#proposal_#{proposal3.id}_votes") do
expect(page).to_not have_content "You already supported this proposal!"
expect(page).to_not have_content "You already supported this proposal, share it!"
end
end
end
@@ -284,7 +284,7 @@ feature 'Votes' do
find('.in-favor a').click
expect(page).to have_content "1 support"
expect(page).to have_content "You already supported this proposal!"
expect(page).to have_content "You already supported this proposal, share it!"
end
end
@@ -295,7 +295,7 @@ feature 'Votes' do
find('.in-favor a').click
expect(page).to have_content "1 support"
expect(page).to have_content "You already supported this proposal!"
expect(page).to have_content "You already supported this proposal, share it!"
end
expect(URI.parse(current_url).path).to eq(proposals_path)
end