/
results.html.haml
236 lines (215 loc) · 12.5 KB
/
results.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
= content_for :meta do
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
= render :partial => 'shared/header_vote'
.tab-content.question-results
.interior-content
.row-fluid
.span12
%h2= @question.attributes['name']
%table.table.table-striped.ideas-table
%thead
%tr
%th
%h4= t('common.ideas').titleize
%th.score
%h4
= t('common.score').titleize + " (0 - 100)"
= link_to('', '#score_explanation', :"data-toggle" => 'modal', :class => 'glyphicon glyphicon-question-sign')
%th
%tbody
- @choices.each do |choice|
%tr
%td.title= link_to h(truncate(choice.data, :length => 140, :omission => '…')), question_choice_url(@earl.name, choice), :"data-toggle" => "modal-ajax"
%td.span4.choice-progress
.hidden-phone.progress.progress-gray
.bar{:style => "width:#{choice.attributes['score']}%"}
.score
%strong= choice.attributes['score'].round.to_s
.row-fluid
.span12
-if !params[:all]
.pagination
%ul
= paginated = will_paginate @choices, :previous_label => "«", :next_label => "»", :renderer => ::BootstrapPagination, :container => false
-if paginated
%li
=link_to("View All", :action => :results, :all => true)
.row-fluid
#data-vis.span12
%h3.data-vis-header=t('results.data_visualizations')
#visualizations.accordion
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => '#scatter_ideas'}
= link_to(t('results.scatter_ideas_title'), url_for(:action => :scatter_plot_user_vs_seed_ideas, :type => "scatter_ideas"), :"data-preventDefault" => true)
%button.close.hide x
#scatter_ideas.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => '#word_cloud_ideas'}
= link_to(t('results.word_cloud_ideas_title'), url_for(:action => :word_cloud), :"data-preventDefault" => true)
= link_to('', '#word_cloud_exp', :"data-toggle" => 'modal', :class => 'glyphicon glyphicon-question-sign')
%button.close.hide x
#word_cloud_ideas.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => '#word_cloud_weighted'}
= link_to(t('results.word_cloud_weighted_title'), url_for(:action => :word_cloud, :type => 'weight_by_score'), :"data-preventDefault" => true)
= link_to('', '#word_cloud_exp', :"data-toggle" => 'modal', :class => 'glyphicon glyphicon-question-sign')
%button.close.hide x
#word_cloud_weighted.accordion-body.collapse
#wcdiv-weight_by_score.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => '#word_cloud_uploaded'}
= link_to(t('results.word_cloud_uploaded_title'), url_for(:action => :word_cloud, :type => 'uploaded'), :"data-preventDefault" => true)
= link_to('', '#word_cloud_exp', :"data-toggle" => 'modal', :class => 'glyphicon glyphicon-question-sign')
%button.close.hide x
#word_cloud_uploaded.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => '#word_cloud_uploaded_weighted'}
= link_to(t('results.word_cloud_uploaded_weighted_title'), url_for(:action => :word_cloud, :type => 'uploaded_weight_by_score'), :"data-preventDefault" => true)
= link_to('', '#word_cloud_exp', :"data-toggle" => 'modal', :class => 'glyphicon glyphicon-question-sign')
%button.close.hide x
#word_cloud_uploaded_weighted.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => '#world_map_votes'}
= link_to(t('results.world_map_title'), url_for(:action => :voter_map, :type => 'votes'), :"data-preventDefault" => true)
%button.close.hide x
#world_map_votes.accordion-body.collapse.map
.accordion-inner
= image_tag('indicator.gif')
-if @available_charts
-@available_charts.each do |type, options|
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#datechart-#{type}"}
= link_to(options[:title], url_for(:action => :timeline_graph, :type => type), :"data-preventDefault" => true, :id => "#{type}-datechart-view-link")
%button.close.hide x
.accordion-body.collapse{:id => "datechart-#{type}"}
.accordion-inner
= image_tag('indicator.gif')
-if current_user && current_user.admin?
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#density-chart"}
= link_to("View density of votes for this question (super-admin only)", url_for(:action => :density_graph, :type => "density"), :"data-preventDefault" => true)
%button.close.hide x
#density-chart.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#ratings-choices"}
= link_to("View number of ratings of choices by creation time (super-admin only)", url_for(:action => :scatter_num_ratings_by_creation_time, :type => "scatter_num_ideas_by_creation_time"), :"data-preventDefault" => true)
%button.close.hide x
#ratings-choices.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#appearances_per_choice"}
= link_to("View number of appearances per choice by choice creation date (super-admin only)", url_for(:action => :choices_by_creation_date, :type => "choice-by-date"), :"data-preventDefault" => true)
%button.close.hide x
#appearances_per_choice.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#world_map_bounces"}
= link_to("World Map of bounces (viewed once and then left) (super-admin only)", url_for(:action => :voter_map, :type => 'bounces'), :"data-preventDefault" => true)
= link_to('', '#bounce_explanation', :"data-toggle" => 'modal', :class => 'glyphicon glyphicon-question-sign')
%button.close.hide x
#world_map_bounces.accordion-body.collapse.map
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#world_map_uploaded"}
= link_to("World Map of uploaded ideas (super-admin only)", url_for(:action => :voter_map, :type => 'uploaded_ideas'), :"data-preventDefault" => true)
%button.close.hide x
#world_map_uploaded.accordion-body.collapse.map
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#votes_per_session"}
= link_to("View number of votes per session (super-admin only)", url_for(:action => :scatter_votes_by_session, :type => "votes"), :"data-preventDefault" => true)
%button.close.hide x
#votes_per_session.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#skips_per_session"}
= link_to("View number of skips per session (super-admin only)", url_for(:action => :scatter_votes_by_session, :type => "skips"), :"data-preventDefault" => true)
%button.close.hide x
#skips_per_session.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#votes_skips_per_session"}
= link_to("View number of votes vs number of skips per session (super-admin only)", url_for(:action => :scatter_votes_vs_skips, :type => "skips"), :"data-preventDefault" => true)
%button.close.hide x
#votes_skips_per_session.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#skips_per_day"}
= link_to("View number of skips per day (super-admin only)", url_for(:action => :timeline_graph, :type => "skips"), :"data-preventDefault" => true)
%button.close.hide x
#skips_per_day.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
.accordion-group
.accordion-heading
.accordion-toggle{:"data-toggle" => 'collapse', :"data-target" => "#score_vs_votes"}
= link_to("View choice score vs total votes (super-admin only)", url_for(:action => :scatter_score_vs_votes), :"data-preventDefault" => true)
%button.close.hide x
#score_vs_votes.accordion-body.collapse
.accordion-inner
= image_tag('indicator.gif')
#score_explanation.hide.modal.fade
.modal-header
%button.close{:"data-dismiss" => "modal"}x
%h2= t('items.about_scoring')
.modal-body
=t('items.score_explain')
#word_cloud_exp.hide.modal.fade
.modal-header
%button.close{:"data-dismiss" => "modal"}x
%h2= t('results.about_word_cloud')
.modal-body
=t('results.word_cloud_exp')
-if current_user && current_user.admin?
#bounce_explanation.hide.modal.fade
.modal-header
%button.close{:"data-dismiss" => "modal"}x
%h2= "About Bounces"
.modal-body
%p A bounce is defined as a session that has seen exactly one appearance and taken no other action on our site (one 'click' on our site).
%p So if a user refreshes the page after visiting (generates another appearance) they would no longer be considered a bounce.
%p Another example: a user that views the voting page, then view results, then leaves, would not be considered a bounce.
%p Note that this may not be 100% accurate because of the way that firefox save cookies past their intended expiration date.
-content_for :head do
= render :partial => "shared/highcharts_header"
= render :partial => "shared/google_jsapi"
= '<script type="text/javascript" src="http://www.google.com/uds/?file=visualization&v=1"></script>'
= javascript_include_tag 'google-termcloud.js'
= stylesheet_link_tag 'google-termcloud'
:javascript
var results_view_text = function(){ return "#{t('results.view_link')}";};
var results_close_text = function(){ return "#{t('results.close_link')}";};