From 275be8c80aa27af0174b5af9948600de26a79891 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Fri, 7 Jun 2024 16:19:29 +0200 Subject: [PATCH] Drop Organization Feature --- app/controllers/admin/base_controller.rb | 3 +- .../admin/conferences_controller.rb | 2 +- .../admin/organizations_controller.rb | 98 ------------------- app/controllers/admin/versions_controller.rb | 3 - app/controllers/organizations_controller.rb | 21 ---- app/helpers/application_helper.rb | 2 +- app/helpers/versions_helper.rb | 9 -- app/models/conference.rb | 10 +- app/models/organization.rb | 25 ----- app/pdfs/ticket_pdf.rb | 1 - .../admin/conferences/_form_fields.html.haml | 4 - app/views/admin/organizations/_form.html.haml | 22 ----- .../_users_with_org_admin_role.haml | 26 ----- app/views/admin/organizations/edit.html.haml | 9 -- app/views/admin/organizations/index.html.haml | 40 -------- app/views/admin/organizations/new.html.haml | 8 -- .../admin/organizations/show_org_admins.haml | 20 ---- .../versions/_object_desc_and_link.html.haml | 48 ++------- .../_registration_info.html.haml | 2 +- .../conference_registrations/show.html.haml | 3 +- app/views/conferences/_code_of_conduct.haml | 8 +- .../conferences/_conference_details.html.haml | 4 +- app/views/conferences/show.html.haml | 2 +- .../layouts/_admin_sidebar_index.html.haml | 10 -- app/views/layouts/_user_menu.html.haml | 5 - app/views/organizations/index.html.haml | 21 ---- app/views/physical_tickets/show.html.haml | 6 -- config/routes.rb | 12 --- 28 files changed, 22 insertions(+), 402 deletions(-) delete mode 100644 app/controllers/admin/organizations_controller.rb delete mode 100644 app/controllers/organizations_controller.rb delete mode 100644 app/models/organization.rb delete mode 100644 app/views/admin/organizations/_form.html.haml delete mode 100644 app/views/admin/organizations/_users_with_org_admin_role.haml delete mode 100644 app/views/admin/organizations/edit.html.haml delete mode 100644 app/views/admin/organizations/index.html.haml delete mode 100644 app/views/admin/organizations/new.html.haml delete mode 100644 app/views/admin/organizations/show_org_admins.haml delete mode 100644 app/views/organizations/index.html.haml diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index 82474426..9b842b71 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -21,8 +21,7 @@ module Admin return false end unless (current_user.has_cached_role? :organizer, :any) || (current_user.has_cached_role? :cfp, :any) || - (current_user.has_cached_role? :info_desk, :any) || (current_user.has_cached_role? :organization_admin, :any) || - (current_user.has_cached_role? :volunteers_coordinator, :any) || + (current_user.has_cached_role? :info_desk, :any) || (current_user.has_cached_role? :volunteers_coordinator, :any) || (current_user.has_cached_role? :track_organizer, :any) || current_user.is_admin raise CanCan::AccessDenied.new('You are not authorized to access this page.') end diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 80e36f47..bc4e7cbf 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -180,7 +180,7 @@ module Admin :use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers, :color, :sponsorship_levels_attributes, :sponsors_attributes, - :registration_limit, :organization_id, :ticket_layout, + :registration_limit, :ticket_layout, :booth_limit) end end diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb deleted file mode 100644 index 14ff040d..00000000 --- a/app/controllers/admin/organizations_controller.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -module Admin - class OrganizationsController < Admin::BaseController - load_and_authorize_resource :organization - before_action :verify_user, only: [:assign_org_admins, :unassign_org_admins] - - def index - @organizations = Organization.all - end - - def create - @organization = Organization.new(organization_params) - if @organization.save - redirect_to admin_organizations_path, - notice: 'Organization successfully created' - else - redirect_to new_admin_organization_path, - error: @organization.errors.full_messages.join(', ') - end - end - - def new - @organization = Organization.new - end - - def edit; end - - def update - if @organization.update(organization_params) - redirect_to admin_organizations_path, - notice: 'Organization successfully updated' - else - redirect_to edit_admin_organization_path(@organization), - error: @organization.errors.full_messages.join(', ') - end - end - - def destroy - if @organization.destroy - redirect_to admin_organizations_path, - notice: 'Organization successfully destroyed' - else - redirect_to admin_organizations_path, - error: 'Organization cannot be destroyed' - end - end - - def assign_org_admins - if @user.has_cached_role? 'organization_admin', @organization - flash[:error] = "User #{@user.email} already has the role organization admin" - elsif @user.add_role 'organization_admin', @organization - flash[:notice] = "Successfully added role organization admin to user #{@user.email}" - else - flash[:error] = "Coud not add role organization admin to #{@user.email}" - end - - redirect_to admins_admin_organization_path(@organization) - end - - def unassign_org_admins - if @user.remove_role 'organization_admin', @organization - flash[:notice] = "Successfully removed role organization admin from user #{@user.email}" - else - flash[:error] = "Could not remove role organization admin from user #{@user.email}" - end - - redirect_to admins_admin_organization_path(@organization) - end - - def admins - @role = @organization.roles.first - @users = @role.users - render 'show_org_admins' - end - - private - - def user_params - params.require(:user).permit(:email) - end - - def verify_user - @user = User.find_by(email: user_params[:email]) - unless @user - redirect_to admins_admin_organization_path(@organization), - error: 'Could not find user. Please provide a valid email!' - return - end - end - - def organization_params - params.require(:organization).permit( - :name, :description, :picture, :code_of_conduct - ) - end - end -end diff --git a/app/controllers/admin/versions_controller.rb b/app/controllers/admin/versions_controller.rb index 1bc7ae2a..751ac746 100644 --- a/app/controllers/admin/versions_controller.rb +++ b/app/controllers/admin/versions_controller.rb @@ -8,9 +8,6 @@ module Admin def index @conferences_with_role = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role([:organizer, :cfp, :info_desk], current_user).pluck(:short_title) - if current_user.has_cached_role? :organization_admin, :any - @conferences_with_role = Organization.with_role('organization_admin', current_user).map { |org| org.conferences.pluck :short_title }.flatten - end @conferences_with_role.uniq! return if @conference.blank? diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb deleted file mode 100644 index 28696d33..00000000 --- a/app/controllers/organizations_controller.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class OrganizationsController < ApplicationController - load_and_authorize_resource :organization - - def index - @organizations = Organization.all - end - - def code_of_conduct - @title = "#{@organization.name}: Code of Conduct" - @content = @organization.code_of_conduct - render 'document' - end - - def conferences - @current = @organization.conferences.upcoming.reorder(start_date: :asc) - @antiquated = @organization.conferences.past - render '/conferences/index' - end -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e3474111..0be070a2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -140,7 +140,7 @@ module ApplicationHelper def nav_root_link_for(conference) link_text = ( - conference.try(:organization).try(:name) || ENV.fetch('OSEM_NAME', 'OSEM') + ENV.fetch('OSEM_NAME', 'OSEM') ) link_to( link_text, diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb index 0f355f5a..33cecc1e 100644 --- a/app/helpers/versions_helper.rb +++ b/app/helpers/versions_helper.rb @@ -8,15 +8,6 @@ module VersionsHelper version.item && conference ? link_to(link_text, link_url) : "#{link_text} with ID #{version.item_id}" end - def link_to_organization(organization_id) - return 'deleted organization' unless organization_id - - org = Organization.find_by(id: organization_id) - return current_or_last_object_state('Organization', organization_id).try(:name) unless org - - org.name.to_s - end - def link_to_conference(conference_id) return 'deleted conference' if conference_id.nil? diff --git a/app/models/conference.rb b/app/models/conference.rb index cac3a849..8c83f286 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -12,9 +12,6 @@ class Conference < ApplicationRecord scope :upcoming, (-> { where('end_date >= ?', Date.current) }) scope :past, (-> { where('end_date < ?', Date.current) }) - belongs_to :organization - delegate :code_of_conduct, to: :organization - has_paper_trail ignore: %i(updated_at guid revision events_per_week), meta: { conference_id: :id } has_and_belongs_to_many :questions @@ -83,7 +80,6 @@ class Conference < ApplicationRecord :start_hour, :end_hour, :ticket_layout, - :organization, :timezone, presence: true validates :short_title, uniqueness: true @@ -579,11 +575,11 @@ class Conference < ApplicationRecord # * +ActiveRecord+ def self.get_active_conferences_for_dashboard result = Conference.where('start_date > ?', Time.now) - .select('id, short_title, color, start_date, organization_id') + .select('id, short_title, color, start_date') if result.empty? result = Conference - .select('id, short_title, color, start_date, organization_id').limit(2) + .select('id, short_title, color, start_date').limit(2) .order(start_date: :desc) end result @@ -595,7 +591,7 @@ class Conference < ApplicationRecord # ====Returns # * +ActiveRecord+ def self.get_conferences_without_active_for_dashboard(active_conferences) - result = Conference.select('id, short_title, color, start_date, organization_id').order(start_date: :desc) + result = Conference.select('id, short_title, color, start_date').order(start_date: :desc) result - active_conferences end diff --git a/app/models/organization.rb b/app/models/organization.rb deleted file mode 100644 index 877de9df..00000000 --- a/app/models/organization.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class Organization < ApplicationRecord - resourcify :roles, dependent: :delete_all - - has_paper_trail - - has_many :conferences, dependent: :destroy - - after_create :create_roles - - validates :name, - uniqueness: { - case_sensitive: false - }, - presence: true - - mount_uploader :picture, PictureUploader, mount_on: :picture - - private - - def create_roles - roles.where(name: 'organization_admin').first_or_create(description: 'For the administrators of an organization and its conferences') - end -end diff --git a/app/pdfs/ticket_pdf.rb b/app/pdfs/ticket_pdf.rb index cb624b1d..542e8cb0 100644 --- a/app/pdfs/ticket_pdf.rb +++ b/app/pdfs/ticket_pdf.rb @@ -67,7 +67,6 @@ class TicketPdf < Prawn::Document move_down 70 draw_text @conference.title.to_s, at: [@mid_horizontal + 30, cursor - 30], size: 12 - draw_text @conference.organization.name.to_s, at: [@mid_horizontal + 30, cursor - 50], size: 12 if @conference.venue draw_text @conference.venue_name, at: [@mid_horizontal + 30, cursor - 70] draw_text @conference.venue_street, at: [@mid_horizontal + 30, cursor - 90] diff --git a/app/views/admin/conferences/_form_fields.html.haml b/app/views/admin/conferences/_form_fields.html.haml index afa644ed..bcba474f 100644 --- a/app/views/admin/conferences/_form_fields.html.haml +++ b/app/views/admin/conferences/_form_fields.html.haml @@ -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'} * diff --git a/app/views/admin/organizations/_form.html.haml b/app/views/admin/organizations/_form.html.haml deleted file mode 100644 index 13544440..00000000 --- a/app/views/admin/organizations/_form.html.haml +++ /dev/null @@ -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 diff --git a/app/views/admin/organizations/_users_with_org_admin_role.haml b/app/views/admin/organizations/_users_with_org_admin_role.haml deleted file mode 100644 index 0632afbf..00000000 --- a/app/views/admin/organizations/_users_with_org_admin_role.haml +++ /dev/null @@ -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! diff --git a/app/views/admin/organizations/edit.html.haml b/app/views/admin/organizations/edit.html.haml deleted file mode 100644 index c9d69bcd..00000000 --- a/app/views/admin/organizations/edit.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.row - .col-md-12 - .page-header - %h1 - Edit Organization - = @organization.name -.row - .col-md-8 - = render partial: 'form' diff --git a/app/views/admin/organizations/index.html.haml b/app/views/admin/organizations/index.html.haml deleted file mode 100644 index 09cf187e..00000000 --- a/app/views/admin/organizations/index.html.haml +++ /dev/null @@ -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' diff --git a/app/views/admin/organizations/new.html.haml b/app/views/admin/organizations/new.html.haml deleted file mode 100644 index b38ea937..00000000 --- a/app/views/admin/organizations/new.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -.row - .col-md-12 - .page-header - %h1 - Create Organization -.row - .col-md-8 - = render partial: 'form' diff --git a/app/views/admin/organizations/show_org_admins.haml b/app/views/admin/organizations/show_org_admins.haml deleted file mode 100644 index 5c7698db..00000000 --- a/app/views/admin/organizations/show_org_admins.haml +++ /dev/null @@ -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 } diff --git a/app/views/admin/versions/_object_desc_and_link.html.haml b/app/views/admin/versions/_object_desc_and_link.html.haml index 1728b999..34bf4c8f 100644 --- a/app/views/admin/versions/_object_desc_and_link.html.haml +++ b/app/views/admin/versions/_object_desc_and_link.html.haml @@ -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' diff --git a/app/views/conference_registrations/_registration_info.html.haml b/app/views/conference_registrations/_registration_info.html.haml index e8293d54..0fd04b51 100644 --- a/app/views/conference_registrations/_registration_info.html.haml +++ b/app/views/conference_registrations/_registration_info.html.haml @@ -27,4 +27,4 @@ (Scheduled on: #{event.time.to_date}) %br -= render 'conferences/code_of_conduct', organization: @conference.organization += render 'conferences/code_of_conduct' diff --git a/app/views/conference_registrations/show.html.haml b/app/views/conference_registrations/show.html.haml index c419d535..d9447049 100644 --- a/app/views/conference_registrations/show.html.haml +++ b/app/views/conference_registrations/show.html.haml @@ -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 diff --git a/app/views/conferences/_code_of_conduct.haml b/app/views/conferences/_code_of_conduct.haml index 1b9b9867..d3110867 100644 --- a/app/views/conferences/_code_of_conduct.haml +++ b/app/views/conferences/_code_of_conduct.haml @@ -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 diff --git a/app/views/conferences/_conference_details.html.haml b/app/views/conferences/_conference_details.html.haml index a79d31e1..ffdd197a 100644 --- a/app/views/conferences/_conference_details.html.haml +++ b/app/views/conferences/_conference_details.html.haml @@ -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' diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 85b2bac6..41718b66 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -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 diff --git a/app/views/layouts/_admin_sidebar_index.html.haml b/app/views/layouts/_admin_sidebar_index.html.haml index 91001405..3da79dd2 100644 --- a/app/views/layouts/_admin_sidebar_index.html.haml +++ b/app/views/layouts/_admin_sidebar_index.html.haml @@ -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 diff --git a/app/views/layouts/_user_menu.html.haml b/app/views/layouts/_user_menu.html.haml index 887eee03..f3c965ad 100644 --- a/app/views/layouts/_user_menu.html.haml +++ b/app/views/layouts/_user_menu.html.haml @@ -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 diff --git a/app/views/organizations/index.html.haml b/app/views/organizations/index.html.haml deleted file mode 100644 index bd97ac2b..00000000 --- a/app/views/organizations/index.html.haml +++ /dev/null @@ -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' diff --git a/app/views/physical_tickets/show.html.haml b/app/views/physical_tickets/show.html.haml index ec8e7379..69351745 100644 --- a/app/views/physical_tickets/show.html.haml +++ b/app/views/physical_tickets/show.html.haml @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 5865281d..cc6147e6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -23,13 +23,6 @@ Osem::Application.routes.draw do end namespace :admin do - resources :organizations do - member do - get :admins - post :assign_org_admins - delete :unassign_org_admins - end - end resources :users do member do patch :toggle_confirmation @@ -150,11 +143,6 @@ Osem::Application.routes.draw do get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object' get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute' end - resources :organizations, only: [:index] do - member do - get :conferences, 'code-of-conduct' - end - end resources :conferences, only: [:index, :show] do resources :booths do member do