Drop Organization Feature
This commit is contained in:
parent
dc1a6a4363
commit
275be8c80a
28 changed files with 22 additions and 402 deletions
|
|
@ -1,10 +1,6 @@
|
|||
%h4
|
||||
Basic Information
|
||||
%hr
|
||||
- if f.object.new_record?
|
||||
.form-group
|
||||
= f.label :organization, "Organization"
|
||||
= f.select :organization_id, Organization.accessible_by(current_ability, :update).pluck(:name, :id)
|
||||
.form-group
|
||||
= f.label :title, "Title"
|
||||
%abbr{title: 'This field is required'} *
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
= form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f|
|
||||
.form-group
|
||||
= f.label :name, "Name"
|
||||
%abbr{title: 'This field is required'} *
|
||||
= f.text_field :name, required: true, class: 'form-control', placeholder: 'Name'
|
||||
.form-group
|
||||
= f.text_area :description, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Decribe about your organization...'
|
||||
%span.help-block
|
||||
= markdown_hint
|
||||
.form-group
|
||||
= f.text_area :code_of_conduct, rows: 10, data: { provide: 'markdown' }, class: 'form-control', placeholder: 'Rules governing behavior and dispute resolution...'
|
||||
%span.help-block
|
||||
= markdown_hint
|
||||
.form-group
|
||||
= image_tag f.object.picture.thumb.url if f.object.picture?
|
||||
= f.file_field :picture
|
||||
%p.text-right
|
||||
%button{type: 'submit', class: 'btn btn-success'}
|
||||
- if @organization.new_record?
|
||||
Create Organization
|
||||
- else
|
||||
Update Organization
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
.page-header
|
||||
%h3 Users (#{users.length})
|
||||
- if users.present?
|
||||
%table.datatable#users
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Email
|
||||
- if ( can? :unassign_org_admins, organization )
|
||||
%th
|
||||
Actions
|
||||
%tbody
|
||||
- users.each do |user|
|
||||
%tr
|
||||
%td= user.name
|
||||
%td= user.email
|
||||
- if ( can? :unassign_org_admins, organization )
|
||||
%td
|
||||
= link_to 'Remove from organization admin',
|
||||
unassign_org_admins_admin_organization_path(organization.id,
|
||||
role.name,
|
||||
user: {email: user.email}),
|
||||
method: :delete,
|
||||
class: 'btn btn-danger'
|
||||
- else
|
||||
%h5 No users found!
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Edit Organization
|
||||
= @organization.name
|
||||
.row
|
||||
.col-md-8
|
||||
= render partial: 'form'
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1 Organizations
|
||||
- if can? :manage, :all
|
||||
.btn-group.pull-right
|
||||
= link_to 'Create Organization', new_admin_organization_path, class: 'btn btn-success pull-right'
|
||||
%p.text-muted
|
||||
Manage organizations in OSEM
|
||||
.row
|
||||
.col-md-12
|
||||
%table.datatable
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Upcoming Conferences
|
||||
%th Past Conferences
|
||||
%th Code of Conduct?
|
||||
%th Actions
|
||||
%tbody
|
||||
- @organizations.each do |organization|
|
||||
%tr{ id: "organization-#{organization.id}" }
|
||||
%td
|
||||
= organization.name
|
||||
%td
|
||||
= organization.conferences.upcoming.count
|
||||
%td
|
||||
= organization.conferences.past.count
|
||||
%td.text-center
|
||||
- unless organization.code_of_conduct.blank?
|
||||
= icon 'fa-solid', 'check', title: 'yes'
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Admins', admins_admin_organization_path(organization),
|
||||
method: :get, class: 'btn btn-success'
|
||||
= link_to 'Edit', edit_admin_organization_path(organization),
|
||||
method: :get, class: 'btn btn-primary'
|
||||
= link_to 'Delete', admin_organization_path(organization),
|
||||
method: :delete, class: 'btn btn-danger', data: { confirm: "Warning: This will delete #{organization.name} and all its data which includes data for all conferences within #{organization.name}. Do you really want to continue?" }
|
||||
= link_to 'Add Conference', new_admin_conference_path, method: :get, class: 'btn btn-info'
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Create Organization
|
||||
.row
|
||||
.col-md-8
|
||||
= render partial: 'form'
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.page-header
|
||||
%h2
|
||||
Organization admins for #{@organization.name}
|
||||
.text-muted
|
||||
= @role.description
|
||||
|
||||
.row.col-md-3
|
||||
- if ( can? :assign_org_admins, @organization )
|
||||
= form_for :user, url: assign_org_admins_admin_organization_path(@organization, @role.name), method: :post do |f|
|
||||
.form-group
|
||||
= f.label :email, 'Add user by email: '
|
||||
= f.text_field :email, placeholder: "User's email", class: 'form-control', required: true
|
||||
= f.submit 'Add', id: 'user-add', class: 'btn btn-primary'
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= render partial: 'users_with_org_admin_role',
|
||||
locals: { users: @users, organization: @organization, role: @role }
|
||||
|
|
@ -7,26 +7,13 @@
|
|||
end
|
||||
|
||||
- case version.item_type
|
||||
- when 'Organization'
|
||||
organization
|
||||
= link_to_organization(version.item_id)
|
||||
|
||||
- when 'UsersRole'
|
||||
- role = current_or_last_object_state('Role', object.role_id)
|
||||
- role_name = role.try(:name) || PaperTrail::Version.where(item_type: 'Role', item_id: object.role_id).last.changeset[:name].second
|
||||
role
|
||||
- if role_name == 'organization_admin'
|
||||
- if Organization.find_by(id: version.conference_id)
|
||||
-# organization_admin belongs to organization and not conferences
|
||||
- organization = Organization.find_by(id: version.conference_id)
|
||||
= link_if_alive version, role_name,
|
||||
admins_admin_organization_path(organization), organization
|
||||
- else
|
||||
(Deleted Organization)
|
||||
- else
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
= link_if_alive version, role.try(:name), admin_conference_role_path(conference_short_title,role.try(:name) || ' '), conference
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
= link_if_alive version, role.try(:name), admin_conference_role_path(conference_short_title,role.try(:name) || ' '), conference
|
||||
|
||||
= version.event == 'create' ? 'to' : 'from'
|
||||
user
|
||||
|
|
@ -133,19 +120,10 @@
|
|||
- when 'Role'
|
||||
role
|
||||
- role_name = object.try(:name) || PaperTrail::Version.where(item_type: 'Role', item_id: version.item_id).last.changeset[:name].second
|
||||
- if role_name == 'organization_admin'
|
||||
- if Organization.find_by(id: version.conference_id)
|
||||
-# organization_admin belongs to organization and not conferences
|
||||
- organization = Organization.find_by(id: version.conference_id)
|
||||
= link_if_alive version, role_name,
|
||||
admins_admin_organization_path(organization), organization
|
||||
- else
|
||||
(Role Deleted)
|
||||
- else
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
= link_if_alive version, role_name,
|
||||
admin_conference_role_path(conference_short_title, role_name), conference
|
||||
- conference = Conference.find_by(id: version.conference_id)
|
||||
- conference_short_title = conference.try(:short_title) || current_or_last_object_state('Conference', version.conference_id).try(:short_title) || ' '
|
||||
= link_if_alive version, role_name,
|
||||
admin_conference_role_path(conference_short_title, role_name), conference
|
||||
|
||||
- when 'Venue'
|
||||
venue
|
||||
|
|
@ -202,16 +180,8 @@
|
|||
user
|
||||
= link_to_user(version.item_id)
|
||||
|
||||
- unless %w(Conference Subscription Registration User Organization).include?(version.item_type)
|
||||
- if (version.item_type == 'Role' && role_name == 'organization_admin') || (version.item_type == 'UsersRole' && role_name == 'organization_admin')
|
||||
in organization
|
||||
- if Organization.find_by(id: version.conference_id)
|
||||
-# organization_admin belongs to organization and not conferences
|
||||
- organization = Organization.find_by(id: version.conference_id)
|
||||
= link_to_organization(version.conference_id)
|
||||
- else
|
||||
(Organization Deleted)
|
||||
- elsif version.item_type == 'Commercial'
|
||||
- unless %w(Conference Subscription Registration User).include?(version.item_type)
|
||||
- if version.item_type == 'Commercial'
|
||||
- commercial = current_or_last_object_state(version.item_type, version.item_id)
|
||||
- commercialable = current_or_last_object_state(commercial.commercialable_type, commercial.commercialable_id)
|
||||
- unless commercial.commercialable_type == 'Conference'
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@
|
|||
(Scheduled on: #{event.time.to_date})
|
||||
%br
|
||||
|
||||
= render 'conferences/code_of_conduct', organization: @conference.organization
|
||||
= render 'conferences/code_of_conduct'
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@
|
|||
You need to accept the
|
||||
= link_to 'Code of Conduct', '#',
|
||||
data: { toggle: 'modal', target: '#modal-code-of-conduct'}
|
||||
= render 'conferences/code_of_conduct',
|
||||
organization: @conference.organization
|
||||
= render 'conferences/code_of_conduct'
|
||||
- if @conference.surveys.for_registration.any?
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
data: { toggle: 'modal', target: '#modal-code-of-conduct'}
|
||||
|
||||
- content_for :modals do
|
||||
- cache [organization, '#CoC-modal'] do
|
||||
- cache '#CoC-modal' do
|
||||
.modal.fade{ id: "modal-code-of-conduct" }
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
|
|
@ -13,8 +13,6 @@
|
|||
%i.fa-solid.fa-xmark
|
||||
%h3.modal-title Code of Conduct
|
||||
.modal-body
|
||||
= markdown organization.code_of_conduct
|
||||
= markdown conference.code_of_conduct
|
||||
.modal-footer
|
||||
= link_to 'permalink',
|
||||
[:code_of_conduct, organization],
|
||||
target: '_blank'
|
||||
= link_to 'permalink', :code_of_conduct
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@
|
|||
- if conference.program and conference.program.schedule_public
|
||||
= link_to "Schedule", conference_schedule_path(conference.short_title), class: 'btn btn-default'
|
||||
- unless conference.code_of_conduct.blank?
|
||||
= link_to "Code of Conduct",
|
||||
[:code_of_conduct, conference.organization],
|
||||
class: 'btn btn-default'
|
||||
= link_to "Code of Conduct", :code_of_conduct, class: 'btn btn-default'
|
||||
- if conference.registration_open?
|
||||
- if conference.user_registered?(current_user)
|
||||
= link_to "My Registration", conference_conference_registration_path(conference.short_title), class: 'btn btn-default'
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#splash
|
||||
- if @conference.code_of_conduct.present?
|
||||
= render 'code_of_conduct', organization: @conference.organization
|
||||
= render 'code_of_conduct'
|
||||
|
||||
-# header/description
|
||||
= render 'header', conference: @conference, venue: @conference.venue
|
||||
|
|
|
|||
|
|
@ -27,18 +27,8 @@
|
|||
= link_to(admin_users_path) do
|
||||
%span.fa-solid.fa-user
|
||||
Users
|
||||
- if can? :index, Organization
|
||||
%li
|
||||
= link_to(admin_organizations_path) do
|
||||
%span.fa-solid.fa-users
|
||||
Organizations
|
||||
- if can? :index, PaperTrail::Version
|
||||
%li
|
||||
= link_to(admin_revision_history_path) do
|
||||
%span.fa-solid.fa-clock-rotate-left
|
||||
Revision History
|
||||
- if ENV.fetch('ORGANIZATIONS_ENABLED', nil) == 'true'
|
||||
%li
|
||||
= link_to(admin_organizations_path) do
|
||||
%span.fa-solid.fa-user-group
|
||||
Organizations
|
||||
|
|
|
|||
|
|
@ -76,8 +76,3 @@
|
|||
= link_to(admin_revision_history_path) do
|
||||
%span.fa-solid.fa-clock-rotate-left
|
||||
Revision History
|
||||
- if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true'
|
||||
%li
|
||||
= link_to(admin_organizations_path) do
|
||||
%span.fa-solid.fa-user-group
|
||||
Organizations
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12.page-header
|
||||
%h1
|
||||
Organizations
|
||||
.btn-group.pull-right
|
||||
/ = link_to 'Add new', new_organization_path, class: 'btn btn-mini btn-success'
|
||||
- @organizations.each do |organization|
|
||||
.col-md-4{ id: "organization-#{organization.id}" }
|
||||
.thumbnail
|
||||
= image_tag(organization.picture.thumb.url, width: '20%') if organization.picture?
|
||||
.caption
|
||||
%h4
|
||||
= organization.name
|
||||
.btn-group
|
||||
= link_to 'Conferences',
|
||||
conferences_organization_path(organization),
|
||||
class: 'btn btn-success'
|
||||
- unless organization.code_of_conduct.blank?
|
||||
= link_to 'Code of Conduct', [:code_of_conduct, organization], class: 'btn btn-info'
|
||||
/ = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default'
|
||||
|
|
@ -34,12 +34,6 @@
|
|||
= image_tag(@conference.picture.ticket.url, class: 'img-responsive')
|
||||
- else
|
||||
= image_tag('/img/osem-logo.png', class: 'img-responsive')
|
||||
%p.text-left
|
||||
%br
|
||||
%strong
|
||||
Organization
|
||||
%br
|
||||
= @conference.organization.name
|
||||
.col-md-5.box.well
|
||||
%p.text-left
|
||||
%strong
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue