-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #547 from ChicagoWorldcon/development
1.7 release candidate
- Loading branch information
Showing
76 changed files
with
1,504 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
class MailHistoriesController < ResourceController | ||
# TBD | ||
MODEL_CLASS = 'MailHistory'.freeze | ||
SERIALIZER_CLASS = 'MailHistorySerializer'.freeze | ||
POLICY_CLASS = 'MailHistoryPolicy'.freeze | ||
POLICY_SCOPE_CLASS = 'MailHistoryPolicy::Scope'.freeze | ||
DEFAULT_SORTBY = 'date_sent'.freeze | ||
DEFAULT_ORDER = 'desc'.freeze | ||
|
||
def belongs_to_param_id | ||
params[:person_id] | ||
end | ||
|
||
def belong_to_class | ||
Person | ||
end | ||
|
||
def belongs_to_relationship | ||
'mail_histories' | ||
end | ||
|
||
def paginate | ||
false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
class PublicationsController < ApplicationController | ||
around_action :set_timezone | ||
|
||
def schedule | ||
sessions = SessionService.live_sessions | ||
|
||
send_data XmlFormatter.new(sessions).render('schedule', sessions) | ||
.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. -->') | ||
.gsub(/\<schedule\>\n /, '<schedule>') | ||
.gsub(/\<session\>\n /, '<session>') | ||
.gsub(/ \</, '<') | ||
.gsub(/ \</, '<') | ||
.gsub(/ \</, '<') | ||
.gsub(/\<id\>(\d+)\<\/id\>\n\<title>/, '<title><id>\1</id> | ') | ||
.gsub(/\n\<start_time\>/, '<start_time>') | ||
.gsub(/\n\<duration\>/, ' - <duration>') | ||
.gsub(/\<\/duration\>/, ' minutes</duration>') | ||
.gsub(/\n\<\/timeduration\>/, '</timeduration>') | ||
.gsub(/\n\<room\>/, '<room>') | ||
.gsub(/\n\<areas\>/, ' - <areas>') | ||
.gsub(/\n\<format\>/, ', <format>') | ||
.gsub(/\n\<\/roomareasformat\>/, '</roomareasformat>') | ||
.gsub(/\<participants\>\n/, '<participants>') | ||
.gsub(/\<person\>\n/, '<person>') | ||
.gsub(/\n\<person\>/, '<person>') | ||
.gsub(/\\n <role\>/, '<role>') | ||
.gsub(/\<role\>Participant\<\/role>/, '') | ||
.gsub(/\<\/person\>\<role\>/, '</person> <role>') | ||
.gsub(/\<\/person\>\<person\>/, '</person>, <person>') | ||
.gsub(/\<\/participants\>\n/, '</participants>') | ||
.gsub(/\<\/name\>\n/, '</name>') | ||
.gsub(/\n\<\/person\>/, '</person>') | ||
.gsub(/\n\<\/participants\>/, '</participants>') | ||
.gsub(/\<role\>Participant\<\/role>/, '') | ||
.gsub(/\n\<\/session\>/, '</session>') | ||
.gsub(/\n\<\/schedule\>\n/, '</schedule>'), | ||
filename: "schedule.xml", | ||
disposition: 'attachment' | ||
end | ||
|
||
def set_timezone(&block) | ||
timezone = ConfigService.value('convention_timezone') | ||
Time.use_zone(timezone, &block) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
class Reports::PeopleReportsController < ApplicationController | ||
around_action :set_timezone | ||
|
||
def record_stream_permissions | ||
authorize Person, policy_class: ReportPolicy | ||
|
||
# People: moderators, participants. NO INVIS, NO RESEVER | ||
|
||
active_roles = SessionAssignmentRoleType.where("role_type = 'participant' and (name != 'Invisible' and name != 'Reserve')") | ||
people = Person | ||
.includes({sessions: :room}, :primary_email) | ||
.references(:sessions) | ||
.where("session_assignments.session_assignment_role_type_id not in (select id from session_assignment_role_type where session_assignment_role_type.name = 'Invisible')") | ||
.where("session_assignments.session_assignment_role_type_id not in (select id from session_assignment_role_type where session_assignment_role_type.name = 'Reserve')") | ||
.order('people.published_name asc') | ||
|
||
|
||
# Person published names, primary email, attendance type, | ||
# participant status, permission to stream, | ||
# exclusions for streaming, permission to record, exclusions to recording, | ||
# their schedule (in one cell with session title time duration room. If not possible one line per session will have to do) | ||
|
||
workbook = FastExcel.open(constant_memory: true) | ||
worksheet = workbook.add_worksheet("Record and Stream Permissions") | ||
|
||
worksheet.append_row( | ||
[ | ||
'Name', | ||
'Published Name', | ||
'Primary Email', | ||
'Attendance Type', | ||
'Participant Status', | ||
'Permission to Stream', | ||
'Streaming Exceptions', | ||
'Permission to Record', | ||
'Recording Exceptions', | ||
'Schedule' | ||
] | ||
) | ||
|
||
people.each do |person| | ||
worksheet.append_row( | ||
[ | ||
person.name, | ||
person.published_name, | ||
person.primary_email&.email, | ||
person.attendance_type, | ||
person.con_state, | ||
person.can_stream, | ||
person.can_stream_exceptions, | ||
person.can_record, | ||
person.can_record_exceptions, | ||
person.sessions.scheduled.collect{|s| "'#{s.title}' - #{s.start_time.strftime('%Y-%m-%d %H:%M %Z')} - #{s.duration} mins - #{s.room.name}" }.join(";\n") | ||
] | ||
) | ||
end | ||
|
||
send_data workbook.read_string, | ||
filename: "PeopleRecordStream-#{Time.now.strftime('%m-%d-%Y')}.xlsx", | ||
disposition: 'attachment' | ||
end | ||
|
||
def set_timezone(&block) | ||
timezone = ConfigService.value('convention_timezone') | ||
Time.use_zone(timezone, &block) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template> | ||
<div> | ||
<edit-modal | ||
v-bind="$attrs" | ||
:id="id" | ||
:title="title" | ||
@cancel="$emit('cancel', $event)" | ||
@close="$emit('close', $event)" | ||
@ok="confirm" | ||
ok-title="Confirm" | ||
no-stacking | ||
> | ||
<slot v-for="(_, name) in modalSlots" :name="name" :slot="name"></slot> | ||
<template v-for="(_, name) in modalScopedSlots" :slot="name" slot-scope="slotData"><slot :name="name" v-bind="slotData"></slot></template> | ||
</edit-modal> | ||
<edit-modal | ||
v-on="$listeners" | ||
:id="confirmId" | ||
@cancel="$emit('cancel', $event)" | ||
@close="$emit('close', $event)" | ||
:title="confirmTitle" | ||
> | ||
<slot v-for="(_, name) in confirmSlots" :name="`confirm-${name}`" :slot="name"></slot> | ||
<template v-for="(_, name) in confirmScopedSlots" :slot="name" slot-scope="slotData"><slot :name="`confirm-${name}`" v-bind="slotData"></slot></template> | ||
</edit-modal> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import EditModal from './edit_modal'; | ||
export default { | ||
name: "BulkEditModal", | ||
props: { | ||
id: { | ||
type: String, | ||
default: 'bulk-edit' | ||
}, | ||
title: { | ||
type: String, | ||
default: "Bulk Edit" | ||
} | ||
}, | ||
components: { | ||
EditModal | ||
}, | ||
computed: { | ||
confirmId() { | ||
return `${this.id}-confirm` | ||
}, | ||
confirmTitle() { | ||
return `${this.title} Confirmation` | ||
}, | ||
modalSlots() { | ||
return Object.fromEntries(Object.entries(this.$slots).filter(([name, _]) => !name.startsWith('confirm'))) | ||
}, | ||
confirmSlots() { | ||
return Object.fromEntries(Object.entries(this.$slots).filter(([name, _]) => name.startsWith('confirm')).map(([name, val]) => [name.replace(/confirm-/, ''), val])) | ||
}, | ||
modalScopedSlots() { | ||
return Object.fromEntries(Object.entries(this.$scopedSlots).filter(([name, _]) => !name.startsWith('confirm'))) | ||
}, | ||
confirmScopedSlots() { | ||
return Object.fromEntries(Object.entries(this.$scopedSlots).filter(([name, _]) => name.startsWith('confirm')).map(([name, val]) => [name.replace(/confirm-/,''), val])) | ||
} | ||
}, | ||
methods: { | ||
confirm() { | ||
this.$bvModal.show(this.confirmId) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.