mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
75 lines
No EOL
3.4 KiB
Text
75 lines
No EOL
3.4 KiB
Text
.row-fluid
|
|
.span12
|
|
.pull-right{:style=>"margin-top:20px; margin-bottom:20px;"}
|
|
= link_to "New", admin_conference_registrations_new_path(@conference.short_title), :class => "btn btn-primary"
|
|
= link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-success"
|
|
= link_to "Export xlsx", {:format => :xlsx}, :class => "btn btn-success"
|
|
.row-fluid
|
|
.span12
|
|
%h2
|
|
Registrations
|
|
- if @registrations
|
|
= "(#{@registrations.length})"
|
|
= " - Attended (#{@attended})"
|
|
%table.table.table-bordered.table-striped.table-hover#registrations
|
|
%thead
|
|
%th
|
|
No
|
|
- @headers.each do |h|
|
|
- h = h.gsub("_", " ")
|
|
%th
|
|
= h.capitalize
|
|
%th
|
|
%th
|
|
%th
|
|
- counter = 0
|
|
- @registrations.each do |registration|
|
|
%tr
|
|
%td
|
|
= counter +=1
|
|
- @headers.each do |field|
|
|
%td
|
|
- if field == "name"
|
|
#{registration.last_name} #{registration.first_name} (#{registration.irc_nickname}) #{registration.company}
|
|
- if registration.supporter_level && registration.supporter_level.title != 'Free'
|
|
%p{:style => "color:red"}
|
|
= registration.supporter_level.title
|
|
|
|
-elsif field == 'attended'
|
|
= 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"
|
|
|
|
-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)
|
|
|
|
- elsif field == 'arrival' || field == 'departure'
|
|
= registration.send(field.to_sym).strftime("%d %b %H:%M") if registration.send(field.to_sym)
|
|
|
|
- else
|
|
= registration.send(field.to_sym)
|
|
%td
|
|
= link_to "Questions", "#", :class => "questions btn btn-success", :id => counter, :onclick => "toggle('row#{counter}')"
|
|
|
|
%td
|
|
= link_to "Edit", admin_conference_registrations_edit_path(@conference.short_title, :id => registration.id), :method => :get, :class => "btn btn-primary"
|
|
|
|
%td
|
|
= 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}?"
|
|
%tr{:id => "row#{counter}", :style=>"display:none;"}
|
|
%td{:colspan=>13}
|
|
= render :partial => "questions", :locals => {:registration => registration}
|
|
|
|
:javascript
|
|
$(document).ready(function() {
|
|
$('#registrations').dataTable( {
|
|
"bPaginate": false,
|
|
"bLengthChange": false
|
|
} );
|
|
} );
|
|
|
|
function toggle(rowid) {
|
|
if( document.getElementById(rowid).style.display=='none' ){
|
|
document.getElementById(rowid).style.display = '';
|
|
}else{
|
|
document.getElementById(rowid).style.display = 'none';
|
|
}
|
|
}; |