Skip to content

Commit

Permalink
Merge pull request #600 from ChicagoWorldcon/development
Browse files Browse the repository at this point in the history
2.0.0-rc2
  • Loading branch information
Gailbear authored Aug 11, 2022
2 parents 60bdc10 + 0999bd4 commit da7d9f1
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 12 deletions.
9 changes: 9 additions & 0 deletions app/controllers/publication_dates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ class PublicationDatesController < ResourceController
DEFAULT_SORTBY = 'timestamp'
DEFAULT_ORDER = 'desc'.freeze

def reset
PublishedSession.destroy_all
PublishSnapshot.delete_all
PublicationDate.delete_all
PublicationStatus.delete_all

Audit::PublishedSessionVersion.delete_all
end

def paginate
false
end
Expand Down
1 change: 0 additions & 1 deletion app/controllers/publications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def schedule
end

send_data XmlFormatter.new(sessions).render('schedule', sessions)
.gsub(/&#39;/, '&#8217;')
.gsub(/&lt;em&gt;/, '<em>')
.gsub(/&lt;\/em&gt;/, '</em>')
.gsub(/\<\?xml version="1\.0"\?\>\n/, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!-- Formatted for the special requirements of importing to Adobe InDesign. -->')
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/reports/people_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Reports::PeopleReportsController < ApplicationController
def moderators
authorize Person, policy_class: ReportPolicy

people = SessionService.live_moderators
people = SessionService.draft_moderators

workbook = FastExcel.open(constant_memory: true)
worksheet = workbook.add_worksheet("Moderators and Sessions")
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/reports/session_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Reports::SessionReportsController < ApplicationController
def streamed_and_recorded
authorize SessionAssignment, policy_class: Reports::SessionReportPolicy

sessions = SessionService.live_sessions
sessions = SessionService.draft_sessions

workbook = FastExcel.open(constant_memory: true)
worksheet = workbook.add_worksheet("Sessions streamed and recorded")
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/sessions/session_edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
v-model="session.environment"
@change="saveSession()"
v-if="currentSettings && currentSettings.enums"
>
>
<b-form-radio v-for="env in currentSettings.enums.Session.environment" :value="env" v-bind:key="env">{{SESSION_ENVIRONMENT[env]}}</b-form-radio>
</b-form-radio-group>
</b-form-group>
Expand Down Expand Up @@ -104,7 +104,7 @@
type="number"
class="ml-1"
:disabled="!session.require_signup"
v-model="session.maximum_people"
v-model="session.audience_size"
@blur="saveValidatedSession(validationCtx)"
:state="getValidationState(validationCtx)"
></b-form-input>
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/sessions/session_sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
<dt>Attendee Signup Required</dt>
<dd class="ml-2 font-italic">{{selected.require_signup ? 'Yes' : 'No'}}</dd>
<dt class="ml-2">If "Yes", max openings</dt>
<dd class="ml-3 font-italic">{{selected.maximum_people}}</dd>
<dd class="ml-3 font-italic text-muted" v-if="!selected.maximum_people">None Set</dd>
<dd class="ml-3 font-italic">{{selected.audience_size}}</dd>
<dd class="ml-3 font-italic text-muted" v-if="!selected.audience_size">None Set</dd>
<dt>Attendee Age Restrictions</dt>
<dd class="ml-2 font-italic" v-if="selected.age_restriction_id">{{ ageRestrictionName(selected.age_restriction_id)}}</dd>
<dd class="ml-2 font-italic text-muted" v-if="!selected.age_restriction_id">None</dd>
Expand Down
2 changes: 1 addition & 1 deletion app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Person < ApplicationRecord
# acts_as_taggable
acts_as_taggable_on :tags

has_paper_trail versions: { class_name: 'Audit::PersonVersion' }, ignore: [:updated_at, :created_at, :lock_version]
has_paper_trail versions: { class_name: 'Audit::PersonVersion' }, ignore: [:updated_at, :created_at, :lock_version, :integrations]

before_destroy :check_if_assigned
before_save :check_primary_email
Expand Down
2 changes: 1 addition & 1 deletion app/models/published_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PublishedSession < ApplicationRecord
self.primary_key = :session_id

has_paper_trail versions: { class_name: 'Audit::PublishedSessionVersion' },
ignore: [:updated_at, :created_at, :lock_version],
ignore: [:updated_at, :created_at, :lock_version, :integrations],
limit: nil

belongs_to :format
Expand Down
2 changes: 1 addition & 1 deletion app/models/published_session_assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class PublishedSessionAssignment < ApplicationRecord
self.primary_key = :session_assignment_id

has_paper_trail versions: { class_name: 'Audit::PublishedSessionVersion' },
ignore: [:updated_at, :created_at, :lock_version, :sort_order],
ignore: [:updated_at, :created_at, :lock_version, :sort_order, :integrations],
limit: nil

include RankedModel
Expand Down
16 changes: 14 additions & 2 deletions app/services/session_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ def self.published_sessions
.order(:start_time)
end

def self.draft_sessions
Session.select(
::Session.arel_table[Arel.star],
'areas_list.area_list'
)
.includes(:format, :room, {participant_assignments: :person})
.joins(self.area_subquery)
.where("start_time is not null and room_id is not null")
.where("status != 'dropped'")
.order(:start_time)
end

def self.live_sessions
Session.select(
::Session.arel_table[Arel.star],
Expand Down Expand Up @@ -147,7 +159,7 @@ def self.live_people
.order("people.published_name")
end

def self.live_moderators
def self.draft_moderators
moderator = SessionAssignmentRoleType.find_by(name: 'Moderator')

people = Person.includes(
Expand All @@ -157,7 +169,7 @@ def self.live_moderators
)
.where("session_assignments.session_assignment_role_type_id in (?)", [moderator.id])
.where("sessions.start_time is not null and sessions.room_id is not null")
.where("sessions.status != 'dropped' and sessions.status != 'draft'")
.where("sessions.status != 'dropped'")
.where("people.con_state not in (?)", ['declined', 'rejected']) #.distinct
.order("people.published_name")
end
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
get 'report/program_ops_reports/back_of_badge', to: 'reports/program_ops_reports#back_of_badge'

get 'report/schedule_reports/schedule_diff(/:from)(/:to)', to: 'reports/schedule_reports#schedule_diff'
get 'publication_date/reset', to: 'publication_dates#reset'
resources :publication_dates, path: 'publication_date', only: [:index]

resources :availabilities, path: 'availability', except: [:index]
Expand Down

0 comments on commit da7d9f1

Please sign in to comment.