-
Notifications
You must be signed in to change notification settings - Fork 19
/
show.rhtml
129 lines (124 loc) · 4.09 KB
/
show.rhtml
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
<%content_for :head do -%>
<%= javascript_include_tag "swfobject" %>
<%end%>
<%= javascript_include_tag "wz_tooltip.js", :cache => "cache/tooltip" %>
<% if prodmgr? %>
<div id="actionButtons2">
<%= link_to 'Edit', edit_poll_url(@poll), html_options = {:class=> "button",
:onmouseover => "Tip('Edit this poll')"} %>
<%= link_to(
"Publish",
publish_poll_path(:id => @poll),
html_options = { :method => :post, :class=> "button",
:onmouseover => "Tip('Publish this poll')"} ) unless @poll.active %>
<%= link_to(
"Unpublish",
unpublish_poll_path(:id => @poll),
html_options = { :method => :post, :class=> "button",
:onmouseover => "Tip('Unpublish this poll')"} ) if @poll.active %>
<%= link_to 'List Polls', polls_path , html_options = {:class=> "button",
:onmouseover => "Tip('Return to list polls')"}%>
</div>
<% end %>
<div class="formTitle">
<%= theme_image_tag("icons/16x16/polls.png", options = {:alt=>""}) %>
Poll Detail
</div>
<div class="cssform" style="<% if @poll.total_responses > 0 %>width:40%; float:left<% end %>">
<p>
<label for="title">Title:</label>
<%= h @poll.title %>
</p>
<p>
<label for="close_date">Close Date:</label>
<%= h format_date(@poll.close_date) %>
</p>
<% if prodmgr? %>
<p>
<label>Access:</label>
<% if @poll.groups.empty? and @poll.enterprise_types.empty? %>
Public
<% else %>
<% unless @poll.groups.empty? %>
Restricted to the following User Groups:
<% for group in @poll.groups %><br />
• <%= h group.name %><br />
<% end %>
<% end %>
<% unless @poll.enterprise_types.empty? %>
<%= "<br/>" unless @poll.groups.empty? %>
Restricted to the following Enterprise Types:
<% for etype in @poll.enterprise_types %><br />
• <%= h etype.short_name %><br />
<% end %>
<% end %>
<% end %>
</p>
<p>
<label>Public Visible?:</label>
<%= @poll.results_publically_visible %>
</p>
<% end %>
<span class="insideFormTitle">Options</span>
<% for option in @poll.poll_options %>
<p>
<label for="option_description">•</label>
<%= h option.description %>
(<%= number_to_percentage(option.percent_chosen, :precision => 2) %>,
<%= pluralize(option.user_responses.size, 'response') %>)
</p>
<div id='<%= "details#{option.id}" %>' style="<%= details_display_style %>">
<% if prodmgr? %>
<% for user in option.user_responses %>
<p>
→ <%= user.display_name true %>
</p>
<% end %>
<% end %>
</div>
<% end %>
<p>
<label for="total">Total:</label> <%= pluralize(@poll.total_responses, 'response') %>
</p>
<% if prodmgr? %>
<div id="show_images" style="<%= details_button_display_style "SHOW" %>">
<p>
<%= link_to_remote("Show Respondent Details",
{:url => toggle_details_polls_path(:id => @poll)},
{:class => "button"} ) %>
</p>
</div>
<% if prodmgr? %>
<div id="show_comments" style="<%= details_display_style %>">
<% unless @poll.comments.empty? %>
<p>
<label for="comment">Comments:</label>
</p>
<% end %>
<% for comment in @poll.comments %>
<p>
<strong>
<%= user_display_name comment.user %>
wrote at
<%= om_date_time comment.created_at %>:
</strong>
<br/>
<%= comment.body %>
</p>
<% end %>
</div>
<% end %>
<div id="hide_images" style="<%= details_button_display_style "HIDE" %>">
<p>
<%= link_to_remote("Hide Respondent Details",
{:url => toggle_details_polls_path(:id => @poll)},
{:class => "button"} ) %>
</p>
</div>
<% end %>
</div>
<% if @poll.total_responses > 0 %>
<div id="pollChart" style="background-color:#ffffcc;">
<%= @graph %>
</div>
<% end %>