add invites actions in controller and views
Index is added so organizer can see who they have invited. Oganizers will now be able to invite users with their email.Organizer will be able to delete and edit a invite.Add test for actions.
This commit is contained in:
parent
654760c3fc
commit
1c04e820b8
9 changed files with 279 additions and 3 deletions
11
app/views/admin/invites/edit.html.haml
Normal file
11
app/views/admin/invites/edit.html.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 Edit Invitation
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@invite, url: admin_conference_invite_path(@conference.short_title), html: { multipart: true }) do |f|
|
||||
= f.input :invite_for, as: :select, collection: ['Track', (t 'booth').capitalize]
|
||||
= f.input :end_date, as: :string, input_html: { id: 'invitation-end-date', end_date: @conference.end_date }
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||
42
app/views/admin/invites/index.html.haml
Normal file
42
app/views/admin/invites/index.html.haml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Invitations
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
- if @invites.present?
|
||||
%table.datatable
|
||||
%thead
|
||||
%th
|
||||
%b ID
|
||||
%th
|
||||
%b User
|
||||
%th
|
||||
%b Invited for
|
||||
%th
|
||||
%b Invitation validity
|
||||
%th
|
||||
%b Action
|
||||
|
||||
- @invites.each do |invite|
|
||||
%tr
|
||||
%td
|
||||
= invite.id
|
||||
%td
|
||||
= invite.emails
|
||||
%td
|
||||
= invite.invite_for
|
||||
%td
|
||||
= invite.end_date
|
||||
%td
|
||||
= link_to 'Edit', edit_admin_conference_invite_path(@conference.short_title, invite.id),
|
||||
class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_conference_invite_path(@conference.short_title, invite.id), method: :delete,
|
||||
data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
|
||||
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
- if can? :create, Invite
|
||||
= link_to 'Late Submission Invite', new_admin_conference_invite_path(@conference.short_title), class: 'button btn btn-success'
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
= f.input :end_date, as: :string, input_html: { id: 'invitation-end-date', end_date: @conference.end_date }
|
||||
%p.text-right
|
||||
= f.submit 'Submit', class: 'btn btn-success'
|
||||
= link_to 'View Invitations', admin_conference_invites_path, class: 'btn btn-primary'
|
||||
|
||||
:javascript
|
||||
$(document).ready(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue