osem-fcy/app/views/admin/registrations/show.html.haml

61 lines
2.9 KiB
Text
Raw Normal View History

2013-01-07 09:04:09 +01:00
.row-fluid
.span12
.pull-right{:style=>"margin-top:20px; margin-bottom:20px;"}
2013-07-12 17:40:27 +03:00
= link_to "New", admin_conference_registrations_new_path(@conference.short_title), :class => "btn btn-primary"
2013-01-07 09:04:09 +01:00
= link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-success"
2013-07-16 09:47:23 +02:00
= link_to "Export xlsx", {:format => :xlsx}, :class => "btn btn-success"
2013-01-07 09:04:09 +01:00
.row-fluid
.span12
%h2
Registrations
- if @registrations
= "(#{@registrations.length})"
2013-07-16 09:47:23 +02:00
= " - Attended (#{@attended})"
2013-07-12 10:45:40 +03:00
%table.table.table-striped.table-bordered.table-hover#registrations
2013-01-07 09:04:09 +01:00
%thead
%th
2013-07-12 10:45:40 +03:00
No
- @headers.each do |h|
- h = h.gsub("_", " ")
%th
= h.capitalize
2013-01-07 09:04:09 +01:00
%th
%th
2013-07-12 10:45:40 +03:00
- counter = 0
2013-01-07 09:04:09 +01:00
- @registrations.each do |registration|
%tr
%td
2013-07-12 10:45:40 +03:00
= counter +=1
- @headers.each do |field|
%td
- if field == "name"
#{registration.last_name} #{registration.first_name} (#{registration.irc_nickname}) #{registration.company}
2013-07-15 13:20:28 +03:00
- if registration.supporter_level && registration.supporter_level.title != 'Free'
%p{:style => "color:red"}
2013-07-15 13:20:28 +03:00
= registration.supporter_level.title
2013-07-12 10:45:40 +03:00
2013-07-12 19:11:47 +03:00
-elsif field == 'attended'
2013-07-12 20:24:08 +03:00
= link_to "#{registration.send(field.to_sym)}", admin_conference_registrations_change_field_path(@conference.short_title, :id => registration.id, :view_field => "#{field}"), :method => :put, ":#{field}" => registration.send(field.to_sym), :class => "btn btn-success"
2013-07-12 10:45:40 +03:00
-elsif (registration.send(field.to_sym).class == TrueClass || registration.send(field.to_sym).class == FalseClass)
= link_to "#{registration.send(field.to_sym)}", admin_conference_registrations_change_field_path(@conference.short_title, :id => registration.id, :view_field => "#{field}"), :method => :put, ":#{field}" => registration.send(field.to_sym)
2013-07-12 20:24:08 +03:00
2013-07-12 10:45:40 +03:00
- elsif field == 'arrival' || field == 'departure'
= registration.send(field.to_sym).strftime("%d %b %H:%M") if registration.send(field.to_sym)
2013-07-12 20:24:08 +03:00
2013-07-12 10:45:40 +03:00
- else
= registration.send(field.to_sym)
2013-01-07 09:04:09 +01:00
%td
2013-07-12 11:43:31 +03:00
= link_to "Edit", admin_conference_registrations_edit_path(@conference.short_title, :id => registration.id), :method => :get, :class => "btn btn-primary"
2013-01-07 09:04:09 +01:00
%td
2013-07-12 10:54:59 +03:00
= link_to "Delete", admin_conference_registrations_path(@conference.short_title, :id => registration.id), :method => :delete, :class => "btn btn-danger", :confirm => "Really delete registration for #{registration.public_name} #{registration.email}?"
2013-07-12 10:45:40 +03:00
:javascript
$(document).ready(function() {
$('#registrations').dataTable( {
"bPaginate": false,
"bLengthChange": false
} );
2013-07-16 09:47:23 +02:00
} );