Merge pull request #114 from snap-cloud/merge-osem-master

Merge osem master
This commit is contained in:
Michael Ball 2021-03-08 20:30:40 -08:00 committed by GitHub
commit 81060a4d65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 330 additions and 394 deletions

51
.github/workflows/spec.yml vendored Normal file
View file

@ -0,0 +1,51 @@
name: Specs
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
linters:
runs-on: ubuntu-latest
env:
OSEM_RUBY_VERSION: 2.6.6
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- run: bundle exec rubocop
- run: bundle exec haml-lint app/views
spec:
runs-on: ubuntu-latest
name: spec
env:
OSEM_DB_ADAPTER: sqlite3
OSEM_RUBY_VERSION: 2.6.6
RAILS_ENV: test
strategy:
matrix:
suite: [models, features, controllers, ability, leftovers]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Prepare spec
run: |
rm -f osem_test osem_development
bundle exec rake db:setup --trace
bundle exec bin/rails webdrivers:chromedriver:update
- name: spec/${{ matrix.suite }}
run: bundle exec rake spec:${{ matrix.suite }}
- name: coverage upload ${{ matrix.suite }}
uses: codacy/codacy-coverage-reporter-action@master
if: github.ref == 'refs/heads/master'
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/coverage.xml

View file

@ -434,7 +434,7 @@ Metrics/BlockNesting:
# Offense count: 13 # Offense count: 13
# Configuration parameters: CountComments. # Configuration parameters: CountComments.
Metrics/ClassLength: Metrics/ClassLength:
Max: 650 Max: 652
# Offense count: 33 # Offense count: 33
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:

View file

@ -43,8 +43,8 @@ bundle exec rake data:set_conference_in_versions RAILS_ENV=production
### Organization admins ### Organization admins
We have a new role `organization admins` which allow a user to manage his the We have a new role `organization admins` which allow a user to manage their
organization and create and manage conference within the organization. This organization and create and manage a conference within the organization. This
needs the role to exist in the database, otherwise the application crashes needs the role to exist in the database, otherwise the application crashes
as it is assumed to exist. For that, run the following rake task: as it is assumed to exist. For that, run the following rake task:

View file

@ -1,4 +1,4 @@
FROM osem/base FROM registry.opensuse.org/opensuse/infrastructure/osem/containers/osem/base:latest
ARG CONTAINER_USERID ARG CONTAINER_USERID
# Configure our user # Configure our user
@ -16,6 +16,8 @@ RUN chown -R osem /osem
USER osem USER osem
WORKDIR /osem/ WORKDIR /osem/
# Install bundler & foreman
RUN sudo gem install bundler:1.17.3 foreman
# Install our bundle # Install our bundle
RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3 RUN export NOKOGIRI_USE_SYSTEM_LIBRARIES=1; bundle install --jobs=3 --retry=3

View file

@ -1,35 +0,0 @@
FROM opensuse/leap:15
# Install our requirements
RUN zypper -n install --no-recommends \
# for compiling assets/gems
nodejs8 gcc-c++ git-core make \
# for ...
ImageMagick \
# for bundler
sudo \
# as databases
libmariadb-devel postgresql-devel sqlite3-devel \
# for nokogiri
libxml2-devel libxslt-devel \
# for the interactive shell
ack curl wget w3m vim which \
# as ruby
ruby2.5-devel \
# as browser for feature tests
chromium xorg-x11-fonts
# Setup sudo
RUN echo 'osem ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Disable versioned gem binary names
RUN echo 'install: --no-format-executable' >> /etc/gemrc
# Install bundler & foreman
RUN gem install bundler:1.17.3 foreman
# Create our user
RUN useradd -m --user-group osem
CMD ["/bin/bash", "-l"]

View file

@ -1,4 +1,4 @@
FROM osem/base FROM opensuse/infrastructure/osem/containers/osem/base
# Add our files # Add our files
COPY --chown=1000:1000 . /osem/ COPY --chown=1000:1000 . /osem/

11
Gemfile
View file

@ -157,9 +157,6 @@ gem 'font-awesome-rails'
# for markdown # for markdown
gem 'redcarpet' gem 'redcarpet'
# as rdoc generator
gem 'rdoc-generator-fivefish'
# for visitor tracking # for visitor tracking
gem 'piwik_analytics', '~> 1.0.1' gem 'piwik_analytics', '~> 1.0.1'
@ -221,6 +218,8 @@ gem 'nokogiri', '>= 1.8.1'
# memcached binary connector # memcached binary connector
gem 'dalli' gem 'dalli'
gem 'icalendar'
# Use guard and spring for testing in development # Use guard and spring for testing in development
group :development do group :development do
# to launch specs when files are modified # to launch specs when files are modified
@ -234,8 +233,6 @@ group :development do
gem 'mina' gem 'mina'
# as debugger on error pages # as debugger on error pages
gem 'web-console' gem 'web-console'
# as development database
gem 'sqlite3'
# prepend models with db schema # prepend models with db schema
gem 'annotate' gem 'annotate'
end end
@ -248,7 +245,7 @@ group :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'webdrivers' gem 'webdrivers'
# for measuring test coverage # for measuring test coverage
gem 'codecov', require: false gem 'simplecov-cobertura'
# for describing models # for describing models
gem 'shoulda-matchers', require: false gem 'shoulda-matchers', require: false
# for stubing/mocking models # for stubing/mocking models
@ -283,4 +280,6 @@ group :development, :test, :linters do
gem 'rubocop-rspec', require: false gem 'rubocop-rspec', require: false
gem 'haml-lint', require: false gem 'haml-lint', require: false
# as development/test database
gem 'sqlite3'
end end

View file

@ -85,7 +85,7 @@ GEM
axlsx_rails (0.5.2) axlsx_rails (0.5.2)
actionpack (>= 3.1) actionpack (>= 3.1)
axlsx (>= 2.0.1) axlsx (>= 2.0.1)
bcrypt (3.1.13) bcrypt (3.1.16)
bindex (0.6.0) bindex (0.6.0)
bootstrap-sass (3.4.1) bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1) autoprefixer-rails (>= 5.2.1)
@ -104,7 +104,7 @@ GEM
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
regexp_parser (~> 1.5) regexp_parser (~> 1.5)
xpath (~> 3.2) xpath (~> 3.2)
carrierwave (2.2.0) carrierwave (2.1.1)
activemodel (>= 5.0.0) activemodel (>= 5.0.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
addressable (~> 2.6) addressable (~> 2.6)
@ -126,9 +126,7 @@ GEM
cloudinary (1.11.1) cloudinary (1.11.1)
aws_cf_signer aws_cf_signer
rest-client rest-client
cocoon (1.2.14) cocoon (1.2.15)
codecov (0.5.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.1) coderay (1.1.1)
concurrent-ruby (1.1.8) concurrent-ruby (1.1.8)
countable-rails (0.0.1) countable-rails (0.0.1)
@ -144,7 +142,7 @@ GEM
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
crass (1.0.6) crass (1.0.6)
daemons (1.3.1) daemons (1.3.1)
dalli (2.7.10) dalli (2.7.11)
dante (0.2.0) dante (0.2.0)
database_cleaner (1.7.0) database_cleaner (1.7.0)
delayed_job (4.1.8) delayed_job (4.1.8)
@ -152,7 +150,7 @@ GEM
delayed_job_active_record (4.1.4) delayed_job_active_record (4.1.4)
activerecord (>= 3.0, < 6.1) activerecord (>= 3.0, < 6.1)
delayed_job (>= 3.0, < 5) delayed_job (>= 3.0, < 5)
devise (4.7.1) devise (4.7.3)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (>= 4.1.0) railties (>= 4.1.0)
@ -254,11 +252,12 @@ GEM
i18n (1.8.9) i18n (1.8.9)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n_data (0.8.0) i18n_data (0.8.0)
icalendar (2.7.0)
ice_cube (~> 0.16)
ice_cube (0.16.3)
image_processing (1.12.1) image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5) mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3) ruby-vips (>= 2.0.17, < 3)
inversion (1.1.1)
loggability (~> 0.12)
io-like (0.3.0) io-like (0.3.0)
iso-639 (0.2.8) iso-639 (0.2.8)
jaro_winkler (1.5.3) jaro_winkler (1.5.3)
@ -288,7 +287,6 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2) ruby_dep (~> 1.2)
loggability (0.14.0)
loofah (2.9.0) loofah (2.9.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
@ -300,7 +298,7 @@ GEM
method_source (0.8.2) method_source (0.8.2)
mime-types (3.3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2021.0212) mime-types-data (3.2021.0225)
mimemagic (0.3.5) mimemagic (0.3.5)
mina (1.2.3) mina (1.2.3)
open4 (~> 1.3.4) open4 (~> 1.3.4)
@ -371,7 +369,7 @@ GEM
parser (2.6.5.0) parser (2.6.5.0)
ast (~> 2.4.0) ast (~> 2.4.0)
path_expander (1.1.0) path_expander (1.1.0)
pdf-core (0.7.0) pdf-core (0.9.0)
pdf-inspector (1.3.0) pdf-inspector (1.3.0)
pdf-reader (>= 1.0, < 3.0.a) pdf-reader (>= 1.0, < 3.0.a)
pdf-reader (2.2.0) pdf-reader (2.2.0)
@ -385,13 +383,13 @@ GEM
actionpack actionpack
activesupport activesupport
rails (>= 3.0.0) rails (>= 3.0.0)
prawn (2.2.2) prawn (2.4.0)
pdf-core (~> 0.7.0) pdf-core (~> 0.9.0)
ttfunk (~> 1.5) ttfunk (~> 1.7)
prawn-qrcode (0.3.1) prawn-qrcode (0.3.1)
prawn (>= 1) prawn (>= 1)
rqrcode (>= 0.4.1) rqrcode (>= 0.4.1)
prawn-rails (1.2.0) prawn-rails (1.3.0)
prawn prawn
prawn-table prawn-table
rails (>= 3.1.0) rails (>= 3.1.0)
@ -488,12 +486,6 @@ GEM
rb-fsevent (0.10.3) rb-fsevent (0.10.3)
rb-inotify (0.10.0) rb-inotify (0.10.0)
ffi (~> 1.0) ffi (~> 1.0)
rdoc (6.0.4)
rdoc-generator-fivefish (0.4.0)
inversion (~> 1.1)
loggability (~> 0.12)
rdoc (~> 6.0)
yajl-ruby (~> 1.3)
recaptcha (4.14.0) recaptcha (4.14.0)
json json
redcarpet (3.5.1) redcarpet (3.5.1)
@ -599,6 +591,8 @@ GEM
docile (~> 1.1) docile (~> 1.1)
simplecov-html (~> 0.11) simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1) simplecov_json_formatter (~> 0.1)
simplecov-cobertura (1.4.2)
simplecov (~> 0.8)
simplecov-html (0.12.3) simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2) simplecov_json_formatter (0.1.2)
sixarm_ruby_unaccent (1.2.0) sixarm_ruby_unaccent (1.2.0)
@ -635,7 +629,7 @@ GEM
tilt (2.0.9) tilt (2.0.9)
timecop (0.9.1) timecop (0.9.1)
transitions (1.2.1) transitions (1.2.1)
ttfunk (1.5.1) ttfunk (1.7.0)
turbolinks (5.2.1) turbolinks (5.2.1)
turbolinks-source (~> 5.2) turbolinks-source (~> 5.2)
turbolinks-source (5.2.0) turbolinks-source (5.2.0)
@ -650,8 +644,8 @@ GEM
unicode_utils (1.4.0) unicode_utils (1.4.0)
unobtrusive_flash (3.3.1) unobtrusive_flash (3.3.1)
railties railties
warden (1.2.8) warden (1.2.9)
rack (>= 2.0.6) rack (>= 2.0.9)
web-console (3.7.0) web-console (3.7.0)
actionview (>= 5.0) actionview (>= 5.0)
activemodel (>= 5.0) activemodel (>= 5.0)
@ -672,7 +666,6 @@ GEM
chronic (>= 0.6.3) chronic (>= 0.6.3)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
yajl-ruby (1.4.1)
PLATFORMS PLATFORMS
ruby ruby
@ -699,7 +692,6 @@ DEPENDENCIES
climate_control climate_control
cloudinary cloudinary
cocoon cocoon
codecov
countable-rails countable-rails
country_select country_select
daemons daemons
@ -720,6 +712,7 @@ DEPENDENCIES
guard-rspec guard-rspec
haml-lint haml-lint
haml-rails haml-rails
icalendar
iso-639 iso-639
jquery-datatables jquery-datatables
jquery-rails jquery-rails
@ -766,7 +759,6 @@ DEPENDENCIES
rails-assets-waypoints! rails-assets-waypoints!
rails-controller-testing rails-controller-testing
rails-i18n rails-i18n
rdoc-generator-fivefish
recaptcha recaptcha
redcarpet redcarpet
responders (~> 2.0) responders (~> 2.0)
@ -782,6 +774,7 @@ DEPENDENCIES
sentry-rails sentry-rails
sentry-ruby sentry-ruby
shoulda-matchers shoulda-matchers
simplecov-cobertura
skylight skylight
spring-commands-rspec spring-commands-rspec
sprockets-rails sprockets-rails

View file

@ -13,11 +13,13 @@ $(function () {
$("#conference-start-datepicker").datetimepicker({ $("#conference-start-datepicker").datetimepicker({
useCurrent: false, useCurrent: false,
format: "YYYY-MM-DD" ignoreReadonly: true,
format: "YYYY-MM-DD",
}); });
$("#conference-end-datepicker").datetimepicker({ $("#conference-end-datepicker").datetimepicker({
useCurrent: false, useCurrent: false,
ignoreReadonly: true,
format: "YYYY-MM-DD" format: "YYYY-MM-DD"
}); });

View file

@ -6,8 +6,11 @@ class ConferencesController < ApplicationController
load_and_authorize_resource find_by: :short_title, except: :show load_and_authorize_resource find_by: :short_title, except: :show
def index def index
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc) @current = Conference.upcoming.reorder(start_date: :asc)
@antiquated = Conference.where('end_date < ?', Date.current) @antiquated = Conference.past
if @antiquated.empty? && @current.empty? && User.empty?
render :new_install
end
end end
def show def show
@ -68,6 +71,47 @@ class ConferencesController < ApplicationController
end end
end end
def calendar
respond_to do |format|
format.ics do
calendar = Icalendar::Calendar.new
Conference.all.each do |conf|
if params[:full]
event_schedules = conf.program.selected_event_schedules(
includes: [{ event: %i[event_type speakers submitter] }]
)
calendar = icalendar_proposals(calendar, event_schedules.map(&:event), conf)
else
calendar.event do |e|
e.dtstart = conf.start_date
e.dtstart.ical_params = { 'VALUE'=>'DATE' }
e.dtend = conf.end_date
e.dtend.ical_params = { 'VALUE'=>'DATE' }
e.duration = "P#{(conf.end_date - conf.start_date + 1).floor}D"
e.created = conf.created_at
e.last_modified = conf.updated_at
e.summary = conf.title
e.description = conf.description
e.uid = conf.guid
e.url = conference_url(conf.short_title)
v = conf.venue
if v
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
location = ''
location += "#{v.street}, " if v.street
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
location += v.country_name if v.country_name
e.location = location if location
end
end
end
end
calendar.publish
render inline: calendar.to_ical
end
end
end
private private
def conference_finder_conditions def conference_finder_conditions

View file

@ -21,6 +21,12 @@ class SchedulesController < ApplicationController
format.xml do format.xml do
@events_xml = event_schedules.map(&:event).group_by{ |event| event.time.to_date } if event_schedules @events_xml = event_schedules.map(&:event).group_by{ |event| event.time.to_date } if event_schedules
end end
format.ics do
cal = Icalendar::Calendar.new
cal = icalendar_proposals(cal, event_schedules.map(&:event), @conference)
cal.publish
render inline: cal.to_ical
end
format.html do format.html do
@rooms = @conference.venue.rooms if @conference.venue @rooms = @conference.venue.rooms if @conference.venue

View file

@ -27,4 +27,33 @@ module ConferenceHelper
markdown(ticket.description.split("\n").first&.strip) markdown(ticket.description.split("\n").first&.strip)
end end
# adds events to icalendar for proposals in a conference
def icalendar_proposals(calendar, proposals, conference)
proposals.each do |proposal|
calendar.event do |e|
e.dtstart = proposal.time
e.dtend = proposal.time + proposal.event_type.length * 60
e.duration = "PT#{proposal.event_type.length}M"
e.created = proposal.created_at
e.last_modified = proposal.updated_at
e.summary = proposal.title
e.description = proposal.abstract
e.uid = proposal.guid
e.url = conference_program_proposal_url(conference.short_title, proposal.id)
v = conference.venue
if v
e.geo = v.latitude, v.longitude if v.latitude && v.longitude
location = ''
location += "#{proposal.room.name} - " if proposal.room.name
location += " - #{v.street}, " if v.street
location += "#{v.postalcode} #{v.city}, " if v.postalcode && v.city
location += "#{v.country_name}, " if v.country_name
e.location = location
end
e.categories = conference.title, "Difficulty: #{proposal.difficulty_level.title}", "Track: #{proposal.track.name}"
end
end
calendar
end
end end

View file

@ -61,6 +61,9 @@ class Conference < ApplicationRecord
has_one :email_settings, dependent: :destroy has_one :email_settings, dependent: :destroy
has_one :program, dependent: :destroy has_one :program, dependent: :destroy
has_one :venue, dependent: :destroy has_one :venue, dependent: :destroy
delegate :city, :country_name, to: :venue, allow_nil: true
delegate :name, :street, to: :venue, prefix: true, allow_nil: true
has_many :ticket_purchases, dependent: :destroy has_many :ticket_purchases, dependent: :destroy
has_many :physical_tickets, through: :ticket_purchases has_many :physical_tickets, through: :ticket_purchases
has_many :payments, dependent: :destroy has_many :payments, dependent: :destroy

View file

@ -24,8 +24,8 @@ class SurveyQuestion < ActiveRecord::Base
validates :title, presence: true validates :title, presence: true
validates :possible_answers, :max_choices, :min_choices, presence: true, if: :choice? validates :possible_answers, :max_choices, :min_choices, presence: true, if: :choice?
validates :min_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true validates :min_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true, if: :choice?
validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true validates :max_choices, numericality: { greater_than_or_equal_to: 1 }, allow_blank: true, if: :choice?
validate :max_choices_greater_than_min validate :max_choices_greater_than_min

View file

@ -69,9 +69,9 @@ class TicketPdf < Prawn::Document
draw_text @conference.title.to_s, at: [@mid_horizontal + 30, cursor - 30], size: 12 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 draw_text @conference.organization.name.to_s, at: [@mid_horizontal + 30, cursor - 50], size: 12
if @conference.venue if @conference.venue
draw_text @conference.venue.name, at: [@mid_horizontal + 30, cursor - 70] draw_text @conference.venue_name, at: [@mid_horizontal + 30, cursor - 70]
draw_text @conference.venue.street, at: [@mid_horizontal + 30, cursor - 90] draw_text @conference.venue_street, at: [@mid_horizontal + 30, cursor - 90]
draw_text @conference.venue.city, at: [@mid_horizontal + 30, cursor - 110] draw_text @conference.city, at: [@mid_horizontal + 30, cursor - 110]
end end
move_up 130 move_up 130
move_down @mid_vertical move_down @mid_vertical

View file

@ -6,6 +6,8 @@ class PictureUploader < CarrierWave::Uploader::Base
include CarrierWave::Compatibility::Paperclip include CarrierWave::Compatibility::Paperclip
include CarrierWave::BombShelter include CarrierWave::BombShelter
storage :file
# use cloudinary if it's configured # use cloudinary if it's configured
if Cloudinary.config.cloud_name if Cloudinary.config.cloud_name
# use https by default # use https by default

View file

@ -15,7 +15,7 @@
.row .row
.col-md-12 .col-md-12
= f.input :title = f.input :title, input_html: { autofocus: true }
= f.input :mandatory = f.input :mandatory
.survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' } .survey-possible-answers{ class: @survey_question.choice? ? '' : 'hidden' }
= f.input :possible_answers, hint: 'Comma separated', input_html: { rows: 3 } = f.input :possible_answers, hint: 'Comma separated', input_html: { rows: 3 }

View file

@ -7,4 +7,4 @@
.panel-body .panel-body
- question_replies = survey_question.survey_replies - question_replies = survey_question.survey_replies
- if question_replies.any? - if question_replies.any?
= pie_chart question_replies.group(:text).count, library: { legend: 'bottom', plotOptions: { pie: { dataLabels: { enabled: false }, showInLegend: true } } } = pie_chart question_replies.group(:text).count, library: { legend: { position: 'bottom' }, plotOptions: { pie: { dataLabels: { enabled: false }, showInLegend: true } } }

View file

@ -7,6 +7,11 @@
= event.title = event.title
%small %small
= event.subtitle = event.subtitle
.text-muted
= registered_text(event)
- if event.scheduled?
(Scheduled on: #{event.time.to_date})
.panel-body .panel-body
-# %p -# %p
-# = canceled_replacement_event_label(event, event_schedule) -# = canceled_replacement_event_label(event, event_schedule)

View file

@ -9,9 +9,9 @@
-if @conference.venue -if @conference.venue
at at
%strong %strong
= "#{@conference.venue.name}," = "#{@conference.venue_name},"
= "#{@conference.venue.street}," = "#{@conference.venue_street},"
= "#{@conference.venue.city} / #{@conference.venue.country_name}." = "#{@conference.city} / #{@conference.country_name}."
%small %small
= date_string(@conference.start_date, @conference.end_date) = date_string(@conference.start_date, @conference.end_date)
- unless @conference.code_of_conduct.blank? - unless @conference.code_of_conduct.blank?

View file

@ -12,7 +12,7 @@
= date_string(conference.start_date, conference.end_date) = date_string(conference.start_date, conference.end_date)
- if conference.venue - if conference.venue
%p %p
= "#{conference.venue.city}/#{conference.venue.country_name}" = "#{conference.city}/#{conference.country_name}"
- unless conference.description.blank? - unless conference.description.blank?
%p %p
= markdown(conference.description, escape_html=false) = markdown(conference.description, escape_html=false)

View file

@ -18,8 +18,11 @@
#antiquated #antiquated
- @antiquated.each do |conference| - @antiquated.each do |conference|
= render '/conferences/conference_details', conference: conference = render '/conferences/conference_details', conference: conference
- if @antiquated.empty? && @current.empty? && User.empty? %p
= render partial: 'new_install' Add the events to your calendar:
%span.btn-group
= link_to("Days only", calendar_url(protocol: 'webcal', format: 'ics'), class: 'btn btn-default')
= link_to("Detailed", calendar_url(protocol: 'webcal', format: 'ics', full: true), class: 'btn btn-default')
-content_for :script_body do -content_for :script_body do
:javascript :javascript

View file

@ -17,5 +17,5 @@
will the be administrator of it. will the be administrator of it.
%p %p
We hope you enjoy using OSEM, if you have any question don't hesitate to We hope you enjoy using OSEM, if you have any question don't hesitate to
= link_to('http://osem.io/#contact') do = link_to('https://osem.io/#contact') do
contact us! contact us!

View file

@ -9,9 +9,9 @@
- if @conference.venue - if @conference.venue
at at
%strong %strong
#{@conference.venue.name}, #{@conference.venue_name},
#{@conference.venue.street}, #{@conference.venue_street},
#{@conference.venue.city} / #{@conference.venue.country_name}. #{@conference.city} / #{@conference.country_name}.
%small %small
= date_string(@conference.start_date, @conference.end_date) = date_string(@conference.start_date, @conference.end_date)
.row .row

View file

@ -57,7 +57,18 @@
= f.input :submission_text, input_html: { rows: 5, data: { provide: 'markdown' }, placeholder: '' }, = f.input :submission_text, input_html: { rows: 5, data: { provide: 'markdown' }, placeholder: '' },
hint: markdown_hint('Only conference organizers will read this.') hint: markdown_hint('Only conference organizers will read this.')
- if current_user.is_admin? or @program.cfp.enable_registrations? %p
You have used
%span#submission-count #{@event.submission_word_count}
words. Submission descriptions must be between
%span#submission-minimum-word-count
0
and
%span#submission-maximum-word-count
250
words.
- if current_user.is_admin? or @program.cfp&.enable_registrations?
= f.inputs 'Enable pre-registration' do = f.inputs 'Enable pre-registration' do
= f.input :require_registration, label: 'Require participants to register to your event' = f.input :require_registration, label: 'Require participants to register to your event'
- message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.' - message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.'

View file

@ -36,17 +36,17 @@
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]}, data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' } include_blank: false, label: 'Type', input_html: { class: 'select-help-toggle' }
- if @program.languages.present?
= f.input :language, as: :select,
collection: @languages,
include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' }
- @program.event_types.each do |event_type| - @program.event_types.each do |event_type|
%div{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help"} %div{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help"}
%strong Directions %strong Directions
%div %div
= markdown(event_type.description) = markdown(event_type.description)
- if @program.languages.present?
= f.input :language, as: :select,
collection: @languages,
include_blank: false, label: 'Language', input_html: { class: 'select-help-toggle' }
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } }, = f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } },
hint: markdown_hint hint: markdown_hint

View file

@ -26,7 +26,11 @@
.visible-md-inline.visible-lg-inline .visible-md-inline.visible-lg-inline
= render partial: 'carousel', locals: { date: date, hrs_per_slide: 3 } = render partial: 'carousel', locals: { date: date, hrs_per_slide: 3 }
%p.pull-right %p
%span
= link_to conference_schedule_url(protocol: 'webcal', format: 'ics') do
Add the schedule to your calendar
%span.pull-right
= link_to app_conference_schedule_path do = link_to app_conference_schedule_path do
Get the mobile app! Get the mobile app!

View file

@ -113,5 +113,5 @@ Osem::Application.configure do
devise_config.ichain_test_mode = true devise_config.ichain_test_mode = true
end end
end end
config.active_record.verbose_query_logs = true
end end

View file

@ -97,7 +97,7 @@ Osem::Application.configure do
domain: ENV['OSEM_SMTP_DOMAIN'], domain: ENV['OSEM_SMTP_DOMAIN'],
enable_starttls_auto: ENV['OSEM_SMTP_ENABLE_STARTTLS_AUTO'], enable_starttls_auto: ENV['OSEM_SMTP_ENABLE_STARTTLS_AUTO'],
openssl_verify_mode: ENV['OSEM_SMTP_OPENSSL_VERIFY_MODE'] openssl_verify_mode: ENV['OSEM_SMTP_OPENSSL_VERIFY_MODE']
} }.compact
# Set the secret_key_base from the env, if not set by any other means # Set the secret_key_base from the env, if not set by any other means
config.secret_key_base ||= ENV["SECRET_KEY_BASE"] config.secret_key_base ||= ENV["SECRET_KEY_BASE"]

View file

@ -1,17 +0,0 @@
# http://www.jkfill.com/2015/02/14/log-which-line-caused-a-query/
module LogQuerySource
def debug(*args, &block)
return unless super
backtrace = Rails.backtrace_cleaner.clean caller
relevant_caller_line = backtrace.detect do |caller_line|
!caller_line.include?('/initializers/')
end
if relevant_caller_line
logger.debug("#{ relevant_caller_line.sub("#{ Rails.root }/", '') }")
end
end
end
ActiveRecord::LogSubscriber.send :prepend, LogQuerySource

View file

@ -112,10 +112,10 @@ Devise.setup do |config|
# ==> Configuration for :confirmable # ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without # A period that the user is allowed to access the website even without
# confirming his account. For instance, if set to 2.days, the user will be # confirming their account. For instance, if set to 2.days, the user will be
# able to access the website for two days without confirming his account, # able to access the website for two days without confirming their account,
# access will be blocked just in the third day. Default is 0.days, meaning # access will be blocked just in the third day. Default is 0.days, meaning
# the user cannot access the website without confirming his account. # the user cannot access the website without confirming their account.
config.allow_unconfirmed_access_for = 2.days config.allow_unconfirmed_access_for = 2.days
# If true, requires any email changes to be confirmed (exactly the same way as # If true, requires any email changes to be confirmed (exactly the same way as

View file

@ -1,6 +1,7 @@
Sentry.init do |config| Sentry.init do |config|
config.enabled_environments = %|production staging| config.enabled_environments = %|production staging|
config.dsn = ENV['SENTRY_DSN'] config.dsn = ENV['SENTRY_DSN']
# config.dsn = ENV.fetch('OSEM_SENTRY_DSN', Rails.application.secrets.sentry_dsn)
config.breadcrumbs_logger = [:active_support_logger] config.breadcrumbs_logger = [:active_support_logger]
# To activate performance monitoring, set one of these options. # To activate performance monitoring, set one of these options.
@ -10,4 +11,13 @@ Sentry.init do |config|
# config.traces_sampler = lambda do |context| # config.traces_sampler = lambda do |context|
# true # true
# end # end
# During deployment we touch tmp/restart.txt, let's use its last access time as release.
# Unless someone has set a variable of course...
# osem_version_from_file = nil
# version_file = File.expand_path('../../tmp/restart.txt', __dir__)
# osem_version_from_file = File.new(version_file).atime.to_i if File.file?(version_file)
# osem_version = ENV.fetch('OSEM_SENTRY_RELEASE', osem_version_from_file)
osem_version = ENV['HEROKU_RELEASE_VERSION']
config.release = osem_version if osem_version
end end

View file

@ -222,6 +222,8 @@ Osem::Application.routes.draw do
get '/admin' => redirect('/admin/conferences') get '/admin' => redirect('/admin/conferences')
get '/calendar' => 'conferences#calendar'
unless ENV['OSEM_ROOT_CONFERENCE'].blank? unless ENV['OSEM_ROOT_CONFERENCE'].blank?
root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}") root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}")
else else

View file

@ -31,8 +31,8 @@ production:
# Generate your own with rake secret or use the environment # Generate your own with rake secret or use the environment
# secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> # secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
# Your errbit API key # Your sentry.io DSN key
# errbit_key: '12345' # sentry_dsn: '12345'
########## OMNIAUTH Providers ########## ########## OMNIAUTH Providers ##########
# Leave the variables' names empty, unless you use the providers, in which # Leave the variables' names empty, unless you use the providers, in which

View file

@ -2,7 +2,7 @@ version: "2.4"
services: services:
database: database:
image: postgres image: postgres:12-alpine
environment: environment:
PGDATA: /var/lib/postgresql/data/pgdata PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: $OSEM_DB_PASSWORD POSTGRES_PASSWORD: $OSEM_DB_PASSWORD

View file

@ -2,7 +2,7 @@ version: "2.4"
services: services:
production_database: production_database:
image: postgres image: postgres:12-alpine
environment: environment:
PGDATA: /var/lib/postgresql/data/pgdata PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: $OSEM_DB_PASSWORD POSTGRES_PASSWORD: $OSEM_DB_PASSWORD

View file

@ -49,12 +49,8 @@
# See https://github.com/openSUSE/osem/wiki/Translation # See https://github.com/openSUSE/osem/wiki/Translation
# OSEM_TRANSIFEX_APIKEY=1234 # OSEM_TRANSIFEX_APIKEY=1234
# The errbit host to post exceptions to # sentry.io DSN key
# OSEM_ERRBIT_HOST=errbit.example.com # OSEM_SENTRY_DSN=1234
# The project to use on the errbit host
# OSEM_ERRBIT_ID=1234
# The key for this project
# OSEM_ERRBIT_KEY=5678
# OMNIAUTH Developer Key/Secret for GOOGLE # OMNIAUTH Developer Key/Secret for GOOGLE
# OSEM_GOOGLE_KEY=1234 # OSEM_GOOGLE_KEY=1234

View file

@ -1,235 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFcMjNMBEAC6Wr5QuLIFgz1V1EFPlg8ty2TsjQEl4VWftUAqWlMevJFWvYEx
BOsOZ6kNFfBfjAxgJNWTkxZrHzDl74R7KW/nUx6X57bpFjUyRaB8F3/NpWKSeIGS
pJT+0m2SgUNhLAn1WY/iNJGNaMl7lgUnaP+/ZsSNT9hyTBiH3Ev5VvAtMGhVI/u8
P0EtTjXp4o2U+VqFTBGmZ6PJVhCFjZUeRByloHw8dGOshfXKgriebpioHvU8iQ2U
GV3WNIirB2Rq1wkKxXJ/9Iw+4l5m4GmXMs7n3XaYQoBj28H86YA1cYWSm5LR5iU2
TneI1fJ3vwF2vpSXVBUUDk67PZhg6ZwGRT7GFWskC0z8PsWd5jwK20mA8EVKq0vN
BFmMK6i4fJU+ux17Rgvnc9tD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9OLgH4eNEfX25xj8BBPYny
VyHsyk5ZHDhjj9SaurfvlFWYi13i5ieMpyLVJV4+r2Wi1x1UgKVAlB78sHYnbDzS
oHPLBcIxtIKp30LJ0PEkat8SG7G2wgtv1RdhmcZEBV05vMnrGGO991e+pKzRNPYH
8rD3VQKJlvaFwsJuBTW42gZ3KfpUNKI2ugCcnRNpoHFWNCrzlJ0CFI48LMlmUSs+
7i/l+QGleaLKQxRTNNpAmevLrS7ga4Iq0IEqxey6VW6RSk/Z1Z37J8B7PISSR0rZ
n6TeyQgFWf/FOLw6OtwOquGmMeGSqj2UzxybygtsvUZz0BxYymoWFd4F8sp43oL2
TXU6Wp7QIpBaFgkSf/UQxfR6wcQ3ivafeS1lg8vUFuMfuMLto6T0JiZw8uKSuDWl
tSReF+FXVnhawz72BZMy8RIoshGdpWHn/YbN6L+JOuxZnvkMAZvSLT3c0H4XCDYt
EfK2mJMqD2ynX5tGR8Fy3GAaEjhx36TvzTjCXRmJ+FnlSW1p77x+UjFUFcpY8skv
+f0Gip30iynAb1hoAdibIDab612OWi/4vX0DaM6t68Uq8rsabeJYsZG4
=EXOv
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -34,7 +34,7 @@ namespace :data do
dot_env.puts "OSEM_SMTP_USERNAME=\"#{CONFIG['mail_username']}\"" dot_env.puts "OSEM_SMTP_USERNAME=\"#{CONFIG['mail_username']}\""
dot_env.puts "OSEM_SMTP_PASSWORD=\"#{CONFIG['mail_password']}\"" dot_env.puts "OSEM_SMTP_PASSWORD=\"#{CONFIG['mail_password']}\""
dot_env.puts "OSEM_SMTP_AUTHENTICATION=\"#{CONFIG['mail_authentication']}\"" dot_env.puts "OSEM_SMTP_AUTHENTICATION=\"#{CONFIG['mail_authentication']}\""
dot_env.puts 'OSEM_SMTP_DOMAIN=""' dot_env.puts '# OSEM_SMTP_DOMAIN="example.com"'
dot_env.close dot_env.close
puts "Migrated config/config.yml to .env.#{Rails.env}" puts "Migrated config/config.yml to .env.#{Rails.env}"

26
lib/tasks/spec.rake Normal file
View file

@ -0,0 +1,26 @@
# frozen_string_literal: true
unless Rails.env.production?
namespace :spec do
desc 'rspec ability'
task :ability do
sh 'bundle exec rspec --format documentation spec/ability'
end
desc 'rspec models'
task :models do
sh 'bundle exec rspec --format documentation spec/models'
end
desc 'rspec controllers'
task :controllers do
sh 'bundle exec rspec --format documentation spec/controllers'
end
desc 'rspec features'
task :features do
sh 'bundle exec rspec --format documentation spec/features'
end
desc 'rspec the leftovers'
task :leftovers do
sh 'bundle exec rspec --format documentation --exclude-pattern "spec/{models,features,controllers,ability}/**/*_spec.rb"'
end
end
end

View file

@ -1,5 +1,3 @@
require 'pry'
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'

View file

@ -8,10 +8,10 @@ describe Admin::UsersController do
sign_in(admin) sign_in(admin)
end end
describe 'GET #index' do describe 'GET #index' do
it 'sets up users array with existing users records' do xit 'sets up users array with existing users records' do
user1 = create(:user, email: 'user1@email.osem') user1 = create(:user, email: 'user1@email.osem')
user2 = create(:user, email: 'user2@email.osem') user2 = create(:user, email: 'user2@email.osem')
user_deleted = User.find_by(name: 'User deleted') user_deleted = User.find_by!(username: 'deleted_user')
get :index get :index
expect(assigns(:users)).to match_array([user_deleted, user, admin, user1, user2]) expect(assigns(:users)).to match_array([user_deleted, user, admin, user1, user2])
end end

View file

@ -126,7 +126,6 @@ describe UserDatatable do
end end
it 'confirmed_at' do it 'confirmed_at' do
expect(Date.parse(user_data[:confirmed_at])).to eq(user.confirmed_at.to_date) expect(Date.parse(user_data[:confirmed_at])).to eq(user.confirmed_at.to_date)
end end

View file

@ -34,31 +34,31 @@ feature 'BaseController' do
expect(flash).to eq 'You are not authorized to access this page.' expect(flash).to eq 'You are not authorized to access this page.'
end end
it 'an admin he can access the admin area' do it 'an admin they can access the admin area' do
user.is_admin = true user.is_admin = true
visit admin_conferences_path visit admin_conferences_path
expect(current_path).to eq admin_conferences_path expect(current_path).to eq admin_conferences_path
end end
it 'an organizer he can access the admin area' do it 'an organizer they can access the admin area' do
user.role_ids = organizer_role.id user.role_ids = organizer_role.id
visit admin_conferences_path visit admin_conferences_path
expect(current_path).to eq admin_conferences_path expect(current_path).to eq admin_conferences_path
end end
it 'a volunteers_coordinator he can access the admin area' do it 'a volunteers_coordinator they can access the admin area' do
user.role_ids = volunteers_coordinator_role.id user.role_ids = volunteers_coordinator_role.id
visit admin_conferences_path visit admin_conferences_path
expect(current_path).to eq admin_conferences_path expect(current_path).to eq admin_conferences_path
end end
it 'a cfp he can access the admin area' do it 'a cfp they can access the admin area' do
user.role_ids = cfp_role.id user.role_ids = cfp_role.id
visit admin_conferences_path visit admin_conferences_path
expect(current_path).to eq admin_conferences_path expect(current_path).to eq admin_conferences_path
end end
it 'an info_desk he can access the admin area' do it 'an info_desk they can access the admin area' do
user.role_ids = info_desk_role.id user.role_ids = info_desk_role.id
visit admin_conferences_path visit admin_conferences_path
expect(current_path).to eq admin_conferences_path expect(current_path).to eq admin_conferences_path

View file

@ -107,6 +107,17 @@ feature Event do
expect(User.count).to eq(expected_count_user) expect(User.count).to eq(expected_count_user)
end end
scenario 'edit proposal without cfp' do
conference = create(:conference)
proposal = create(:event, program: conference.program)
sign_in proposal.submitter
visit edit_conference_program_proposal_path(proposal.program.conference.short_title, proposal)
expect(page).to have_content 'Proposal Information'
end
scenario 'update a proposal' do scenario 'update a proposal' do
conference = create(:conference) conference = create(:conference)
create(:cfp, program: conference.program) create(:cfp, program: conference.program)
@ -145,7 +156,6 @@ feature Event do
# Submission Instructions content # Submission Instructions content
expect(page).to have_text('Example Event Instructions') expect(page).to have_text('Example Event Instructions')
click_link 'Do you require something special?' click_link 'Do you require something special?'
fill_in 'event_description', with: 'Lorem ipsum description' fill_in 'event_description', with: 'Lorem ipsum description'

View file

@ -232,7 +232,7 @@ feature 'Version' do
end end
# TODO-SNAPCON: Figure out why this is failing!! # TODO-SNAPCON: Figure out why this is failing!!
skip 'display changes in splashpages', feature: true, versioning: true, js: true do xscenario 'display changes in splashpages', feature: true, versioning: true, js: true do
visit admin_conference_splashpage_path(conference.short_title) visit admin_conference_splashpage_path(conference.short_title)
click_link 'Create Splashpage' click_link 'Create Splashpage'
click_button 'Save Changes' click_button 'Save Changes'
@ -247,15 +247,15 @@ feature 'Version' do
uncheck('Display social media links') uncheck('Display social media links')
check('Make splash page public?') check('Make splash page public?')
click_button 'Save Changes' click_button 'Save Changes'
splashpage_id = conference.splashpage.id
click_link 'Delete' click_link 'Delete'
page.accept_alert page.accept_alert
expect(page).to have_text('Splashpage was successfully destroyed')
visit admin_revision_history_path visit admin_revision_history_path
expect(page).to have_text("#{organizer.name} created new splashpage with ID #{splashpage_id} in conference #{conference.short_title}") expect(page).to have_text("#{organizer.name} created new splashpage in conference #{conference.short_title}")
expect(page).to have_text("#{organizer.name} updated public, include program, include cfp, include venue, include tickets, include lodgings, include sponsors and include social media of splashpage with ID #{splashpage_id} in conference #{conference.short_title}") expect(page).to have_text("#{organizer.name} updated public, include program, include cfp, include venue, include tickets, include lodgings, include sponsors and include social media of splashpage in conference #{conference.short_title}")
expect(page).to have_text("#{organizer.name} deleted splashpage with ID #{splashpage_id} in conference #{conference.short_title}") expect(page).to have_text("#{organizer.name} deleted splashpage in conference #{conference.short_title}")
end end
scenario 'displays users subscribe/unsubscribe to conferences', feature: true, versioning: true, js: true do scenario 'displays users subscribe/unsubscribe to conferences', feature: true, versioning: true, js: true do

View file

@ -39,6 +39,34 @@
# !/bin/env ruby # !/bin/env ruby
require 'spec_helper' require 'spec_helper'
context 'Delegation' do
subject do
FactoryBot.create(:conference, start_date: 1.month.from_now, end_date: 2.month.from_now)
end
context 'Venue' do
context 'when venue has not been set' do
it 'the accessors should be nil' do
expect(subject.city).to eq(nil)
expect(subject.country_name).to eq(nil)
expect(subject.venue_name).to eq(nil)
expect(subject.venue_street).to eq(nil)
end
end
context 'when venue has been set' do
it 'should delegate to venue' do
venue = FactoryBot.create(:venue)
subject.update(venue: venue)
expect(subject.city).to eq(venue.city)
expect(subject.country_name).to eq(venue.country_name)
expect(subject.venue_name).to eq(venue.name)
expect(subject.venue_street).to eq(venue.street)
end
end
end
end
describe Conference do describe Conference do
let(:subject) { create(:conference, start_date: Date.new(2014, 06, 30), end_date: Date.new(2014, 06, 30)) } let(:subject) { create(:conference, start_date: Date.new(2014, 06, 30), end_date: Date.new(2014, 06, 30)) }

View file

@ -480,7 +480,7 @@ describe User do
end end
describe 'assigns admin attribute' do describe 'assigns admin attribute' do
it 'to second user when first user is deleted_user' do xit 'to second user when first user is deleted_user' do
deleted_user = User.find_by(email: 'deleted@localhost.osem') deleted_user = User.find_by(email: 'deleted@localhost.osem')
expect(deleted_user.is_admin).to be false expect(deleted_user.is_admin).to be false

View file

@ -3,9 +3,9 @@
# This file is copied to spec/ when you run 'rails generate rspec:install' # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'simplecov' require 'simplecov'
if ENV['TRAVIS'] if ENV['GITHUB_ACTIONS']
require 'codecov' require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::Codecov SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end end
SimpleCov.start 'rails' SimpleCov.start 'rails'