forked from crazycode/ThunderSurvey
/
index.html.erb
58 lines (55 loc) · 2.47 KB
/
index.html.erb
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
<% content_for :headers do -%>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("td.title").hover(
function(){$(this).find('.action').toggle()})
})
</script>
<% end -%>
<div class='section_nav'>
<div class='section_title'>
<%= t(:all_surveys) %>
</div>
<div class='section_button'>
<a class='btn' href="#" onclick="window.open('/forms/new', 'StatusBar', 'toolbar=yes,resizable=yes,scrollbars=no,width=820,height=700,left=0,top=0');" title="new form"><%= t(:create_survey) %></a>
</div>
</div>
<% if @forms.empty? %>
<p style="font-size:14px;"><%= t(:no_survey) %><%= link_to t(:create_first_survey), '#', :onclick => "window.open('/forms/new', 'StatusBar', 'toolbar=yes,resizable=yes,scrollbars=no,width=820,height=700,left=0,top=0');" %></p>
<% end %>
<table id='rows' class='grid big' border="0" cellspacing="0" cellpadding="0">
<col width='65%'>
<col width='15%'>
<col width='20%'>
<thead>
<tr>
<th><%= t(:title) %></th>
<th><%= t(:updated_at) %></th>
<th><%= t(:operations) %></th>
</tr>
</thead>
<tbody>
<% @forms.each do |form| %>
<tr id="<%=form.id%>">
<td><a href="#" onclick="window.open('<%=edit_form_path(form, :edit_key => form.edit_key)%>', '<%= form.id %>', 'toolbar=yes,resizable=yes,scrollbars=no,width=820,height=800,left=0,top=0');" title="new form" class='ag' ><%= t(:edit) %></a> <%=link_to form.title,form_rows_path(form, :edit_key => form.edit_key),:class => 'name' %><div class='count'><%= form.klass.count %> <%= t(:answers) %> <%= '>>' unless form.klass.count == 0%></div>
</td>
<td><%= form.updated_at.to_date%></td>
<td class='opt'>
<%= link_to t(:preview), form_path(form), :class => 'ag', :target => '_blank' %>
<%= link_to t(:delete), form_path(form, :edit_key => form.edit_key), :confirm => t(:are_you_sure), :method => 'delete',:class => 'ag' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class='paginate'>
<%=raw(will_paginate @forms,:class => 'flickr_pagination',:previous_label => t(:prev),:next_label => t(:next)) %>
</div>
<% content_for :sidebar do %>
<%= render :partial => t(:sidebar) %>
<% end %>
<%= content_for :pagenav do -%>
<div id="page_nav">
<span><%= t(:my_surveys) %></span>
</div>
<% end %>