Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/controllers/invitation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ def invitation_params
params[:workshop_invitation].present? ? params.require(:workshop_invitation).permit(:tutorial, :note) : {}
end

def available_spaces?(workshop, invitation)
(invitation.role.eql?('Student') && workshop.student_spaces?) ||
(invitation.role.eql?('Coach') && workshop.coach_spaces?)
end

def token
params[:id]
end
Expand Down
1 change: 0 additions & 1 deletion app/models/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Group < ApplicationRecord
has_many :group_announcements
has_many :announcements, through: :group_announcements

scope :latest_members, -> { joins(:members).order('created_at') }
scope :students, -> { where(name: 'Students') }
scope :coaches, -> { where(name: 'Coaches') }

Expand Down
2 changes: 0 additions & 2 deletions app/models/role.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
class Role < ApplicationRecord
has_and_belongs_to_many :members

scope :no_admins, -> { where.not(name: 'Admin') }
end
4 changes: 0 additions & 4 deletions app/models/sponsor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ def coach_spots
number_of_coaches || (seats / 2.0).round
end

def self.latest
WorkshopSponsor.order('created_at desc').limit(15).includes(:sponsor).map(&:sponsor).uniq
end

private

def website_is_url
Expand Down
4 changes: 0 additions & 4 deletions app/presenters/waiting_list_presenter.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
class WaitingListPresenter < BasePresenter
def reminders
@reminders ||= model.where(auto_rsvp: false)
end

def list
model.where(auto_rsvp: true)
end
Expand Down
24 changes: 0 additions & 24 deletions app/uploaders/avatar_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,15 @@ def content_type_allowlist
[/image\//]
end

# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{model.id}"
end

# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# # For Rails 3.1+ asset pipeline compatibility:
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
#
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end

# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end
#

version :thumb do
process resize_to_fit: [178, 65]
end

def extension_allowlist
%w[jpg jpeg gif png]
end

# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details.
# def filename
# "something.jpg" if original_filename
# end
end
31 changes: 0 additions & 31 deletions app/uploaders/image_uploader.rb
Original file line number Diff line number Diff line change
@@ -1,48 +1,17 @@
class ImageUploader < CarrierWave::Uploader::Base
storage :aws if Rails.env.production?

# Include RMagick or MiniMagick support:
include CarrierWave::MiniMagick

# Choose what kind of storage to use for this uploader:
# storage :file
# storage :fog

# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# # For Rails 3.1+ asset pipeline compatibility:
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
#
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end

# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end

# Create different versions of your uploaded files:
version :bg do
process resize_to_fit: [1200, 800]
end

# Add an allow list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_allowlist
%w[jpg jpeg png]
end

# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details.
# def filename
# "something.jpg" if original_filename
# end
end
14 changes: 0 additions & 14 deletions app/views/admin/events/_invitation_management.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@
%br
<strong>#{@attending_students.count}</strong> are attending as students and <strong>#{@attending_coaches.count}</strong> as coaches.

-# = simple_form_for :invitation, url: admin_invitation_path, method: :put do |f|
-# .row.mb-4
-# .col-auto
-# = f.select :id,
-# @event.invitations.not_accepted.all.map { |u| [ "#{u.member.full_name} (#{u.role})", u.token] },
-# { include_blank: true },
-# { class: 'chosen-select', required: true,
-# data: { placeholder: t('messages.invitations.select_a_member_to_rsvp') } }
-# = f.hidden_field :event_id, value: @event.id
-# .col-auto
-# = f.button :button, 'Add', class: 'btn btn-sm btn-primary mb-0 me-2'
-# %span{ "data-tooltip" => true, "aria-haspopup" => "true", class: "has-tip", title: t('admin.workshop.manage_rsvps.text') }
-# %i.fas.fa-info-circle

.row
.col-12.col-md-6
%h4 Students
Expand Down
12 changes: 0 additions & 12 deletions app/views/events/_faq.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
%ul.row.list-unstyled.row-cols-md-3
-# %li
-# %small
-# %b= t('events.faq.experience.q')
-# %p
-# %small
-# You must have a general idea about programming and preferably to have already finished the #{link_to("HTML tutorials", "http://tutorials.codebar.io")} or have a similar level of understanding, and basic git knowledge.
-# %li
-# %small
-# %b= t('events.faq.contribution.q')
-# %p
-# %small
-# = t('events.faq.contribution.a')
%li
%small
%b= t('events.faq.laptop.q')
Expand Down
12 changes: 2 additions & 10 deletions spec/models/role_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
RSpec.describe Role do
context 'scopes' do
let(:student_role) { Fabricate(:student_role) }
let(:coach_role) { Fabricate(:coach_role) }

before { Fabricate(:admin_role) }

describe '#no_admins' do
it { expect(Role.no_admins).to eq([student_role, coach_role]) }
end
end
# Currently no model-specific tests needed
# Role is a simple join model managed by Rolify
end
Loading