-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from NEU-DSG/pr-party
PR party: another!
- Loading branch information
Showing
22 changed files
with
290 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Users::InvitationsController < Devise::InvitationsController | ||
before_action :verify_admin | ||
|
||
protected | ||
|
||
def verify_admin | ||
!current_user.admin_at.nil? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ | |
</div> | ||
|
||
<div id="facet-panel-collapse" class="collapse panel-group"> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,20 +15,24 @@ | |
.col-md-6 | ||
= f.text_field :email, required: true, class: "form-control", placeholder: "Email" | ||
.form-group | ||
= f.label :institution, "Institution", class: "control-label col-md-2" | ||
= f.label :institution_id, "Institution", class: "control-label col-md-2" | ||
.col-md-6 | ||
= f.collection_select(:institution_id, Institution.all, :id, :name, :prompt => 'Please select institution') | ||
= f.select :institution_id, options_for_select(@institutions.map { |i| [i.name, i.id] }, @user.institution_id), required: true, include_blank: true | ||
.form-group | ||
= f.label :account_type, "Account Type", class: "control-label col-md-2" | ||
.col-md-6 | ||
= f.select :account_type, options_for_select([['Free Account', 'free'], ['TEI-C Member Account', 'teic'], ['TEI-C Member via my institution', 'teic_inst']], @user.account_type), {} | ||
- if current_user.admin? | ||
.form-group | ||
= f.label :role, "Admin", class: "control-label col-md-2" | ||
= f.label :admin, "Admin?", class: "control-label col-md-2" | ||
.col-md-6 | ||
.checkbox | ||
= f.select :role, options_for_select([['Admin', 'admin'], ['Unpaid User', 'unpaid_user'], ['Paid User', 'paid_user']], @user.role), {} | ||
|
||
= f.check_box :admin, {:checked => [email protected]_at.nil?} | ||
.form-group | ||
= f.label :paid, "Paid?", class: "control-label col-md-2" | ||
.col-md-6 | ||
.checkbox | ||
= f.check_box :paid, {:checked => [email protected]_at.nil?} | ||
%hr | ||
.form-actions | ||
= f.submit class: ['btn', 'btn-primary', 'btn-large'], value: 'Submit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<h2><%= t "devise.invitations.edit.header" %></h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.hidden_field :invitation_token %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :password %> | ||
<%= f.input :password_confirmation %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, t("devise.invitations.edit.submit_button") %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h2><%= t "devise.invitations.new.header" %></h2> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= f.error_notification %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.input :name, required: true %> | ||
</div> | ||
|
||
<% resource.class.invite_key_fields.each do |field| -%> | ||
<div class="form-inputs"> | ||
<%= f.input field, required: true %> | ||
</div> | ||
<% end -%> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, t("devise.invitations.new.submit_button") %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<p><%= t("devise.mailer.invitation_instructions.hello", email: @resource.email) %></p> | ||
|
||
<p><%= t("devise.mailer.invitation_instructions.someone_invited_you", url: root_url) %></p> | ||
|
||
<p><%= link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, invitation_token: @token) %></p> | ||
|
||
<% if @resource.invitation_due_at %> | ||
<p><%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :'devise.mailer.invitation_instructions.accept_until_format')) %></p> | ||
<% end %> | ||
|
||
<p><%= t("devise.mailer.invitation_instructions.ignore") %></p> |
Oops, something went wrong.