This way it'll be easier to refactor it. Note there was a system test which tested both the callout and the form when unverified users visit a poll. We've split this system test in two component tests.
61 lines
2.1 KiB
Plaintext
61 lines
2.1 KiB
Plaintext
<%= provide :title, t("social_share.polls_show.title_#{@poll.id}", default: @poll.title) %>
|
|
<%= provide :meta_description, t("social_share.polls_show.description_#{@poll.id}", default: @poll.title) %>
|
|
<%= provide :social_media_meta_tags do %>
|
|
<%= render "shared/social_media_meta_tags",
|
|
social_url: poll_url,
|
|
social_title: t("social_share.polls_show.title_#{@poll.id}", default: @poll.title),
|
|
social_description: t("social_share.polls_show.facebook_#{@poll.id}", default: @poll.title),
|
|
twitter_image_url: "social_media_polls_twitter.jpg",
|
|
og_image_url: "social_media_polls.jpg" %>
|
|
<% end %>
|
|
|
|
<div class="polls-show">
|
|
<%= render Polls::PollHeaderComponent.new(@poll) %>
|
|
|
|
<%= render "poll_subnav" %>
|
|
|
|
<div class="row margin">
|
|
<div class="small-12 medium-9 column">
|
|
<%= render Polls::CalloutComponent.new(@poll) %>
|
|
|
|
<% if @poll.voted_in_booth?(current_user) %>
|
|
<div class="callout warning">
|
|
<%= t("polls.show.already_voted_in_booth") %>
|
|
</div>
|
|
<% else %>
|
|
|
|
<% if current_user && @poll.voted_in_web?(current_user) && !@poll.expired? %>
|
|
<div class="callout warning">
|
|
<%= t("polls.show.already_voted_in_web") %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= render Polls::FormComponent.new(@web_vote) %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="expanded poll-more-info">
|
|
<div class="row margin">
|
|
<div class="small-12 medium-9 column">
|
|
<h2><%= t("polls.show.more_info_title") %></h2>
|
|
<%= auto_link_already_sanitized_html simple_format(@poll.description) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="poll_more_info_options" class="expanded poll-more-info-options">
|
|
<div class="row padding">
|
|
<%= render Polls::Questions::ReadMoreComponent.with_collection(@web_vote.questions) %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tabs-content" data-tabs-content="polls_tabs">
|
|
<%= render "filter_subnav" %>
|
|
|
|
<div class="tabs-panel is-active" id="tab-comments">
|
|
<%= render "comments" %>
|
|
</div>
|
|
</div>
|
|
</div>
|