diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index d89822de3..73ad32cdd 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -1409,7 +1409,8 @@ // 09. Polls results and stats // --------------------------- -.polls-results-stats { +.polls-results, +.polls-stats { table { table-layout: fixed; diff --git a/app/components/polls/results_component.html.erb b/app/components/polls/results_component.html.erb new file mode 100644 index 000000000..a112b9dc2 --- /dev/null +++ b/app/components/polls/results_component.html.erb @@ -0,0 +1,22 @@ +<% provide :title, poll.name %> + +
+ <%= render Polls::PollHeaderComponent.new(poll) %> + + <%= render "poll_subnav" %> + +
+ + +
+ <%= render Polls::Results::QuestionComponent.with_collection(poll.questions) %> +
+
+
diff --git a/app/components/polls/results_component.rb b/app/components/polls/results_component.rb new file mode 100644 index 000000000..9da3eb130 --- /dev/null +++ b/app/components/polls/results_component.rb @@ -0,0 +1,7 @@ +class Polls::ResultsComponent < ApplicationComponent + attr_reader :poll + + def initialize(poll) + @poll = poll + end +end diff --git a/app/views/polls/results.html.erb b/app/views/polls/results.html.erb index 8f6cddd44..44af3685a 100644 --- a/app/views/polls/results.html.erb +++ b/app/views/polls/results.html.erb @@ -1,22 +1 @@ -<% provide :title, @poll.name %> - -
- <%= render Polls::PollHeaderComponent.new(@poll) %> - - <%= render "poll_subnav" %> - -
- - -
- <%= render Polls::Results::QuestionComponent.with_collection(@poll.questions) %> -
-
-
+<%= render Polls::ResultsComponent.new(@poll) %> diff --git a/app/views/polls/stats.html.erb b/app/views/polls/stats.html.erb index b99052f48..8c1766181 100644 --- a/app/views/polls/stats.html.erb +++ b/app/views/polls/stats.html.erb @@ -1,6 +1,6 @@ <% provide :title, @poll.name %> -
+
<%= render Polls::PollHeaderComponent.new(@poll) %> <%= render "poll_subnav" %>