Count events and use datatables, put all tables into wells
This commit is contained in:
parent
3022e8b8e6
commit
39ca877e5e
4 changed files with 144 additions and 125 deletions
|
|
@ -1,53 +1,65 @@
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.span12
|
.span12
|
||||||
%table.table.table-striped.table-bordered.table-hover
|
%h2
|
||||||
%thead
|
Events
|
||||||
%th
|
- if @events
|
||||||
%b Title
|
= "(#{@events.length})"
|
||||||
%th
|
.well
|
||||||
%b Submitter
|
%table.table.table-striped.table-bordered.table-hover#events
|
||||||
%th
|
%thead
|
||||||
%b Type
|
%th
|
||||||
%th
|
%b Title
|
||||||
%b State
|
%th
|
||||||
- @events.each do |event|
|
%b Submitter
|
||||||
%tr
|
%th
|
||||||
%td
|
%b Type
|
||||||
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
|
%th
|
||||||
%td
|
%b State
|
||||||
- if !event.submitter.nil?
|
- @events.each do |event|
|
||||||
=link_to event.submitter.public_name, admin_person_path(event.submitter)
|
%tr
|
||||||
- else
|
%td
|
||||||
Unknown submitter
|
=link_to event.title, admin_conference_event_path(@conference.short_title, event)
|
||||||
%td
|
%td
|
||||||
= event.event_type.title
|
- if !event.submitter.nil?
|
||||||
%td
|
=link_to event.submitter.public_name, admin_person_path(event.submitter)
|
||||||
- if event.state == "withdrawn"
|
- else
|
||||||
Withdrawn
|
Unknown submitter
|
||||||
- else
|
%td
|
||||||
.dropdown
|
= event.event_type.title
|
||||||
= link_to "#", :class => "dropdown-toggle" do
|
%td
|
||||||
= event.state.humanize
|
- if event.state == "withdrawn"
|
||||||
<b class="caret"></b>
|
Withdrawn
|
||||||
%ul.dropdown-menu
|
- else
|
||||||
- if event.transition_possible? :accept
|
.dropdown
|
||||||
%li= link_to "Accept event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => false),
|
= link_to "#", :class => "dropdown-toggle" do
|
||||||
:method => :put, :hint => "Accept this event without sending an automated email."
|
= event.state.humanize
|
||||||
%li= link_to "Accept event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => true),
|
<b class="caret"></b>
|
||||||
:method => :put, :hint => "Accept this event and send an automated email."
|
%ul.dropdown-menu
|
||||||
- if event.transition_possible? :reject
|
- if event.transition_possible? :accept
|
||||||
%li= link_to "Reject event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => false),
|
%li= link_to "Accept event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => false),
|
||||||
:method => :put, :confirm => "Are you sure?",
|
:method => :put, :hint => "Accept this event without sending an automated email."
|
||||||
:hint => "Reject this event without sending an automated email."
|
%li= link_to "Accept event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :accept, :send_mail => true),
|
||||||
%li= link_to "Reject event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => true),
|
:method => :put, :hint => "Accept this event and send an automated email."
|
||||||
:method => :put, :confirm => "Are you sure?",
|
- if event.transition_possible? :reject
|
||||||
:hint => "Reject this event and send an automated email."
|
%li= link_to "Reject event (no email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => false),
|
||||||
- if event.transition_possible? :start_review
|
:method => :put, :confirm => "Are you sure?",
|
||||||
%li= link_to "Start review", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :start_review),
|
:hint => "Reject this event without sending an automated email."
|
||||||
:method => :put
|
%li= link_to "Reject event (WITH email)", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :reject, :send_mail => true),
|
||||||
- if event.transition_possible? :confirm
|
:method => :put, :confirm => "Are you sure?",
|
||||||
%li= link_to "Confirm event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :confirm),
|
:hint => "Reject this event and send an automated email."
|
||||||
:method => :put, :hint => "Confirm that the speaker(s) will be present and that the event will actually take place."
|
- if event.transition_possible? :start_review
|
||||||
- if event.transition_possible? :cancel
|
%li= link_to "Start review", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :start_review),
|
||||||
%li= link_to "Cancel event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :cancel),
|
:method => :put
|
||||||
:method => :put, :hint => "Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance."
|
- if event.transition_possible? :confirm
|
||||||
|
%li= link_to "Confirm event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :confirm),
|
||||||
|
:method => :put, :hint => "Confirm that the speaker(s) will be present and that the event will actually take place."
|
||||||
|
- if event.transition_possible? :cancel
|
||||||
|
%li= link_to "Cancel event", update_state_admin_conference_event_path(@conference.short_title, event, :transition => :cancel),
|
||||||
|
:method => :put, :hint => "Mark this event as cancelled. Usually this means that the speakers had to cancel their appearance."
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#events').dataTable( {
|
||||||
|
"bPaginate": false
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
|
||||||
|
|
@ -2,31 +2,34 @@
|
||||||
People
|
People
|
||||||
- if @people
|
- if @people
|
||||||
= "(#{@people.length})"
|
= "(#{@people.length})"
|
||||||
%table.table.table-striped.table-bordered.table-hover#people
|
.well
|
||||||
%thead
|
%table.table.table-striped.table-bordered.table-hover#people
|
||||||
%th
|
%thead
|
||||||
%b Email
|
%th
|
||||||
%th
|
%b Email
|
||||||
%b Last Name
|
%th
|
||||||
%th
|
%b Last Name
|
||||||
%b First Name
|
%th
|
||||||
%th
|
%b First Name
|
||||||
%b Public Name
|
%th
|
||||||
%th
|
%b Public Name
|
||||||
%b # of Conference Registrations
|
%th
|
||||||
%th
|
%b # of Conference Registrations
|
||||||
- @people.each do |person|
|
%th
|
||||||
%tr
|
- @people.each do |person|
|
||||||
%td= person.email
|
%tr
|
||||||
%td= person.last_name
|
%td= person.email
|
||||||
%td= person.first_name
|
%td= person.last_name
|
||||||
%td= person.public_name
|
%td= person.first_name
|
||||||
%td= person.registrations.count
|
%td= person.public_name
|
||||||
%td= link_to "View", admin_person_path(person)
|
%td= person.registrations.count
|
||||||
|
%td= link_to "View", admin_person_path(person)
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#people').dataTable( {
|
$('#people').dataTable( {
|
||||||
sPaginationType: "full_numbers"
|
"bScrollInfinite": true,
|
||||||
|
"bScrollCollapse": true,
|
||||||
|
"sScrollY": "200px"
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
= link_to "New Supporter", "#", :id => "new-supporter-button", :class => "btn btn-success"
|
= link_to "New Supporter", "#", :id => "new-supporter-button", :class => "btn btn-success"
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.span12
|
.span12
|
||||||
|
%h2 Supporters
|
||||||
.well
|
.well
|
||||||
%table.table.table-striped#supporters
|
%table.table.table-striped#supporters
|
||||||
%thead
|
%thead
|
||||||
|
|
|
||||||
|
|
@ -5,63 +5,66 @@
|
||||||
Users
|
Users
|
||||||
- if @users
|
- if @users
|
||||||
= "(#{@users.length})"
|
= "(#{@users.length})"
|
||||||
%table.table.table-striped.table-bordered.table-hover#users
|
.well
|
||||||
%thead
|
%table.table.table-striped.table-bordered.table-hover#users
|
||||||
%th
|
%thead
|
||||||
%b Email
|
%th
|
||||||
%th
|
%b Email
|
||||||
%b Last Name
|
%th
|
||||||
%th
|
%b Last Name
|
||||||
%b First Name
|
%th
|
||||||
%th
|
%b First Name
|
||||||
%b Public Name
|
%th
|
||||||
%th
|
%b Public Name
|
||||||
%b Roles
|
%th
|
||||||
%th
|
%b Roles
|
||||||
%th
|
%th
|
||||||
- @users.each do |user|
|
%th
|
||||||
%tr
|
- @users.each do |user|
|
||||||
%td
|
%tr
|
||||||
= user.email
|
%td
|
||||||
%td
|
= user.email
|
||||||
= user.last_name
|
%td
|
||||||
%td
|
= user.last_name
|
||||||
= user.first_name
|
%td
|
||||||
%td
|
= user.first_name
|
||||||
= user.public_name
|
%td
|
||||||
%td
|
= user.public_name
|
||||||
= user.roles.map { |role| role.name }.join ','
|
%td
|
||||||
%td
|
= user.roles.map { |role| role.name }.join ','
|
||||||
.modal.hide.fade{:id => "user-role-selection-#{user.id}", "role" => "dialog", "aria-hidden" => "true"}
|
%td
|
||||||
.modal-header
|
.modal.hide.fade{:id => "user-role-selection-#{user.id}", "role" => "dialog", "aria-hidden" => "true"}
|
||||||
%button{"type"=>"button", :class=>"close", "data-dismiss"=>"modal", "aria-hidden"=>"true"}
|
.modal-header
|
||||||
×
|
%button{"type"=>"button", :class=>"close", "data-dismiss"=>"modal", "aria-hidden"=>"true"}
|
||||||
%h3{:id => "role-selector-header-#{user.id}"}
|
×
|
||||||
Modifying Roles
|
%h3{:id => "role-selector-header-#{user.id}"}
|
||||||
.modal-body
|
Modifying Roles
|
||||||
- if current_user == user
|
.modal-body
|
||||||
You cannot modify your own role!
|
- if current_user == user
|
||||||
%br
|
You cannot modify your own role!
|
||||||
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
%br
|
||||||
Cancel
|
|
||||||
|
|
||||||
- else
|
|
||||||
= "Give #{user.public_name} (#{user.email}) the following roles:"
|
|
||||||
= semantic_form_for(user, :url => admin_user_path(user), :method => :put) do |f|
|
|
||||||
= f.input :roles, :label => false
|
|
||||||
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
||||||
Cancel
|
Cancel
|
||||||
= f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"}
|
|
||||||
=link_to "Modify Roles", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}}"
|
- else
|
||||||
%td
|
= "Give #{user.public_name} (#{user.email}) the following roles:"
|
||||||
=link_to "Details", "javascript: void(0)", :class => "user-details-popover", "data-trigger" => "click", "data-placement" => "bottom",
|
= semantic_form_for(user, :url => admin_user_path(user), :method => :put) do |f|
|
||||||
"data-html" => "true",
|
= f.input :roles, :label => false
|
||||||
"data-content" => user.popup_details,
|
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
|
||||||
"data-original-title" => ""
|
Cancel
|
||||||
|
= f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"}
|
||||||
|
=link_to "Modify Roles", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}}"
|
||||||
|
%td
|
||||||
|
=link_to "Details", "javascript: void(0)", :class => "user-details-popover", "data-trigger" => "click", "data-placement" => "bottom",
|
||||||
|
"data-html" => "true",
|
||||||
|
"data-content" => user.popup_details,
|
||||||
|
"data-original-title" => ""
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#users').dataTable( {
|
$('#users').dataTable( {
|
||||||
sPaginationType: "full_numbers"
|
"bScrollInfinite": true,
|
||||||
|
"bScrollCollapse": true,
|
||||||
|
"sScrollY": "200px"
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue