mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 13:44:09 +00:00
question builder
This commit is contained in:
parent
4356616566
commit
3105c8da5d
28 changed files with 338 additions and 15 deletions
|
|
@ -11,7 +11,7 @@
|
|||
- if @registrations
|
||||
= "(#{@registrations.length})"
|
||||
= " - Attended (#{@attended})"
|
||||
%table.table.table-striped.table-bordered.table-hover#registrations
|
||||
%table.table.table-bordered.table-striped.table-hover#registrations
|
||||
%thead
|
||||
%th
|
||||
No
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
= h.capitalize
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
- counter = 0
|
||||
- @registrations.each do |registration|
|
||||
%tr
|
||||
|
|
@ -45,11 +46,17 @@
|
|||
|
||||
- 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() {
|
||||
|
|
@ -58,3 +65,11 @@
|
|||
"bLengthChange": false
|
||||
} );
|
||||
} );
|
||||
|
||||
function toggle(rowid) {
|
||||
if( document.getElementById(rowid).style.display=='none' ){
|
||||
document.getElementById(rowid).style.display = '';
|
||||
}else{
|
||||
document.getElementById(rowid).style.display = 'none';
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue