Compare commits
5 Commits
change-sub
...
big-admin-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee873a2cbe | ||
|
|
f99d607a69 | ||
|
|
88836e937e | ||
|
|
e3d4d22a34 | ||
|
|
3690268f83 |
@@ -1,8 +1,13 @@
|
||||
$(document).on "turbolinks:load", ->
|
||||
subscribeToBroadcast = (broadcastToken) -> App.cable.subscriptions.create { channel: "BroadcastsChannel", token: broadcastToken },
|
||||
# Only connect if a broadcast-token meta tag is present
|
||||
broadcast_meta = document.querySelector("meta[name=broadcast-token]")
|
||||
return unless broadcast_meta
|
||||
|
||||
broadcastToken = broadcast_meta.getAttribute("content")
|
||||
|
||||
App.public = App.cable.subscriptions.create { channel: "BroadcastsChannel", token: broadcastToken },
|
||||
connected: ->
|
||||
# Called when the subscription is ready for use on the server
|
||||
console.info "Subscribed to channel for broadcast:#{broadcastToken}"
|
||||
|
||||
disconnected: ->
|
||||
# Called when the subscription has been terminated by the server
|
||||
@@ -12,7 +17,6 @@ $(document).on "turbolinks:load", ->
|
||||
switch data.event
|
||||
when "broadcast_stream_update" then @refreshBroadcastVideo(data)
|
||||
when "stream_recording_ready" then @showBroadcastRecordings(data)
|
||||
when "file_upload_update" then @refreshBroadcastFilesTab(data)
|
||||
|
||||
refreshBroadcastVideo: (data) ->
|
||||
$("#broadcast_updates").html data.status_content
|
||||
@@ -33,12 +37,3 @@ $(document).on "turbolinks:load", ->
|
||||
$(".flash-message").html data.flash_content
|
||||
$("#broadcast_recordings").html data.recordings_content
|
||||
$("#broadcast_recordings_nav").html data.recordings_nav_content
|
||||
|
||||
refreshBroadcastFilesTab: (data) ->
|
||||
$("#broadcast_file_list_#{data.broadcast_token}").html data.files_content
|
||||
$("#broadcast_files_pagination_#{data.broadcast_token}").html data.pagination_content
|
||||
|
||||
# Create a channel subscription for every broadcast included in the meta tags
|
||||
get_token = (meta) -> meta.getAttribute("content")
|
||||
broadcast_tokens = (get_token broadcast_meta for broadcast_meta in document.querySelectorAll("meta[name=broadcast-token]"))
|
||||
subscribeToBroadcast token for token in broadcast_tokens
|
||||
|
||||
@@ -16,7 +16,6 @@ $(document).on "turbolinks:load", ->
|
||||
switch data.event
|
||||
when "video_status_update" then @showVideoStatusUpdate(data.content)
|
||||
when "download_status_update" then @showDownloadStatusUpdate(data.content)
|
||||
when "conference_recording_ready" then @showDownloadStatusUpdate(data.content)
|
||||
|
||||
showVideoStatusUpdate: (content) ->
|
||||
$("[data-ujs-target='video-analysis-msg']").replaceWith content
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
$(document).on("change", "[data-toggle=collapse-select]", function(event) {
|
||||
const select = event.target;
|
||||
const mappings = JSON.parse(select.dataset.targetShowValuesMapping);
|
||||
|
||||
$.each(mappings, function( key, value ) {
|
||||
if (value.indexOf(select.value) > -1) {
|
||||
$(key).show("fast");
|
||||
} else {
|
||||
$(key).hide("fast");
|
||||
}
|
||||
});
|
||||
});
|
||||
const target = select.dataset.target;
|
||||
const showValues = JSON.parse(select.dataset.showValues);
|
||||
|
||||
$(document).on("turbolinks:load", function() {
|
||||
$("[data-toggle=collapse-select]").trigger("change");
|
||||
});
|
||||
if (showValues.indexOf(select.value) > -1) {
|
||||
$(target).show("fast");
|
||||
} else {
|
||||
$(target).hide("fast");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ function selectBroadcast(clicked_element, checkbox) {
|
||||
if (broadcast_ids.length >= 2) {
|
||||
multi_view_ids = $.param({multi_view_ids: broadcast_ids});
|
||||
broadcast_url = "/en/projects/" + project_id + "/broadcasts/" + broadcast_ids[0] + "?" + multi_view_ids
|
||||
|
||||
|
||||
$("#multi_view_broadcasts").attr("href", broadcast_url);
|
||||
$("#multi_view_broadcasts").attr("target", "_blank");
|
||||
$("#multi_view_broadcasts").removeClass('disabled');
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
@import "dropzone/dist/dropzone";
|
||||
@import 'bootstrap-datepicker';
|
||||
|
||||
// Global styles
|
||||
label {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
// Wordmarks
|
||||
.suite-wordmark {
|
||||
font-weight: normal;
|
||||
|
||||
@@ -28,21 +28,10 @@ class BroadcastsChannel < ApplicationCable::Channel
|
||||
recordings_content = ApplicationController.render partial: "broadcasts/broadcast_recordings", locals: { recordings: recordings, broadcast: broadcast }
|
||||
recordings_nav_content = ApplicationController.render partial: "broadcasts/broadcast_recording_nav", collection: recordings, as: :broadcast_recording
|
||||
|
||||
broadcast_to broadcast,
|
||||
event: :stream_recording_ready,
|
||||
flash_content: flash_content,
|
||||
broadcast_to broadcast,
|
||||
event: :stream_recording_ready,
|
||||
flash_content: flash_content,
|
||||
recordings_content: recordings_content,
|
||||
recordings_nav_content: recordings_nav_content
|
||||
end
|
||||
|
||||
def self.broadcast_file_upload_updates(broadcast, files, pagination_content)
|
||||
files_content = ApplicationController.render partial: "broadcasts/file", collection: files
|
||||
|
||||
broadcast_to broadcast, {
|
||||
event: :file_upload_update,
|
||||
broadcast_token: broadcast.token,
|
||||
files_content: files_content,
|
||||
pagination_content: pagination_content
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class ProjectsChannel < ApplicationCable::Channel
|
||||
|
||||
|
||||
def subscribed
|
||||
# TODO: How can we get the current account in this context
|
||||
project = current_user.accessible_projects_for(current_user.primary_account).find(params[:id])
|
||||
@@ -25,12 +25,4 @@ class ProjectsChannel < ApplicationCable::Channel
|
||||
content = ApplicationController.render partial: "application/flash", locals: { flash: flash }
|
||||
broadcast_to download.project, event: :download_status_update, content: content
|
||||
end
|
||||
|
||||
def self.conference_recording_ready(project, recording)
|
||||
link = ApplicationController.helpers.link_to('Download here.', recording.service_url, target: '_blank', class: 'alert-link')
|
||||
notification = "A recording of your video conference is now available. #{link}"
|
||||
flash = OpenStruct.new(notice: notification)
|
||||
content = ApplicationController.render partial: 'application/flash', locals: { flash: flash }
|
||||
broadcast_to project, event: :conference_recording_ready, content: content
|
||||
end
|
||||
end
|
||||
|
||||
@@ -61,8 +61,7 @@ class AcquiredMediaReleasesController < ApplicationController
|
||||
:name,
|
||||
:territory,
|
||||
:term,
|
||||
:person_first_name,
|
||||
:person_last_name,
|
||||
:person_name,
|
||||
:person_phone,
|
||||
:person_email,
|
||||
:person_company,
|
||||
|
||||
32
app/controllers/admin/task_requests_controller.rb
Normal file
32
app/controllers/admin/task_requests_controller.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
class Admin::TaskRequestsController < Admin::ApplicationController
|
||||
before_action :set_task_request, only: [:edit, :update, :show]
|
||||
|
||||
def index
|
||||
@task_requests = task_requests.order_by_recent.paginate(page: params[:page])
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
if @task_request.update(task_request_params)
|
||||
redirect_to [:admin, :task_requests], notice: t(".notice")
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def task_request_params
|
||||
params.require(:task_request).permit(:status, :deliverable_url)
|
||||
end
|
||||
|
||||
def task_requests
|
||||
policy_scope TaskRequest
|
||||
end
|
||||
|
||||
def set_task_request
|
||||
@task_request = authorize policy_scope(TaskRequest).find(params[:id])
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
class BroadcastsController < ApplicationController
|
||||
layout "project"
|
||||
|
||||
|
||||
before_action :set_project
|
||||
before_action :build_broadcast, only: [:new, :create]
|
||||
before_action :set_broadcast, only: [:show, :destroy, :update]
|
||||
@@ -24,19 +24,16 @@ class BroadcastsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@conference_url = url_for [@broadcast.project, @broadcast, :zoom_meeting]
|
||||
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page])
|
||||
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page])
|
||||
render layout: 'application'
|
||||
end
|
||||
|
||||
def update
|
||||
@broadcast.update(broadcast_params)
|
||||
@files = @broadcast.files.order("created_at DESC").paginate(page: 1)
|
||||
end
|
||||
|
||||
pagination_content = ApplicationController.render html: helpers.will_paginate(@files, params: { active_tab: params[:active_tab], page: params[:page], active_files_tab: params[:active_files_tab] })
|
||||
BroadcastsChannel.broadcast_file_upload_updates(@broadcast, @files, pagination_content)
|
||||
def show
|
||||
@conference_url = url_for [@broadcast.project, @broadcast, :zoom_meeting]
|
||||
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page])
|
||||
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:page])
|
||||
render layout: 'application'
|
||||
end
|
||||
|
||||
def destroy
|
||||
@@ -71,10 +68,7 @@ class BroadcastsController < ApplicationController
|
||||
|
||||
def set_multi_view_broadcasts
|
||||
authorized_broadcasts = authorize policy_scope(Broadcast).where(id: params[:multi_view_ids]).order_by_recent
|
||||
@multi_view_broadcasts = authorized_broadcasts.map do |b|
|
||||
files_page = params[:files_page] if params[:active_files_tab] == b.token
|
||||
MultiViewBroadcast.new(b, params[:multi_view_ids], files_page)
|
||||
end
|
||||
@multi_view_broadcasts = authorized_broadcasts.map { |b| MultiViewBroadcast.new(b, params[:multi_view_ids]) }
|
||||
end
|
||||
|
||||
def filtered_broadcasts
|
||||
@@ -93,29 +87,20 @@ class BroadcastsController < ApplicationController
|
||||
|
||||
class MultiViewBroadcast
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
|
||||
delegate_missing_to :@broadcast
|
||||
|
||||
def initialize(broadcast, multi_view_ids, paginate_page)
|
||||
|
||||
def initialize(broadcast, multi_view_ids)
|
||||
@broadcast = broadcast
|
||||
@multi_view_ids = multi_view_ids
|
||||
@paginate_page = paginate_page
|
||||
end
|
||||
|
||||
def url
|
||||
project_broadcast_path(@broadcast.project, @broadcast, multi_view_ids: @multi_view_ids, locale: I18n.locale)
|
||||
end
|
||||
|
||||
def files
|
||||
@broadcast.files.order("created_at DESC").paginate(page: @paginate_page)
|
||||
end
|
||||
|
||||
|
||||
def uid
|
||||
id
|
||||
end
|
||||
|
||||
def self.model_name
|
||||
Broadcast.model_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
module MedicalReleaseContext
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def medical_releases
|
||||
policy_scope(MedicalRelease)
|
||||
end
|
||||
|
||||
def set_medical_release
|
||||
medical_release_id = params[:medical_release_id] || params[:id]
|
||||
|
||||
@medical_release = authorize medical_releases.find(medical_release_id)
|
||||
end
|
||||
end
|
||||
@@ -61,12 +61,7 @@ class ContractTemplatesController < ApplicationController
|
||||
:applicable_medium_id, :applicable_medium_text,
|
||||
:territory_id, :territory_text,
|
||||
:term_id, :term_text,
|
||||
:restriction_id, :restriction_text,
|
||||
:question_1_text, :question_2_text,
|
||||
:question_3_text, :question_4_text,
|
||||
:question_5_text, :question_6_text,
|
||||
:question_7_text, :question_8_text,
|
||||
:question_9_text, :question_10_text)
|
||||
:restriction_id, :restriction_text)
|
||||
end
|
||||
|
||||
def download_attributes
|
||||
|
||||
@@ -68,8 +68,7 @@ class LocationReleasesController < ApplicationController
|
||||
:territory_id, :territory_text,
|
||||
:term_id, :term_text,
|
||||
:restriction_id, :restriction_text,
|
||||
:filming_started_on, :filming_ended_on,
|
||||
:filming_hours
|
||||
:filming_started_on, :filming_ended_on
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
class MedicalReleasesController < ApplicationController
|
||||
include ProjectContext, MedicalReleaseContext
|
||||
|
||||
before_action :set_project, only: [:index]
|
||||
before_action :set_medical_release, only: [:destroy]
|
||||
|
||||
include ProjectLayout
|
||||
|
||||
def index
|
||||
@medical_releases = filtered_medical_releases.order_by_recent.paginate(page: params[:page])
|
||||
end
|
||||
|
||||
def destroy
|
||||
@project = @medical_release.project
|
||||
|
||||
if @medical_release.destroy
|
||||
redirect_to [@project, :medical_releases], alert: t(".alert")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def medical_releases
|
||||
if @project
|
||||
policy_scope(@project.medical_releases)
|
||||
else
|
||||
policy_scope(MedicalRelease)
|
||||
end
|
||||
end
|
||||
|
||||
def filtered_medical_releases
|
||||
results = medical_releases
|
||||
|
||||
if params[:query].present?
|
||||
results = results.search(params[:query])
|
||||
end
|
||||
|
||||
results
|
||||
end
|
||||
end
|
||||
@@ -18,7 +18,6 @@ class PasswordResetsController < ApplicationController
|
||||
end
|
||||
|
||||
def edit
|
||||
redirect_to new_session_path, notice: t(".notice") if @user.nil?
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@@ -60,7 +60,7 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
|
||||
def features_settings_params
|
||||
%i(appearance_release location_release material_release acquired_media_release music_release talent_release medical_release video_analysis)
|
||||
%i(appearance_release location_release material_release acquired_media_release music_release talent_release video_analysis)
|
||||
end
|
||||
|
||||
def project_params_with_current_account
|
||||
|
||||
@@ -45,9 +45,6 @@ class Public::AcquiredMediaReleasesController < Public::BaseController
|
||||
params.require(:acquired_media_release).permit(
|
||||
:name,
|
||||
:description,
|
||||
:person_first_name,
|
||||
:person_last_name,
|
||||
:person_email,
|
||||
:person_title,
|
||||
:person_phone,
|
||||
:person_fax,
|
||||
|
||||
@@ -6,17 +6,14 @@ class Public::BroadcastsController < Public::BaseController
|
||||
@conference_url = broadcast_zoom_meeting_url(@broadcast.token)
|
||||
@multi_view_broadcasts = multi_view_broadcasts
|
||||
@recordings = @broadcast.broadcast_recordings.order_by_recent.paginate(page: params[:page])
|
||||
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:files_page])
|
||||
|
||||
@files = @broadcast.files.order("created_at DESC").paginate(page: params[:page])
|
||||
|
||||
render 'broadcasts/show'
|
||||
end
|
||||
|
||||
def update
|
||||
@broadcast.update(broadcast_params)
|
||||
@files = @broadcast.files.order("created_at DESC").paginate(page: 1)
|
||||
|
||||
pagination_content = ApplicationController.render html: helpers.will_paginate(@files,params: { active_tab: params[:active_tab], page: params[:page], active_files_tab: params[:active_files_tab] })
|
||||
BroadcastsChannel.broadcast_file_upload_updates(@broadcast, @files, pagination_content)
|
||||
end
|
||||
|
||||
private
|
||||
@@ -29,10 +26,7 @@ class Public::BroadcastsController < Public::BaseController
|
||||
Broadcast.
|
||||
where(token: params[:multi_view_tokens]).
|
||||
order_by_recent.
|
||||
map do |b|
|
||||
files_page = params[:files_page] if params[:active_files_tab] == b.token
|
||||
MultiViewBroadcast.new(b, params[:multi_view_tokens], files_page)
|
||||
end
|
||||
map { |b| MultiViewBroadcast.new(b, params[:multi_view_tokens]) }
|
||||
end
|
||||
|
||||
def set_broadcast
|
||||
@@ -41,29 +35,20 @@ class Public::BroadcastsController < Public::BaseController
|
||||
|
||||
class MultiViewBroadcast
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
|
||||
delegate_missing_to :@broadcast
|
||||
|
||||
def initialize(broadcast, multi_view_tokens, paginate_page)
|
||||
|
||||
def initialize(broadcast, multi_view_tokens)
|
||||
@broadcast = broadcast
|
||||
@multi_view_tokens = multi_view_tokens
|
||||
@paginate_page = paginate_page
|
||||
end
|
||||
|
||||
def url
|
||||
broadcast_url(uid, multi_view_tokens: @multi_view_tokens, host: AppHost.new.domain_with_port, locale: I18n.locale)
|
||||
end
|
||||
|
||||
def files
|
||||
@broadcast.files.order("created_at DESC").paginate(page: @paginate_page)
|
||||
end
|
||||
|
||||
|
||||
def uid
|
||||
token
|
||||
end
|
||||
|
||||
def self.model_name
|
||||
Broadcast.model_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,9 +63,7 @@ class Public::LocationReleasesController < Public::BaseController
|
||||
:person_address_zip,
|
||||
:person_address_country,
|
||||
:signature_base64,
|
||||
:locale, :contract_template, :filming_started_on, :filming_ended_on,
|
||||
:filming_hours,
|
||||
photos: []
|
||||
:locale, :contract_template, :filming_started_on, :filming_ended_on
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class Public::MaterialReleasesController < Public::BaseController
|
||||
:person_first_name, :person_last_name, :person_title, :person_company, :person_phone, :person_email,
|
||||
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
|
||||
:signature_base64,
|
||||
:locale, :contract_template, :description, photos: []
|
||||
:locale, :contract_template, :description
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
class Public::MedicalReleasesController < Public::BaseController
|
||||
before_action :set_account, :set_project, :set_contract_template
|
||||
|
||||
def new
|
||||
@medical_release = build_medical_release
|
||||
end
|
||||
|
||||
def create
|
||||
@medical_release = build_medical_release(medical_release_params_with_locale_and_contract_template)
|
||||
|
||||
if @medical_release.save(context: :native)
|
||||
if @medical_release.contract_template.present?
|
||||
AttachContractToReleasableJob.perform_later(@medical_release)
|
||||
end
|
||||
log_create_analytics
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_project
|
||||
@project = @account.projects.find(params[:project_id])
|
||||
end
|
||||
|
||||
def set_account
|
||||
@account = Account.find_by(slug: params[:account_id])
|
||||
end
|
||||
|
||||
def set_contract_template
|
||||
@contract_template = @project.contract_templates.find(params[:contract_template_id])
|
||||
end
|
||||
|
||||
def medical_releases
|
||||
policy_scope(@project.medical_releases)
|
||||
end
|
||||
|
||||
def build_medical_release(params = {})
|
||||
authorize medical_releases.build(params)
|
||||
end
|
||||
|
||||
def medical_release_params
|
||||
params
|
||||
.require(:medical_release)
|
||||
.permit(
|
||||
person_params,
|
||||
:signature_base64,
|
||||
:locale,
|
||||
:contract_template,
|
||||
:question_1_answer, :question_2_answer,
|
||||
:question_3_answer, :question_4_answer,
|
||||
:question_5_answer, :question_6_answer,
|
||||
:question_7_answer, :question_8_answer,
|
||||
:question_9_answer, :question_10_answer,
|
||||
photos: [],
|
||||
)
|
||||
end
|
||||
|
||||
def person_params
|
||||
[
|
||||
:person_first_name,
|
||||
:person_last_name,
|
||||
:person_phone,
|
||||
:person_email,
|
||||
:person_address_street1,
|
||||
:person_address_street2,
|
||||
:person_address_city,
|
||||
:person_address_state,
|
||||
:person_address_zip,
|
||||
:person_address_country,
|
||||
]
|
||||
end
|
||||
|
||||
def medical_release_params_with_locale
|
||||
medical_release_params.merge(locale: I18n.locale)
|
||||
end
|
||||
|
||||
def medical_release_params_with_locale_and_contract_template
|
||||
medical_release_params_with_locale.merge(contract_template: @contract_template)
|
||||
end
|
||||
|
||||
def log_create_analytics
|
||||
TrackAnalyticsJob.perform_later(nil, nil, :track_create_native_release, release_type: MedicalRelease.to_s, account: @account, user_agent: request.user_agent, user_ip: request.remote_ip)
|
||||
end
|
||||
end
|
||||
74
app/controllers/task_requests_controller.rb
Normal file
74
app/controllers/task_requests_controller.rb
Normal file
@@ -0,0 +1,74 @@
|
||||
class TaskRequestsController < ApplicationController
|
||||
layout "project"
|
||||
|
||||
before_action :set_project
|
||||
before_action :build_task_request, only: [:new, :create]
|
||||
before_action :set_task_request, only: [:show, :edit, :update, :cancel]
|
||||
|
||||
def index
|
||||
if params[:completed_only]
|
||||
@task_requests = task_requests.completed.order_by_recent.paginate(page: params[:page])
|
||||
else
|
||||
@task_requests = task_requests.order_by_recent.paginate(page: params[:page])
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
@task_request.attributes = task_request_params
|
||||
|
||||
if @task_request.save
|
||||
log_create_analytics
|
||||
redirect_to [@project, :task_requests], notice: t(".notice")
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
if @task_request.update(task_request_params)
|
||||
redirect_to [@project, :task_requests], notice: t(".notice")
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
def cancel
|
||||
@task_request.cancelled!
|
||||
redirect_to [@project, :task_requests], notice: t(".notice")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def task_request_params
|
||||
params.require(:task_request).permit(:description, :deadline, :time_allowed, :additional_notes, files: [])
|
||||
end
|
||||
|
||||
def set_project
|
||||
@project = policy_scope(Project).find(params[:project_id])
|
||||
end
|
||||
|
||||
def set_task_request
|
||||
@task_request = authorize policy_scope(TaskRequest).find(params[:id])
|
||||
end
|
||||
|
||||
def task_requests
|
||||
authorize policy_scope(@project.task_requests)
|
||||
end
|
||||
|
||||
def build_task_request
|
||||
@task_request = authorize @project.task_requests.build
|
||||
end
|
||||
|
||||
def log_create_analytics
|
||||
TrackAnalyticsJob.perform_later(Current.user, Current.account, :track_create_task_request, user_agent: request.user_agent, user_ip: request.remote_ip)
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ class ZoomNotificationsController < ApplicationController
|
||||
skip_before_action :verify_authenticity_token
|
||||
|
||||
before_action :authorize_zoom
|
||||
before_action :set_zoom_meeting, only: [:create], if: :meeting_event?
|
||||
before_action :set_zoom_meeting, only: :create
|
||||
|
||||
def create
|
||||
case notification_event
|
||||
@@ -13,17 +13,8 @@ class ZoomNotificationsController < ApplicationController
|
||||
@zoom_meeting.started!
|
||||
when 'meeting.ended'
|
||||
@zoom_meeting.ended!
|
||||
when 'recording.completed'
|
||||
recording = notification.dig(:payload, :object, :recording_files).first
|
||||
AttachRecordingToZoomMeetingJob.perform_later(@zoom_meeting, recording, notification['download_token'])
|
||||
when 'user.deleted'
|
||||
zoom_user = ZoomUser.find_by(api_id: notification.dig(:payload, :object, :id))
|
||||
if zoom_user.present?
|
||||
zoom_user.api_id = nil
|
||||
zoom_user.destroy
|
||||
end
|
||||
else
|
||||
Rails.logger.info notification_event
|
||||
Rails.logger.info notification_type
|
||||
Rails.logger.info notification
|
||||
end
|
||||
|
||||
@@ -32,24 +23,16 @@ class ZoomNotificationsController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def notification
|
||||
params.to_unsafe_h
|
||||
end
|
||||
|
||||
def notification_event
|
||||
notification.dig(:event)
|
||||
params.dig(:event)
|
||||
end
|
||||
|
||||
def notification_meeting_id
|
||||
notification.dig(:payload, :object, :id)
|
||||
params.dig(:payload, :object, :id)
|
||||
end
|
||||
|
||||
def notification_host_id
|
||||
notification.dig(:payload, :object, :host_id)
|
||||
end
|
||||
|
||||
def meeting_event?
|
||||
notification_event.split(".").first.to_s.in? %w(meeting recording)
|
||||
params.dig(:payload, :object, :host_id)
|
||||
end
|
||||
|
||||
def set_zoom_meeting
|
||||
|
||||
@@ -41,7 +41,7 @@ module ContactInfoHelper
|
||||
end
|
||||
|
||||
def email_abbr(email)
|
||||
content_tag(:abbr, "E: ", title: "Email") + mail_to(email)
|
||||
content_tag(:abbr, "E: ", title: "Email") + email
|
||||
end
|
||||
|
||||
def phone_abbr(phone)
|
||||
|
||||
@@ -3,12 +3,8 @@ module DropzoneHelper
|
||||
case releasable.model_name.param_key
|
||||
when "acquired_media_release"
|
||||
"To Add Photos & Videos to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse photos and connect to Camera"
|
||||
when "material_release"
|
||||
t 'material_releases.form.photos.dropzone_label'
|
||||
when "music_release"
|
||||
"To Add Audio Files to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
||||
when "location_release"
|
||||
t 'location_releases.form.photos.dropzone_label'
|
||||
when "directory"
|
||||
"To Add Files to the Folder:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
||||
else
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
class AttachRecordingToZoomMeetingJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(zoom_meeting, recording_hash, download_token)
|
||||
download_url = "#{recording_hash['download_url']}?access_token=#{download_token}"
|
||||
file = URI.open(download_url)
|
||||
if zoom_meeting.recording.attach(io: file, filename: file_name(zoom_meeting, recording_hash), content_type: 'video/mp4')
|
||||
# Temorarily disabling notifications
|
||||
# if zoom_meeting.project.present?
|
||||
# ProjectsChannel.conference_recording_ready(zoom_meeting.project, zoom_meeting.recording)
|
||||
# end
|
||||
|
||||
gateway = ZoomGateway.new
|
||||
gateway.delete_recording(zoom_meeting.api_meeting_id, recording_hash['id'])
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def file_name(zoom_meeting, recording_hash)
|
||||
start = recording_hash['recording_start'].to_datetime
|
||||
prefix = zoom_meeting.project.present? ? "#{zoom_meeting.project.name}_" : ''
|
||||
"#{prefix}video_conference_date#{start.strftime("%Y-%m-%d")}_Time_#{start.strftime("%T")}.mp4"
|
||||
end
|
||||
end
|
||||
@@ -54,8 +54,7 @@ class Account < ApplicationRecord
|
||||
Download.where(project: projects),
|
||||
User.joins(:project_memberships).where(project_memberships: { project: projects }),
|
||||
Broadcast.where(project: projects),
|
||||
ZoomMeeting.where(project: projects),
|
||||
MedicalRelease.where(project: projects),
|
||||
TaskRequest.where(project: projects),
|
||||
self
|
||||
])).sum(:byte_size).to_f
|
||||
end
|
||||
@@ -80,6 +79,10 @@ class Account < ApplicationRecord
|
||||
plan_uid.to_s == "me_suite" || plan_uid.to_s == "releaseme"
|
||||
end
|
||||
|
||||
def assistme_enabled?
|
||||
plan_uid.to_s == "me_suite" || plan_uid.to_s == "assistme"
|
||||
end
|
||||
|
||||
def plan_name
|
||||
case plan_uid.to_s
|
||||
when "deliverme"
|
||||
@@ -88,6 +91,8 @@ class Account < ApplicationRecord
|
||||
"DirectME"
|
||||
when "releaseme"
|
||||
"ReleaseME"
|
||||
when "assistme"
|
||||
"AssistME"
|
||||
when "me_suite"
|
||||
"ME Suite"
|
||||
end
|
||||
|
||||
@@ -43,8 +43,7 @@ class AcquiredMediaRelease < ApplicationRecord
|
||||
person_address_street1 person_address_street2 person_address_city person_address_state person_address_zip person_address_country
|
||||
]
|
||||
|
||||
# CATEGORIES = ["Artwork", "Film Footage", "Video Footage", "Still Photograph"].freeze
|
||||
CATEGORIES = ["Film Footage", "Video Footage", "Still Photograph"].freeze
|
||||
CATEGORIES = ["Artwork", "Film Footage", "Video Footage", "Still Photograph"].freeze
|
||||
|
||||
def minor?
|
||||
false
|
||||
|
||||
@@ -7,6 +7,8 @@ class Broadcast < ApplicationRecord
|
||||
|
||||
has_secure_token
|
||||
|
||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
enum status: [:created, :active, :idle]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
class BroadcastRecording < ApplicationRecord
|
||||
belongs_to :broadcast
|
||||
|
||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||
|
||||
delegate :name, to: :broadcast, prefix: :broadcast
|
||||
|
||||
validates :asset_uid, uniqueness: true
|
||||
|
||||
@@ -6,6 +6,8 @@ module Releasable
|
||||
included do
|
||||
belongs_to :project, touch: true
|
||||
belongs_to :contract_template, optional: true
|
||||
|
||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||
end
|
||||
|
||||
def release_number
|
||||
|
||||
@@ -13,7 +13,6 @@ class ContractTemplate < ApplicationRecord
|
||||
has_many :acquired_media_releases, dependent: :restrict_with_error
|
||||
has_many :location_releases, dependent: :restrict_with_error
|
||||
has_many :material_releases, dependent: :restrict_with_error
|
||||
has_many :medical_releases, dependent: :restrict_with_error
|
||||
|
||||
monetize :fee_cents
|
||||
has_rich_text :body
|
||||
|
||||
@@ -5,7 +5,7 @@ class HeadshotCollection
|
||||
def self.for_project(project)
|
||||
appearance_releases_with_photo = project.appearance_releases.with_person_photo
|
||||
|
||||
new(project.headshot_collection_uid, appearance_releases_with_photo + project.talent_releases)
|
||||
new(project.id, appearance_releases_with_photo + project.talent_releases)
|
||||
end
|
||||
|
||||
def initialize(collection_uid, releasables)
|
||||
@@ -23,7 +23,7 @@ class HeadshotCollection
|
||||
collection_uid: collection_uid.to_s,
|
||||
bucket_name: aws_bucket_name,
|
||||
ids_to_images: map_ids_to_images,
|
||||
}.reject { |_, v| v.blank? }
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
class MedicalRelease < ApplicationRecord
|
||||
include Contractable
|
||||
include Notable
|
||||
include Photoable
|
||||
include Releasable
|
||||
include Searchable
|
||||
include Signable
|
||||
include Syncable
|
||||
include PersonName
|
||||
|
||||
composed_of :person_address,
|
||||
class_name: "Address",
|
||||
mapping: [
|
||||
%w(person_address_street1 street1),
|
||||
%w(person_address_street2 street2),
|
||||
%w(person_address_city city),
|
||||
%w(person_address_state state),
|
||||
%w(person_address_zip zip),
|
||||
%w(person_address_country country)
|
||||
]
|
||||
|
||||
def self.face_photo_acceptable_content_types
|
||||
["image/png", "image/jpeg"]
|
||||
end
|
||||
|
||||
# These validations apply to all releases
|
||||
validates :person_first_name, :person_last_name, presence: true
|
||||
validates :person_email, email: true, allow_blank: true
|
||||
|
||||
acts_as_taggable_on :internal_tags, :tags
|
||||
|
||||
# These validations apply to releases created natively by the system (i.e. not imported from elsewhere)
|
||||
with_options on: :native do
|
||||
validates :signature, attached: true
|
||||
end
|
||||
|
||||
# These validations apply to releases imported to the system from an outside source
|
||||
with_options on: :non_native do
|
||||
validates :contract, attached: true
|
||||
end
|
||||
|
||||
searchable_on %i[
|
||||
person_first_name person_last_name person_email person_phone
|
||||
person_address_street1 person_address_street2 person_address_city person_address_state person_address_zip person_address_country
|
||||
]
|
||||
|
||||
# All releases must respond to the following messages
|
||||
def name
|
||||
person_name
|
||||
end
|
||||
|
||||
def filename_suffix
|
||||
"#{person_last_name} #{person_first_name}"
|
||||
end
|
||||
|
||||
def contact_person
|
||||
@contact_person ||= Contact.new(person_name, person_address, person_email, person_phone)
|
||||
end
|
||||
|
||||
def uses_edl?
|
||||
false
|
||||
end
|
||||
|
||||
def minor?
|
||||
false
|
||||
end
|
||||
|
||||
def contract_file_name
|
||||
"#{project.name.parameterize}_#{contract_template.release_type}_#{(signed_at || created_at).strftime("%Y.%m.%d")}_#{release_number}_#{filename_suffix.parameterize}"
|
||||
end
|
||||
end
|
||||
@@ -4,4 +4,6 @@ class Note < ApplicationRecord
|
||||
belongs_to :notable, polymorphic: true
|
||||
|
||||
validates :content, presence: true
|
||||
|
||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||
end
|
||||
|
||||
@@ -3,8 +3,8 @@ class Project < ApplicationRecord
|
||||
include Filterable
|
||||
include Syncable
|
||||
|
||||
SIGNABLE_RELEASE_TYPES = %w(talent appearance acquired_media location material medical)
|
||||
AVAILABLE_RELEASE_TYPES = %w(appearance location material acquired_media talent music medical)
|
||||
SIGNABLE_RELEASE_TYPES = %w(talent appearance acquired_media location material)
|
||||
AVAILABLE_RELEASE_TYPES = %w(appearance location material acquired_media talent music)
|
||||
|
||||
belongs_to :account
|
||||
has_many :acquired_media_releases, dependent: :destroy
|
||||
@@ -13,7 +13,6 @@ class Project < ApplicationRecord
|
||||
has_many :material_releases, dependent: :destroy
|
||||
has_many :music_releases, dependent: :destroy
|
||||
has_many :talent_releases, dependent: :destroy
|
||||
has_many :medical_releases, dependent: :destroy
|
||||
has_many :videos, dependent: :destroy
|
||||
has_many :imports, dependent: :destroy
|
||||
has_many :contract_templates, dependent: :destroy
|
||||
@@ -23,6 +22,7 @@ class Project < ApplicationRecord
|
||||
has_many :downloads, dependent: :destroy
|
||||
has_many :broadcasts, dependent: :destroy
|
||||
has_many :zoom_meetings, dependent: :destroy
|
||||
has_many :task_requests, dependent: :destroy
|
||||
|
||||
accepts_nested_attributes_for :project_memberships
|
||||
|
||||
@@ -34,7 +34,6 @@ class Project < ApplicationRecord
|
||||
material_release: false,
|
||||
music_release: false,
|
||||
talent_release: false,
|
||||
medical_release: false,
|
||||
video_analysis: false,
|
||||
}
|
||||
end
|
||||
@@ -67,7 +66,6 @@ class Project < ApplicationRecord
|
||||
material_release: true,
|
||||
music_release: true,
|
||||
talent_release: true,
|
||||
medical_release: true,
|
||||
video_analysis: true,
|
||||
}
|
||||
when "nat_geo"
|
||||
@@ -79,7 +77,6 @@ class Project < ApplicationRecord
|
||||
material_release: true,
|
||||
music_release: true,
|
||||
talent_release: true,
|
||||
medical_release: true,
|
||||
video_analysis: true,
|
||||
}
|
||||
else
|
||||
@@ -121,7 +118,7 @@ class Project < ApplicationRecord
|
||||
current_zoom_meeting = zoom_meetings.active.first
|
||||
|
||||
unless current_zoom_meeting.present?
|
||||
zoom_user = ZoomUser.for_new_meeting
|
||||
zoom_user = ZoomUser.free.first || ZoomUser.create
|
||||
current_zoom_meeting = ZoomMeeting.create(zoom_user: zoom_user, project: self)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class ReleasableParam
|
||||
TYPES = %w(talent appearance location material acquired_media music medical)
|
||||
TYPES = %w(talent appearance location material acquired_media music)
|
||||
|
||||
def initialize(params)
|
||||
@params = params
|
||||
|
||||
8
app/models/task_request.rb
Normal file
8
app/models/task_request.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class TaskRequest < ApplicationRecord
|
||||
belongs_to :project
|
||||
has_many_attached :files
|
||||
|
||||
enum status: [:pending, :completed, :cancelled]
|
||||
|
||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||
end
|
||||
@@ -1,10 +1,9 @@
|
||||
require 'zoom_gateway'
|
||||
|
||||
class ZoomMeeting < ApplicationRecord
|
||||
belongs_to :project, optional: true
|
||||
belongs_to :zoom_user
|
||||
|
||||
has_one_attached :recording
|
||||
validates :recording, content_type: ['video/mp4']
|
||||
|
||||
enum status: [:created, :started, :ended]
|
||||
|
||||
after_create :create_api_meeting, if: -> { api_meeting_id.nil? }
|
||||
|
||||
@@ -1,27 +1,18 @@
|
||||
require 'securerandom'
|
||||
class ZoomUser < ApplicationRecord
|
||||
has_many :zoom_meetings, dependent: :nullify
|
||||
|
||||
enum tier: [:basic, :pro]
|
||||
|
||||
after_create :create_api_user, if: -> { api_id.nil? }
|
||||
before_destroy :abort_destroy
|
||||
|
||||
scope :current_account, -> { where(account_number: ZoomGateway.ACCOUNT_NUMBER) }
|
||||
scope :free, -> { where.not(id: ZoomMeeting.active.pluck(:zoom_user_id)) }
|
||||
|
||||
def api_email
|
||||
self.class.api_email(self.id)
|
||||
end
|
||||
|
||||
def create_api_user
|
||||
retries ||= 0
|
||||
self.api_id = gateway.create_host(self.class.generate_api_email)
|
||||
self.account_number = ZoomGateway.ACCOUNT_NUMBER
|
||||
self.api_id = gateway.create_host(api_email)
|
||||
save
|
||||
rescue ZoomGateway::UserAlreadyExists => e
|
||||
retries += 1
|
||||
if retries < 3
|
||||
retry # new api email will be generated automatically
|
||||
else
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
def delete_api_user
|
||||
@@ -30,22 +21,9 @@ class ZoomUser < ApplicationRecord
|
||||
save
|
||||
end
|
||||
|
||||
def current_account?
|
||||
account_number == ZoomGateway.ACCOUNT_NUMBER
|
||||
end
|
||||
|
||||
# Static methods
|
||||
class << self
|
||||
def generate_api_email
|
||||
"host#{SecureRandom.random_number(10000)}@directme"
|
||||
end
|
||||
|
||||
def for_new_meeting
|
||||
user = public_send(ZoomGateway.USER_TYPE_NAME).current_account.free.first
|
||||
if user.nil?
|
||||
user = public_send(ZoomGateway.USER_TYPE_NAME).current_account.create
|
||||
end
|
||||
user
|
||||
def api_email(id)
|
||||
"host#{id}@directme"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ class ContractTemplatePolicy < ApplicationPolicy
|
||||
def resolve
|
||||
if user.account_manager?
|
||||
scope.left_outer_joins(:project).where(projects: {account: user.account})
|
||||
else
|
||||
elsif user.manager?
|
||||
scope.left_outer_joins(project: :project_memberships).where(project_memberships: { user_id: user.id })
|
||||
else
|
||||
scope.none
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -12,9 +14,8 @@ class ContractTemplatePolicy < ApplicationPolicy
|
||||
def create?
|
||||
user.manager? || user.account_manager?
|
||||
end
|
||||
|
||||
def show?
|
||||
true
|
||||
create?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
class MedicalReleasePolicy < ReleasePolicy
|
||||
def create?
|
||||
true
|
||||
end
|
||||
|
||||
def show?
|
||||
true
|
||||
end
|
||||
|
||||
def update?
|
||||
!record.native?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
true
|
||||
end
|
||||
|
||||
def edit_photos?
|
||||
true
|
||||
end
|
||||
|
||||
def index?
|
||||
true
|
||||
end
|
||||
|
||||
def update_photos?
|
||||
edit_photos?
|
||||
end
|
||||
|
||||
def tag_multiple?
|
||||
true
|
||||
end
|
||||
|
||||
def download_multiple?
|
||||
true
|
||||
end
|
||||
end
|
||||
@@ -36,4 +36,8 @@ class ProjectPolicy < ApplicationPolicy
|
||||
def show_downloads?
|
||||
show?
|
||||
end
|
||||
|
||||
def show_task_results?
|
||||
show?
|
||||
end
|
||||
end
|
||||
|
||||
25
app/policies/task_request_policy.rb
Normal file
25
app/policies/task_request_policy.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class TaskRequestPolicy < ApplicationPolicy
|
||||
def index?
|
||||
true
|
||||
end
|
||||
|
||||
def show?
|
||||
true
|
||||
end
|
||||
|
||||
def create?
|
||||
true
|
||||
end
|
||||
|
||||
def destroy?
|
||||
true
|
||||
end
|
||||
|
||||
def update?
|
||||
true
|
||||
end
|
||||
|
||||
def cancel?
|
||||
true
|
||||
end
|
||||
end
|
||||
@@ -151,6 +151,24 @@ class Analytics
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def track_create_task_request(user_agent:, user_ip:)
|
||||
if analytics_enabled?
|
||||
identify
|
||||
track(
|
||||
{
|
||||
user_id: user.id,
|
||||
event: "Task request created",
|
||||
properties: {
|
||||
account: account.try(:name),
|
||||
account_id: account.try(:id),
|
||||
user_agent: user_agent,
|
||||
ip: user_ip,
|
||||
},
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="form-row">
|
||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||
</div>
|
||||
<%= form.form_group :categories, label: { text: "Licensed property type" } do %>
|
||||
<%= form.form_group :categories, label: { text: "Categories" } do %>
|
||||
<% AcquiredMediaRelease::CATEGORIES.each do |category| %>
|
||||
<%= form.check_box :categories, { multiple: true, label: category }, category, false %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("users fw", text: "Users"), [:admin, :users], class: class_string("nav-link", "active" => controller_name == "users") %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("tasks fw", text: "Task Requests"), [:admin, :task_requests], class: class_string("nav-link", "active" => controller_name == "task_requests") %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to fa_icon("bug fw", text: "Errors"), "https://sentry.io/bigmedia/", class: "nav-link", target: :_blank %>
|
||||
</li>
|
||||
|
||||
13
app/views/admin/task_requests/_form.html.erb
Normal file
13
app/views/admin/task_requests/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= errors_summary_for task_request %>
|
||||
|
||||
<%= bootstrap_form_with model: model, local: true do |form| %>
|
||||
<%= form.select :status, options_for_select(TaskRequest.statuses.except(:cancelled).keys, task_request.status), { class: "form-control" } %>
|
||||
<%= form.text_field :deliverable_url %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [:admin, :task_requests], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => task_request.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
26
app/views/admin/task_requests/_task_request.html.erb
Normal file
26
app/views/admin/task_requests/_task_request.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<tr id="<%= dom_id(task_request) %>">
|
||||
<td>
|
||||
<%= task_request.id %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.created_at.strftime("%D") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.deadline.try(:strftime, '%D') %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.time_allowed %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.status.titleize %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag "Manage", class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<%= link_to fa_icon("tasks", text: "View"), [:admin, task_request], class: "dropdown-item", target: '_blank' %>
|
||||
<%= link_to fa_icon("pencil", text: "Edit"), [:edit, :admin, task_request], class: "dropdown-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
6
app/views/admin/task_requests/edit.html.erb
Normal file
6
app/views/admin/task_requests/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: "Edit Task Request", close_action_path: [:admin, :task_requests] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [:admin, @task_request], task_request: @task_request %>
|
||||
</div>
|
||||
</div>
|
||||
23
app/views/admin/task_requests/index.html.erb
Normal file
23
app/views/admin/task_requests/index.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Task ID</th>
|
||||
<th>Created On</th>
|
||||
<th>Deadline</th>
|
||||
<th>Time Allowed</th>
|
||||
<th>Status</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="users">
|
||||
<% if @task_requests.any? %>
|
||||
<%= render @task_requests %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="6" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
18
app/views/admin/task_requests/show.html.erb
Normal file
18
app/views/admin/task_requests/show.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<dl>
|
||||
<%= description_list_pair_for @task_request, :description, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :created_at, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :deadline, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :time_allowed, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :additional_notes, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :status, append: ":" %>
|
||||
<dt>Files:</dt>
|
||||
<dd>
|
||||
<% if @task_request.files.present? %>
|
||||
<% @task_request.files.each do |file| %>
|
||||
<%= link_to file.filename, rails_blob_path(file, disposition: 'attachment'), class: "btn btn-link" %><br/>
|
||||
<% end %>
|
||||
<% else %>
|
||||
No files attached
|
||||
<% end %>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -2,7 +2,7 @@
|
||||
<td data-behavior="select"><%= check_box_tag "appearance_release_ids[]", appearance_release.id, false %></td>
|
||||
<td>
|
||||
<% if appearance_release.photo.attached? %>
|
||||
<%= image_tag medium_variant(appearance_release.photo) %>
|
||||
<%= image_tag medium_variant(appearance_release.photo), class: "img-fluid" %>
|
||||
<% else %>
|
||||
<%= fa_icon("warning", text: t(".no_photos"), class: "text-danger") %>
|
||||
<% end %>
|
||||
@@ -11,11 +11,10 @@
|
||||
<%= appearance_release.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contact_info(
|
||||
address: appearance_release.person_address,
|
||||
phone: appearance_release.person_phone,
|
||||
email: appearance_release.person_email
|
||||
) %>
|
||||
<%= number_to_phone appearance_release.person_phone %>
|
||||
</td>
|
||||
<td>
|
||||
<%= mail_to appearance_release.person_email %>
|
||||
</td>
|
||||
<td>
|
||||
<%= notes_preview appearance_release.notes.order_by_recent %>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<% end %>
|
||||
<div class="d-inline-block">
|
||||
<%= form.hidden_field :person_photo, value: form.object.person_photo.signed_id if appearance_release.person_photo.attached?%>
|
||||
<%= form.file_field :person_photo, hide_label: true, data: { ujs_target: "person-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
||||
<%= form.file_field :person_photo, wrapper_class: "required", hide_label: true, required: !appearance_release.person_photo.attached?, data: { ujs_target: "person-photo-input" }, help: "PNG or JPG only", accept: appearance_release.class.face_photo_acceptable_content_types.join(",") %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
<th data-behavior="all-selectable"><%= check_box_tag "appearance_release_ids[]", false, false %></th>
|
||||
<th></th>
|
||||
<th><%= AppearanceRelease.human_attribute_name(:person_name) %></th>
|
||||
<th><%= AppearanceRelease.human_attribute_name(:contact_info) %></th>
|
||||
<th><%= AppearanceRelease.human_attribute_name(:person_phone) %></th>
|
||||
<th><%= AppearanceRelease.human_attribute_name(:person_email) %></th>
|
||||
<th><%= t(".table_headers.notes") %></th>
|
||||
<th><%= t(".table_headers.tags") %></th>
|
||||
<th><%= t(".table_headers.signed_at") %></th>
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
<%= product_wordmark :deliver_me, class: class_string("d-inline-block", "disabled" => !Current.account.deliverme_enabled?) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to [project, :task_requests], class: class_string("nav-link", "active" => controller_name == "task_requests") do %>
|
||||
<%= lock_icon_for(Current.account, :assistme) %>
|
||||
<%= product_wordmark :assist_me, class: class_string("d-inline-block", "disabled" => !Current.account.assistme_enabled?) %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<hr class="divider-light mx-n4">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<li class="my-2" id="<%= dom_id(file) %>">
|
||||
<li class="my-2">
|
||||
<% if file.variable? %>
|
||||
<%= link_to image_tag(file.variant(resize_and_pad: [300, 300, background: "#F7F8F9"]), class: "bg-light img-thumbnail img-fluid"), file, target: "_blank" %>
|
||||
<% else %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= bootstrap_form_for model, layout: :inline, remote: true do |form| %>
|
||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2", id: "broadcast_files_#{token}" %>
|
||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2" %>
|
||||
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<div class="text-center pb-2" id="broadcast_file_form_<%= broadcast.token %>">
|
||||
<% if controller.class.module_parent.to_s == "Public" %>
|
||||
<%= render partial: "public/broadcasts/file_form", locals: { model: [broadcast], token: broadcast.token } %>
|
||||
<% else %>
|
||||
<%= render partial: "broadcasts/file_form", locals: { model: [broadcast.project, broadcast], token: broadcast.token } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="overflow-auto mh-30">
|
||||
<ul class="list-unstyled d-flex flex-column align-items-center text-center" id="broadcast_file_list_<%= broadcast.token %>">
|
||||
<% if files.present? %>
|
||||
<%= render partial: "broadcasts/file", collection: files %>
|
||||
<% else %>
|
||||
<li class="my-3">
|
||||
Files will appear here.
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="d-flex mt-2 justify-content-center" id="broadcast_files_pagination_<%= broadcast.token %>">
|
||||
<%= will_paginate(files, param_name: 'files_page', params: { active_files_tab: broadcast.token }) if files.present? %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5,12 +5,6 @@
|
||||
<% if @broadcast %>
|
||||
<meta name="broadcast-token" content="<%= @broadcast.token %>">
|
||||
<% end %>
|
||||
<% # Subscribe to Action Cable for every broadcast including those in multi-view %>
|
||||
<% @multi_view_broadcasts.each do |multi_view_broadcast| %>
|
||||
<% if multi_view_broadcast.token != @broadcast.token %>
|
||||
<meta name="broadcast-token" content="<%= multi_view_broadcast.token %>">
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header do %>
|
||||
@@ -30,7 +24,9 @@
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h1 class="h3 m-0"><%= @broadcast.name %></h1>
|
||||
<div class="dropdown">
|
||||
<%= link_to "Switch View", "#", class: "btn btn-light border dropdown-toggle", role: "button", id: "dropdownMenuLink", data: { toggle: "dropdown" }, aria: { haspopup: "true", expanded: "false" } %>
|
||||
<a class="btn btn-light border dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Switch View
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
<h5 class="dropdown-header">Live Streams</h5>
|
||||
<span class="dropdown-item active"><%= fa_icon("check", text: @broadcast.name.titleize) %></span>
|
||||
@@ -76,10 +72,13 @@
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<%= link_to "Home", "#home", class: class_string("nav-link", "active" => !params[:active_tab].present?), data: { toggle: "tab" } %>
|
||||
<a class="<%= class_string("nav-link", "active" => !params[:active_tab].present?) %>" href="#home" data-toggle="tab">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Previous Sessions", "#recordings", class: class_string("nav-link", "active" => params[:active_tab] == "recordings"), data: { toggle: "tab" } %>
|
||||
<a class="<%= class_string("nav-link", "active" => params[:active_tab] == "files") %>" href="#files" data-toggle="tab">Files</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="<%= class_string("nav-link", "active" => params[:active_tab] == "recordings") %>" href="#recordings" data-toggle="tab">Previous Sessions</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -119,6 +118,30 @@
|
||||
<p class="card-text">If you want to join the ZOOM meeting dedicated to this broadcast, follow the link below.</p>
|
||||
<%= link_to 'Video Conference', @conference_url, class: 'btn btn-primary btn-block', target: '_blank' %>
|
||||
</div>
|
||||
<div class="<%= class_string("tab-pane fade show", "active" => params[:active_tab] == 'files') %>" id="files">
|
||||
<div class="text-center pb-2" id="broadcast_file_form">
|
||||
<% if controller.class.module_parent.to_s == "Public" %>
|
||||
<%= render partial: "public/broadcasts/file_form", locals: { model: [@broadcast], token: @broadcast.token } %>
|
||||
<% else %>
|
||||
<%= render partial: "broadcasts/file_form", locals: { model: [@project, @broadcast] } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="alert alert-info mt-2"><%= fa_icon("warning", text: "You may need to refresh the page to see new files uploaded by other team members") %></p>
|
||||
<div class="overflow-auto mh-30">
|
||||
<ul class="list-unstyled d-flex flex-column align-items-center text-center" id="broadcast_file_list">
|
||||
<% if @files.present? %>
|
||||
<%= render partial: "broadcasts/file", collection: @files %>
|
||||
<% else %>
|
||||
<li class="my-3">
|
||||
Files will appear here.
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="d-flex mt-2 justify-content-center" id="broadcast_files_pagination">
|
||||
<%= will_paginate(@files, params: { active_tab: 'files' }) if @files.present? %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="<%= class_string("tab-pane fade show", "active" => params[:active_tab] == 'recordings') %>" id="recordings">
|
||||
<div id="broadcast_recordings">
|
||||
<%= render partial: 'broadcasts/broadcast_recordings', locals: { recordings: @recordings, broadcast: @broadcast } %>
|
||||
@@ -127,36 +150,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- files section -->
|
||||
<div id="files" class="card shadow-sm mb-3">
|
||||
<div class="card-header">
|
||||
<h2 class="h5">Files</h2>
|
||||
<% if @multi_view_broadcasts %>
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<% @multi_view_broadcasts.each_with_index do |mvb, index| %>
|
||||
<li class="nav-item">
|
||||
<%= link_to mvb.name, "#files_broadcast_#{mvb.token}", class: class_string("nav-link", "active" => (params[:active_files_tab] == mvb.token || (params[:active_files_tab].nil? && index == 0))), data: { toggle: "tab" } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-body p-3">
|
||||
<div class="tab-content">
|
||||
<% if @multi_view_broadcasts.present? %>
|
||||
<% @multi_view_broadcasts.each_with_index do |mvb, index| %>
|
||||
<div class="<%= class_string("tab-pane fade show", "active" => (params[:active_files_tab] == mvb.token || (params[:active_files_tab].nil? && index == 0))) %>" id="files_broadcast_<%= mvb.token %>">
|
||||
<%= render partial: 'broadcasts/files_section', locals: { broadcast: mvb, files: mvb.files } %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="tab-pane fade show active" id="files_broadcast_<%= @broadcast.id %>">
|
||||
<%= render partial: 'broadcasts/files_section', locals: { broadcast: @broadcast, files: @files } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
$("#broadcast_file_form_<%= @broadcast.token %>").html("<%= j render(partial: "broadcasts/file_form", locals: { model: [@project, @broadcast], token: @broadcast.token }) %>");
|
||||
$("#broadcast_file_form").html("<%= j render(partial: "broadcasts/file_form", locals: { model: [@project, @broadcast] }) %>");
|
||||
$("#broadcast_file_list").html("<%= j render(partial: "broadcasts/file", collection: @files) %>");
|
||||
$("#broadcast_files_pagination").html("<%= j will_paginate(@files) %>");
|
||||
|
||||
var file_id = "#<%= dom_id(@files.first) %>"
|
||||
if ($("#broadcast_file_list_<%= @broadcast.token %>").has(file_id).length == 0) {
|
||||
$("#broadcast_file_list_<%= @broadcast.token %>").html("<%= j render(partial: "broadcasts/file", collection: @files) %>");
|
||||
$("#broadcast_files_pagination_<%= @broadcast.token %>").html("<%= j will_paginate(@files, param_name: 'files_page', params: { active_files_tab: @broadcast.token }) %>");
|
||||
}
|
||||
|
||||
bsCustomFileInput.init();
|
||||
bsCustomFileInput.init();
|
||||
@@ -2,25 +2,21 @@
|
||||
<%= field_set_tag content_tag(:span, t(".release_info.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target_show_values_mapping: { "#guardian_clause": %w(appearance talent), "#fee_field": %w(appearance talent location material acquired_media), "#exploitable_rights_fields": %w(appearance talent location material acquired_media), "#custom_fields": %w(medical) } }, class: "form-control custom-select" %>
|
||||
<%= form.select :release_type, options_for_release_type_select(project, @release_type), { wrapper_class: "col-sm-6" }, data: { toggle: "collapse-select", target: "#guardian_clause", show_values: %w(appearance talent) }, class: "form-control custom-select" %>
|
||||
</div>
|
||||
<div class="form-row" id="fee_field">
|
||||
<div class="form-row">
|
||||
<%= form.number_field :fee, min:"0", max:"99999999", step: "0.01", prepend: "$", help: "Leave at $0.00 for no-fee", wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".exploitable_rights.heading"), class: "h6 text-muted text-uppercase"), id: "exploitable_rights_fields" do %>
|
||||
<%= field_set_tag content_tag(:span, t(".exploitable_rights.heading"), class: "h6 text-muted text-uppercase")do %>
|
||||
<%= render "shared/exploitable_rights_fields", form: form %>
|
||||
<hr>
|
||||
<% end %>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".custom_fields.heading"), class: "h6 text-muted text-uppercase"), id: "custom_fields", style: "display: none;" do %>
|
||||
<%= render "shared/custom_fields", form: form %>
|
||||
<hr>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".legal.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<%= form.form_group do %>
|
||||
<%= form.rich_text_area :body %>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
<% if releasable.model_name == "LocationRelease" %>
|
||||
<%= description_list_pair "Filming Started On:", releasable&.filming_started_on&.strftime("%D") %>
|
||||
<%= description_list_pair "Filming Ended On:", releasable&.filming_ended_on&.strftime("%D") %>
|
||||
<%= description_list_pair "Filming Hours:", releasable&.filming_hours %>
|
||||
<% end %>
|
||||
<% if contract_template.fee? %>
|
||||
<%= description_list_pair "Fee:", number_to_currency(contract_template.fee) %>
|
||||
@@ -39,15 +38,6 @@
|
||||
<% end %>
|
||||
</dl>
|
||||
|
||||
<% if releasable.model_name == "MedicalRelease" %>
|
||||
<% (1..10).each do |n| %>
|
||||
<% if contract_template.public_send("question_#{n}_text").present? %>
|
||||
<p><strong><%= contract_template.public_send("question_#{n}_text") %></strong></p>
|
||||
<p><%= releasable.public_send("question_#{n}_answer") %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if releasable.minor? %>
|
||||
<br/>
|
||||
<p class="text-left"><strong>Guardian Information</strong></p>
|
||||
|
||||
@@ -11,10 +11,14 @@
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".signer_details.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-3" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-3" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
@@ -34,7 +38,6 @@
|
||||
<div class="form-row">
|
||||
<%= form.text_field :filming_started_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||
<%= form.text_field :filming_ended_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||
<%= form.text_field :filming_hours, wrapper_class: "col-sm-12" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -13,10 +13,14 @@
|
||||
|
||||
<%= field_set_tag content_tag(:span, t(".signer_details.heading"), class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-3" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-3" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<tr id="<%= dom_id(medical_release) %>">
|
||||
<td data-behavior="select"><%= check_box_tag "medical_release_ids[]", medical_release.id, false %></td>
|
||||
<td>
|
||||
<% if medical_release.photo.attached? %>
|
||||
<%= image_tag medium_variant(medical_release.photo), class: "img-fluid" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= medical_release.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= contact_info(
|
||||
address: medical_release.person_address,
|
||||
phone: medical_release.person_phone,
|
||||
email: medical_release.person_email
|
||||
) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= notes_preview medical_release.notes.order_by_recent %>
|
||||
</td>
|
||||
<td id="<%= dom_id medical_release, "tags_preview" %>">
|
||||
<%= tags_preview medical_release, medical_release.tags %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<%= medical_release.signed_on %>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<% if policy(Note).new? %>
|
||||
<%= link_to fa_icon("sticky-note fw", text: "Notes"), [:new, medical_release, :note], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(medical_release.tags).new? %>
|
||||
<%= link_to fa_icon("tags fw", text: "Tags"), [:new, medical_release, :acts_as_taggable_on_tag], class: "dropdown-item", remote: true %>
|
||||
<% end %>
|
||||
<% if policy(Contract).show? && (medical_release.contract.attached? || medical_release.contract_template.present?) %>
|
||||
<%= link_to fa_icon("download fw", text: "Download"), [medical_release, :contracts, format: "pdf"], class: "dropdown-item", target: "_blank" %>
|
||||
<% end %>
|
||||
<% if policy(medical_release).destroy? %>
|
||||
<%= link_to fa_icon("trash fw", text: "Delete"), medical_release, class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1,48 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if @medical_releases.any? && policy(MedicalRelease).tag_multiple? %>
|
||||
<%= button_to_bulk_tagging(@project) %>
|
||||
<% end %>
|
||||
|
||||
<% if @medical_releases.any? && policy(MedicalRelease).download_multiple? %>
|
||||
<%= link_to "Download All", [@project, :contract_downloads, release_type: @medical_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: {
|
||||
disable_with: "Please wait..." } %>
|
||||
<% end %>
|
||||
|
||||
<%= bootstrap_form_with url: [@project, :medical_releases], method: :get, remote: true, layout: :inline, id: "search" do |form| %>
|
||||
<%= form.search_field :query, hide_label: true, placeholder: t(".actions.search"), class: "rounded-pill-right", value: params[:query], prepend: form.button(fa_icon("search"), class: "btn btn-light border mb-2 rounded-pill-left") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th data-behavior="all-selectable"><%= check_box_tag "medical_release_ids[]", false, false %></th>
|
||||
<th></th>
|
||||
<th><%= MedicalRelease.human_attribute_name(:person_name) %></th>
|
||||
<th><%= MedicalRelease.human_attribute_name(:contact_info) %></th>
|
||||
<th><%= t(".table_headers.notes") %></th>
|
||||
<th><%= t(".table_headers.tags") %></th>
|
||||
<th><%= t(".table_headers.signed_at") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="medical_releases">
|
||||
<% if @medical_releases.any? %>
|
||||
<%= render @medical_releases %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="12" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="medical_releases_pagination" class="mt-3">
|
||||
<%= will_paginate @medical_releases %>
|
||||
</div>
|
||||
@@ -1,3 +0,0 @@
|
||||
$("#medical_releases").html("<%= j render(@medical_releases) %>");
|
||||
$("form input[type='search']").val("<%= params[:query] %>");
|
||||
$("#medical_releases_pagination").html("<%= j will_paginate(@medical_releases) %>");
|
||||
@@ -1,6 +1,6 @@
|
||||
<%= bootstrap_form_with model: project, local: true do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.select :predefined_client_name, options_for_select(options_for_predefined_client_name_select, selected_project_client_value(project)), {}, data: { toggle: "collapse-select", target_show_values_mapping: { "#other_client": [:other] } }, class: "form-control custom-select" %>
|
||||
<%= form.select :predefined_client_name, options_for_select(options_for_predefined_client_name_select, selected_project_client_value(project)), {}, data: { toggle: "collapse-select", target: "#other_client", show_values: [:other] }, class: "form-control custom-select" %>
|
||||
<div id="other_client" style="<%='display: none' if selected_project_client_value(project) != 'other'%>">
|
||||
<%= form.text_field :client_name, placeholder: true %>
|
||||
<%= form.form_group do %>
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
<%= link_to t("projects.show.downloads"), [@project, :downloads], class: "text-decoration-none text-reset stretched-link" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if policy(Project).show_task_results? %>
|
||||
<%= render "folder_card" do %>
|
||||
<%= link_to t("projects.show.task_requests"), [@project, :task_requests, completed_only: true], class: "text-decoration-none text-reset stretched-link" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
<%= card_field_set_tag t(".acquired_media_info.heading") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :name, required: true, wrapper_class: "col-12" %>
|
||||
<%= form.text_field :name, required: true, wrapper_class: "col-12", label: 'Licensor ("Owner")' %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_area :description, wrapper_class: "col-12" %>
|
||||
</div>
|
||||
<%= form.form_group :categories, label: { text: "Licensed property type" } do %>
|
||||
<%= form.form_group :categories, label: { text: "Categories" } do %>
|
||||
<% AcquiredMediaRelease::CATEGORIES.each do |category| %>
|
||||
<%= form.check_box :categories, { multiple: true, label: category }, category, false %>
|
||||
<% end %>
|
||||
@@ -31,11 +31,8 @@
|
||||
|
||||
<%= card_field_set_tag t(".personal_info.heading") do %>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6", label: 'Phone' %>
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6", label: 'Email' %>
|
||||
<%= form.text_field :person_phone, wrapper_class: "col-sm-6", label: 'Phone' %>
|
||||
<%= form.text_field :person_fax, wrapper_class: "col-sm-6", label: 'Fax' %>
|
||||
</div>
|
||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= bootstrap_form_for model, url: broadcast_url(token: token), layout: :inline, remote: true do |form| %>
|
||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2", id: "broadcast_files_#{token}" %>
|
||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2" %>
|
||||
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
||||
<% end %>
|
||||
@@ -1,9 +1,5 @@
|
||||
$("#broadcast_file_form_<%= @broadcast.token %>").html("<%= j render(partial: "public/broadcasts/file_form", locals: { model: [@project, @broadcast], token: @broadcast.token }) %>");
|
||||
|
||||
var file_id = "#<%= dom_id(@files.first) %>"
|
||||
if ($("#broadcast_file_list_<%= @broadcast.token %>").has(file_id).length == 0) {
|
||||
$("#broadcast_file_list_<%= @broadcast.token %>").html("<%= j render(partial: "broadcasts/file", collection: @files) %>");
|
||||
$("#broadcast_files_pagination_<%= @broadcast.token %>").html("<%= j will_paginate(@files) %>");
|
||||
}
|
||||
$("#broadcast_file_form").html("<%= j render(partial: "public/broadcasts/file_form", locals: { model: [@project, @broadcast], token: @broadcast.token }) %>");
|
||||
$("#broadcast_file_list").html("<%= j render(partial: "broadcasts/file", collection: @files) %>");
|
||||
$("#broadcast_files_pagination").html("<%= j will_paginate(@files) %>");
|
||||
|
||||
bsCustomFileInput.init();
|
||||
@@ -27,7 +27,11 @@
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
@@ -41,14 +45,9 @@
|
||||
<div class="form-row">
|
||||
<%= form.text_field :filming_started_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||
<%= form.text_field :filming_ended_on, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
|
||||
<%= form.text_field :filming_hours, wrapper_class: "col-sm-12" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag t(".photos.heading") do %>
|
||||
<%= render "shared/photos_dropzone_fields", form: form, release: @location_release %>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag t(".signature.heading") do %>
|
||||
<%= render "shared/signature_fields", form: form, instruction: 'An Authorized Signatory' %>
|
||||
<% end %>
|
||||
|
||||
@@ -27,17 +27,17 @@
|
||||
<%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag t(".photo.heading") do %>
|
||||
<%= render "shared/photos_dropzone_fields", form: form, release: @material_release %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= card_field_set_tag t(".signature.heading") do %>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<p class="alert alert-success p-3 lead text-center">Your release was successfully submitted. Thank you.</p>
|
||||
@@ -1,56 +0,0 @@
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<%= errors_summary_for @medical_release %>
|
||||
<%= bootstrap_form_with model: [@account, @project, @contract_template, @medical_release], local: true, validation_context: :native do |form| %>
|
||||
<div class="alert alert-warning font-weight-bold"><%= t ".instructions_html", name: @project.name %></div>
|
||||
<%= card_field_set_tag t(".legal.heading") do %>
|
||||
<p><%= @contract_template.body %></p>
|
||||
<% if @contract_template.fee? %>
|
||||
<p>
|
||||
Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<% if (1..10).map {|n| @contract_template.public_send("question_#{n}_text").presence }.compact.any? %>
|
||||
<%= card_field_set_tag t(".questionnaire.heading") do %>
|
||||
<% (1..10).each do |n| %>
|
||||
<% if @contract_template.public_send("question_#{n}_text").present? %>
|
||||
<div class="form-row">
|
||||
<%= form.text_area "question_#{n}_answer", wrapper_class: "col-sm-12", label: @contract_template.public_send("question_#{n}_text") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<hr>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag t(".personal_info.heading") do %>
|
||||
<div class="alert alert-warning font-weight-bold"><%= t ".personal_info.instructions" %></div>
|
||||
<div class="form-row">
|
||||
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
|
||||
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
|
||||
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
|
||||
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
|
||||
</div>
|
||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= card_field_set_tag t(".photo.heading") do %>
|
||||
<%= render "shared/photos_dropzone_fields", form: form, release: @medical_release %>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag t(".signature.heading") do %>
|
||||
<%= render "shared/signature_fields", form: form %>
|
||||
<% end %>
|
||||
|
||||
<div class="mt-5">
|
||||
<%= form.button t("shared.submit_release_short"), class: "btn btn-block btn-lg btn-success", data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,6 +11,6 @@
|
||||
</div>
|
||||
<%= form.form_group "#{field_name_prefix}address_country" do %>
|
||||
<%= form.label "#{field_name_prefix}address_country" %>
|
||||
<%= form.country_select "#{field_name_prefix}address_country", { selected: 'US', priority: %w(US CA), prompt: true }, class: "form-control custom-select" %>
|
||||
<%= form.country_select "#{field_name_prefix}address_country", { priority: %w(US CA), prompt: true }, class: "form-control custom-select" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<% (1..10).each do |n| %>
|
||||
<div class="form-row">
|
||||
<%= form.text_area "question_#{n}_text", wrapper_class: "col-sm-12" %>
|
||||
</div>
|
||||
<% end%>
|
||||
34
app/views/task_requests/_form.html.erb
Normal file
34
app/views/task_requests/_form.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<%= errors_summary_for task_request %>
|
||||
|
||||
<%= bootstrap_form_with model: model, local: true do |form| %>
|
||||
<%= form.text_area :description %>
|
||||
<%= form.text_field :deadline, class: "datepicker-control" %>
|
||||
<%= form.text_field :time_allowed %>
|
||||
<%= form.text_area :additional_notes %>
|
||||
<%= field_set_tag content_tag(:span, "Files", class: "h6 text-muted text-uppercase") do %>
|
||||
<div class="field d-none">
|
||||
<%= form.label :files %>
|
||||
<%= form.file_field :files, disable: true, direct_upload: true, multiple: true, id: "task_request_files", hide_label: true %>
|
||||
<% task_request.files.each do |file| %>
|
||||
<% unless file.persisted? %>
|
||||
<%= hidden_field_tag "#{task_request.model_name.param_key}[files][]", file.signed_id %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="dropzone field border-dashed"
|
||||
data-accepted-files="audio/*,image/*,video/*,application/*"
|
||||
data-behavior="dropzone"
|
||||
data-file-input-id="task_request_files"
|
||||
data-existing-files="<%= mock_photos_json(task_request.files) %>"
|
||||
data-placeholder="<%= dropzone_placeholder_message_for(task_request) %>"
|
||||
data-submit-button="#submit_folder"></div>
|
||||
<% end %>
|
||||
|
||||
<div class="row align-items-center text-center mt-4">
|
||||
<%= link_to t("shared.cancel"), [project, :task_requests], class: "col-3 text-reset" %>
|
||||
<div class="col-9">
|
||||
<%= form.submit class: class_string("btn btn-block", ["btn-success", "btn-primary"] => task_request.new_record?), data: { disable_with: t("shared.disable_with") } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
35
app/views/task_requests/_task_request.html.erb
Normal file
35
app/views/task_requests/_task_request.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<tr>
|
||||
<td>
|
||||
<%= task_request.created_at.strftime('%D') %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.deadline.try(:strftime, '%D') %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.time_allowed %>
|
||||
</td>
|
||||
<td>
|
||||
<%= task_request.status.titleize %>
|
||||
</td>
|
||||
<% if params[:completed_only] %>
|
||||
<td>
|
||||
<%= task_request.deliverable_url %>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<% if policy(task_request).show? %>
|
||||
<%= link_to fa_icon("tasks fw", text: "View"), [task_request.project, task_request], class: "dropdown-item", target: '_blank' %>
|
||||
<% end %>
|
||||
<% if policy(task_request).edit? %>
|
||||
<%= link_to fa_icon("pencil fw", text: "Edit"), [:edit, task_request.project, task_request], class: "dropdown-item" %>
|
||||
<% end %>
|
||||
<% if policy(task_request).cancel? && !task_request.cancelled? %>
|
||||
<%= link_to fa_icon("ban fw", text: "Cancel"), [:cancel, task_request.project, task_request], class: "dropdown-item", method: :post %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
6
app/views/task_requests/edit.html.erb
Normal file
6
app/views/task_requests/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :task_requests] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @task_request], task_request: @task_request, project: @project %>
|
||||
</div>
|
||||
</div>
|
||||
41
app/views/task_requests/index.html.erb
Normal file
41
app/views/task_requests/index.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<%= product_wordmark :assist_me, class: "small mb-3" %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-md-flex d-sm-flex flex-sm-column flex-md-row flex-md-wrap mb-3">
|
||||
<% if policy(TaskRequest).new? %>
|
||||
<%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :task_request], class: "btn btn-primary mb-2" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border bg-white rounded shadow-sm pb-3 table-responsive">
|
||||
<table class="table table-striped tr-px-4 align-all-middle">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th><%= t(".table_headers.task_request_created_on") %></th>
|
||||
<th><%= t(".table_headers.task_request_deadline") %></th>
|
||||
<th><%= t(".table_headers.task_request_time_allowed") %></th>
|
||||
<th><%= t(".table_headers.task_request_status") %></th>
|
||||
<% if params[:completed_only] %>
|
||||
<th><%= t(".table_headers.task_request_results") %></th>
|
||||
<% end %>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="task_requests">
|
||||
<% if @task_requests.any? %>
|
||||
<%= render @task_requests %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="task_requests_pagination" class="mt-3">
|
||||
<%= will_paginate @task_requests %>
|
||||
</div>
|
||||
6
app/views/task_requests/new.html.erb
Normal file
6
app/views/task_requests/new.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :task_requests] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", model: [@project, @task_request], task_request: @task_request, project: @project %>
|
||||
</div>
|
||||
</div>
|
||||
18
app/views/task_requests/show.html.erb
Normal file
18
app/views/task_requests/show.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<dl>
|
||||
<%= description_list_pair_for @task_request, :description, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :created_at, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :deadline, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :time_allowed, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :additional_notes, append: ":" %>
|
||||
<%= description_list_pair_for @task_request, :status, append: ":" %>
|
||||
<dt>Files:</dt>
|
||||
<dd>
|
||||
<% if @task_request.files.present? %>
|
||||
<% @task_request.files.each do |file| %>
|
||||
<%= file.filename %><br>
|
||||
<% end %>
|
||||
<% else %>
|
||||
"No files attached."
|
||||
<% end %>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1,6 +1,4 @@
|
||||
require 'zoom'
|
||||
require 'zoom_gateway'
|
||||
|
||||
unless Rails.env.test?
|
||||
Zoom.configure do |c|
|
||||
c.api_key = ENV['ZOOM_API_KEY']
|
||||
|
||||
@@ -93,6 +93,11 @@ en:
|
||||
application:
|
||||
header:
|
||||
sign_out: Sign Out
|
||||
task_requests:
|
||||
index:
|
||||
empty: Task requests will appear here
|
||||
update:
|
||||
notice: The task request has been updated successfully
|
||||
users:
|
||||
create:
|
||||
notice: The user was created
|
||||
@@ -212,14 +217,12 @@ en:
|
||||
archived_failure: Failed to archive the release template
|
||||
archived_notice: The release template has been archived
|
||||
form:
|
||||
custom_fields:
|
||||
heading: Custom Fields
|
||||
exploitable_rights:
|
||||
heading: Exploitable Rights
|
||||
heading: 2 of 3 Exploitable Rights
|
||||
legal:
|
||||
heading: Legal
|
||||
heading: 3 of 3 Legal
|
||||
release_info:
|
||||
heading: Release Info
|
||||
heading: 1 of 3 Release Info
|
||||
index:
|
||||
actions:
|
||||
import: Import Release Template
|
||||
@@ -307,8 +310,6 @@ en:
|
||||
graphics_only_edl_file: If you do not upload a Graphics Only EDL, the software will not generate a Graphics Cue List.
|
||||
label:
|
||||
acquired_media_release:
|
||||
description: Description of licensed property
|
||||
name: Name of licensed property
|
||||
person_address: Address
|
||||
person_address_city: City
|
||||
person_address_country: Country
|
||||
@@ -318,8 +319,6 @@ en:
|
||||
person_address_zip: Zip code
|
||||
person_company: Company
|
||||
person_email: Email address
|
||||
person_first_name: Licensor/Owner first name
|
||||
person_last_name: Licensor/Owner last name
|
||||
person_name: Name
|
||||
person_phone: Phone number
|
||||
person_title: Title
|
||||
@@ -333,23 +332,16 @@ en:
|
||||
address_city: City
|
||||
address_country: Country
|
||||
address_state: State
|
||||
address_street1: Address of Property
|
||||
address_street1: Address
|
||||
address_street2: Address (Line 2)
|
||||
address_zip: Zip code
|
||||
filming_ended_on: Filming end date
|
||||
filming_started_on: Filming start date
|
||||
name: Name of property
|
||||
person_address_city: City
|
||||
person_address_country: Country
|
||||
person_address_state: State
|
||||
person_address_street1: Address
|
||||
person_address_street2: Address (Line 2)
|
||||
person_address_zip: Zip code
|
||||
person_first_name: Owner first name
|
||||
person_last_name: Owner last name
|
||||
material_release:
|
||||
description: Description of licensed material
|
||||
name: Name of licensed material
|
||||
person_address: Address
|
||||
person_address_city: City
|
||||
person_address_country: Country
|
||||
@@ -359,8 +351,6 @@ en:
|
||||
person_address_zip: Zip code
|
||||
person_company: Company
|
||||
person_email: Email address
|
||||
person_first_name: Licensor/Owner first name
|
||||
person_last_name: Licensor/Owner last name
|
||||
person_name: Name
|
||||
person_phone: Phone number
|
||||
person_title: Title
|
||||
@@ -557,10 +547,9 @@ en:
|
||||
location_details:
|
||||
heading: 1 of 4 Location Details
|
||||
photos:
|
||||
dropzone_label: Tap to take a photo of the Property (optional)
|
||||
heading: 4 of 4 Photos
|
||||
signer_details:
|
||||
heading: 2 of 4 Owner Details
|
||||
heading: 2 of 4 Signer Details
|
||||
index:
|
||||
actions:
|
||||
new: Import Release
|
||||
@@ -592,10 +581,9 @@ en:
|
||||
material_details:
|
||||
heading: 1 of 3 Material Details
|
||||
photos:
|
||||
dropzone_label: Tap to take a photo of Licensed Material (optional)
|
||||
heading: 4 of 4 Photos
|
||||
signer_details:
|
||||
heading: 2 of 4 Licensor/Owner Details
|
||||
heading: 2 of 4 Signer Details
|
||||
index:
|
||||
actions:
|
||||
new: Import Release
|
||||
@@ -613,20 +601,6 @@ en:
|
||||
heading: Import Material Release (Products / Logos)
|
||||
update:
|
||||
notice: The material release has been updated
|
||||
medical_releases:
|
||||
destroy:
|
||||
alert: The medical release has been deleted
|
||||
index:
|
||||
actions:
|
||||
search: Search
|
||||
empty: Medical releases will appear here
|
||||
table_headers:
|
||||
notes: Notes
|
||||
signed_at: Date Signed
|
||||
tags: Tags
|
||||
medical_release:
|
||||
actions:
|
||||
manage: Manage
|
||||
music_releases:
|
||||
create:
|
||||
notice: The music release has been created
|
||||
@@ -670,7 +644,6 @@ en:
|
||||
create:
|
||||
notice: Check your email for password reset instructions
|
||||
edit:
|
||||
notice: This password reset URL has expired or is invalid. Try again by clicking "Forgot your password?" below
|
||||
submit: Save New Password
|
||||
title: Password Reset
|
||||
new:
|
||||
@@ -732,7 +705,6 @@ en:
|
||||
label: Which release categories do you require for this project?
|
||||
location_release: Location Releases
|
||||
material_release: Material Releases (Products / Logos)
|
||||
medical_release: Medical Releases
|
||||
music_release: Music Releases (Original Music)
|
||||
talent_release: Talent Releases
|
||||
index:
|
||||
@@ -759,10 +731,10 @@ en:
|
||||
downloads: Downloads
|
||||
location_release: Location Releases (%{count})
|
||||
material_release: Material Releases (%{count})
|
||||
medical_release: Medical Releases (%{count})
|
||||
music_release: Music Releases (%{count})
|
||||
report: Reports
|
||||
talent_release: Talent Releases (%{count})
|
||||
task_requests: Tasks
|
||||
public:
|
||||
acquired_media_releases:
|
||||
new:
|
||||
@@ -774,7 +746,9 @@ en:
|
||||
legal:
|
||||
heading: Legal
|
||||
personal_info:
|
||||
heading: Licensor/Owner Contact Information
|
||||
heading: Person Details
|
||||
personal_info:
|
||||
heading: Signer's Contact Information
|
||||
signature:
|
||||
heading: Signature
|
||||
appearance_releases:
|
||||
@@ -813,15 +787,13 @@ en:
|
||||
new:
|
||||
cancel: Cancel
|
||||
contact_info:
|
||||
heading: Owner Contact Information
|
||||
heading: Signer Information
|
||||
filming_info:
|
||||
heading: Filming Information
|
||||
legal:
|
||||
heading: Legal
|
||||
location_info:
|
||||
heading: Location Information
|
||||
photos:
|
||||
heading: Photos
|
||||
signature:
|
||||
heading: Sign Below
|
||||
material_releases:
|
||||
@@ -830,33 +802,13 @@ en:
|
||||
new:
|
||||
cancel: Cancel
|
||||
contact_info:
|
||||
heading: Licensor/Owner Contact Information
|
||||
heading: Signer's Contact Information
|
||||
legal:
|
||||
heading: Legal
|
||||
photo:
|
||||
heading: Photos
|
||||
release_info:
|
||||
heading: Release Information
|
||||
signature:
|
||||
heading: Sign Below
|
||||
medical_releases:
|
||||
create:
|
||||
notice: Your release has been signed. Thank you!
|
||||
new:
|
||||
cancel: Cancel
|
||||
instructions_html: >
|
||||
Below is the medical release form. After scrolling down and reading the medical release form, please enter your personal information, take a photo, and press the "Submit Release" button.
|
||||
legal:
|
||||
heading: Legal
|
||||
personal_info:
|
||||
heading: Personal Information
|
||||
instructions: Now, enter your personal information.
|
||||
photo:
|
||||
heading: Photos
|
||||
questionnaire:
|
||||
heading: Questionnaire
|
||||
signature:
|
||||
heading: Signature
|
||||
talent_releases:
|
||||
create:
|
||||
notice: Your release has been signed. Thank you!
|
||||
@@ -923,6 +875,7 @@ en:
|
||||
title: Sign In
|
||||
shared:
|
||||
ago: ago
|
||||
assist_me: Assist
|
||||
back: Back
|
||||
cancel: Cancel
|
||||
clear: Clear
|
||||
@@ -944,7 +897,6 @@ en:
|
||||
search: Search
|
||||
submit_release: Submit Release
|
||||
submit_release_long: I have read and agree to the above
|
||||
submit_release_short: Submit
|
||||
suite: Suite
|
||||
tag_multiple_releases: Add Tag
|
||||
tag_multiple_releases_form:
|
||||
@@ -984,6 +936,31 @@ en:
|
||||
manage: Manage
|
||||
update:
|
||||
notice: The talent release has been updated
|
||||
task_requests:
|
||||
cancel:
|
||||
notice: Task has been cancelled successfully.
|
||||
create:
|
||||
notice: Task request created succussfully.
|
||||
edit:
|
||||
heading:
|
||||
Edit Task Request
|
||||
index:
|
||||
actions:
|
||||
new: Create Task Request
|
||||
empty: Task requests will appear here.
|
||||
table_headers:
|
||||
task_request_created_on: Created On
|
||||
task_request_deadline: Deadline
|
||||
task_request_results: Task Results
|
||||
task_request_status: Status
|
||||
task_request_time_allowed: Time Allowed
|
||||
new:
|
||||
heading: New Task Request
|
||||
task_request:
|
||||
actions:
|
||||
manage: Manage
|
||||
update:
|
||||
notice: Task request updated successfully.
|
||||
user_mailer:
|
||||
existing_account:
|
||||
subject: You've been added as a ME Suite Account Manager
|
||||
|
||||
@@ -132,14 +132,6 @@ es:
|
||||
update: Save Changes (ES)
|
||||
create: 'Crear %{model}'
|
||||
update: 'Actualizar %{model}'
|
||||
location_releases:
|
||||
form:
|
||||
photos:
|
||||
dropzone_label: Tap to take a photo of the Property (optional) (ES)
|
||||
material_releases:
|
||||
form:
|
||||
photos:
|
||||
dropzone_label: Tap to take a photo of Licensed Material (optional) (ES)
|
||||
public:
|
||||
appearance_releases:
|
||||
create:
|
||||
@@ -168,14 +160,6 @@ es:
|
||||
clear: Despejar
|
||||
heading: Firma
|
||||
instructions: 'Firma Abajo:'
|
||||
location_releases:
|
||||
new:
|
||||
photos:
|
||||
heading: Photos (ES)
|
||||
material_releases:
|
||||
new:
|
||||
photo:
|
||||
heading: Photos (ES)
|
||||
talent_releases:
|
||||
new:
|
||||
guardian_clause:
|
||||
|
||||
@@ -31,6 +31,7 @@ Rails.application.routes.draw do
|
||||
resources :users, only: [:index, :new, :create, :edit, :update, :destroy] do
|
||||
resource :masquerade, only: :create
|
||||
end
|
||||
resources :task_requests, only: [:index, :edit, :update, :show]
|
||||
|
||||
root to: "accounts#index", as: :signed_in_root
|
||||
end
|
||||
@@ -53,7 +54,6 @@ Rails.application.routes.draw do
|
||||
resources :material_releases, except: [:show], concerns: [:contractable, :notable, :photoable]
|
||||
resources :music_releases, except: [:show], concerns: [:contractable, :notable]
|
||||
resources :talent_releases, except: [:show], concerns: [:contractable, :notable, :photoable]
|
||||
resources :medical_releases, except: [:show], concerns: [:contractable, :notable, :photoable]
|
||||
resources :contract_templates, only: [:index, :new, :create, :destroy] do
|
||||
resource :qr_codes, only: [:show], controller: "contract_templates/qr_codes"
|
||||
resource :blank_contracts, only: [:show, :new, :create], controller: "contract_templates/blank_contracts"
|
||||
@@ -98,6 +98,11 @@ Rails.application.routes.draw do
|
||||
delete :destroy_file
|
||||
end
|
||||
end
|
||||
resources :task_requests, except: :destroy do
|
||||
member do
|
||||
post :cancel
|
||||
end
|
||||
end
|
||||
end
|
||||
resource :profile, only: [:show, :update]
|
||||
resources :videos, only: [] do
|
||||
@@ -118,7 +123,6 @@ Rails.application.routes.draw do
|
||||
resources :acquired_media_releases, only: [:new, :create]
|
||||
resources :location_releases, only: [:new, :create]
|
||||
resources :material_releases, only: [:new, :create]
|
||||
resources :medical_releases, only: [:new, :create]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -128,7 +132,7 @@ Rails.application.routes.draw do
|
||||
end
|
||||
|
||||
RELEASES = [:acquired_media_releases, :appearance_releases, :talent_releases, :material_releases, :location_releases]
|
||||
ALL_RELEASES = RELEASES + [:music_releases, :medical_releases]
|
||||
ALL_RELEASES = RELEASES + [:music_releases]
|
||||
|
||||
ALL_RELEASES.each do |release|
|
||||
resources release, only: [], concerns: :taggable
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
class AssignAccountNumberAndTypeToZoomUsers < ActiveRecord::DataMigration
|
||||
def up
|
||||
ZoomUser.find_each do |zu|
|
||||
zu.update account_number: ENV.fetch('ZOOM_ACCOUNT_NUMBER'), tier: (ENV['ZOOM_USER_TYPE'] == 'pro' ? 1 : 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20200518200245_create_task_requests.rb
Normal file
14
db/migrate/20200518200245_create_task_requests.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateTaskRequests < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :task_requests do |t|
|
||||
t.references :project
|
||||
t.text :description
|
||||
t.datetime :deadline
|
||||
t.string :time_allowed
|
||||
t.text :additional_notes
|
||||
t.integer :status, default: 0
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddDeliverableUrlToTaskRequests < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :task_requests, :deliverable_url, :string
|
||||
end
|
||||
end
|
||||
@@ -1,6 +0,0 @@
|
||||
class AddAccountNumberAndTypeToZoomUsers < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :zoom_users, :account_number, :string
|
||||
add_column :zoom_users, :tier, :integer, default: 0
|
||||
end
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
class AddFilmingHoursToLocationReleases < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :location_releases, :filming_hours, :text
|
||||
end
|
||||
end
|
||||
@@ -1,23 +0,0 @@
|
||||
class CreateMedicalReleases < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :medical_releases do |t|
|
||||
t.belongs_to :project, foreign_key: true
|
||||
t.belongs_to :contract_template, foreign_key: true
|
||||
t.string :person_first_name
|
||||
t.string :person_last_name
|
||||
t.string :person_address_street1
|
||||
t.string :person_address_street2
|
||||
t.string :person_address_city
|
||||
t.string :person_address_state
|
||||
t.string :person_address_zip
|
||||
t.string :person_address_country
|
||||
t.string :person_phone
|
||||
t.string :person_email
|
||||
t.string :locale
|
||||
t.text :notes
|
||||
t.datetime :signed_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
class AddQuestionFieldsToContractTemplates < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :contract_templates, :question_1_text, :text
|
||||
add_column :contract_templates, :question_2_text, :text
|
||||
add_column :contract_templates, :question_3_text, :text
|
||||
add_column :contract_templates, :question_4_text, :text
|
||||
add_column :contract_templates, :question_5_text, :text
|
||||
add_column :contract_templates, :question_6_text, :text
|
||||
add_column :contract_templates, :question_7_text, :text
|
||||
add_column :contract_templates, :question_8_text, :text
|
||||
add_column :contract_templates, :question_9_text, :text
|
||||
add_column :contract_templates, :question_10_text, :text
|
||||
end
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
class AddAnswerFieldsToMedicalReleases < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :medical_releases, :question_1_answer, :text
|
||||
add_column :medical_releases, :question_2_answer, :text
|
||||
add_column :medical_releases, :question_3_answer, :text
|
||||
add_column :medical_releases, :question_4_answer, :text
|
||||
add_column :medical_releases, :question_5_answer, :text
|
||||
add_column :medical_releases, :question_6_answer, :text
|
||||
add_column :medical_releases, :question_7_answer, :text
|
||||
add_column :medical_releases, :question_8_answer, :text
|
||||
add_column :medical_releases, :question_9_answer, :text
|
||||
add_column :medical_releases, :question_10_answer, :text
|
||||
end
|
||||
end
|
||||
245
db/structure.sql
245
db/structure.sql
@@ -9,20 +9,6 @@ SET xmloption = content;
|
||||
SET client_min_messages = warning;
|
||||
SET row_security = off;
|
||||
|
||||
--
|
||||
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
||||
--
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
||||
|
||||
|
||||
--
|
||||
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
|
||||
--
|
||||
|
||||
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
||||
|
||||
|
||||
--
|
||||
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
|
||||
--
|
||||
@@ -51,20 +37,20 @@ CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
|
||||
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
|
||||
|
||||
|
||||
--
|
||||
-- Name: pg_search_dmetaphone(text); Type: FUNCTION; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE FUNCTION public.pg_search_dmetaphone(text) RETURNS text
|
||||
LANGUAGE sql IMMUTABLE STRICT
|
||||
AS $_$
|
||||
SELECT array_to_string(ARRAY(SELECT dmetaphone(unnest(regexp_split_to_array($1, E'\\s+')))), ' ')
|
||||
$_$;
|
||||
--
|
||||
-- Name: pg_search_dmetaphone(text); Type: FUNCTION; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE FUNCTION public.pg_search_dmetaphone(text) RETURNS text
|
||||
LANGUAGE sql IMMUTABLE STRICT
|
||||
AS $_$
|
||||
SELECT array_to_string(ARRAY(SELECT dmetaphone(unnest(regexp_split_to_array($1, E'\\s+')))), ' ')
|
||||
$_$;
|
||||
|
||||
|
||||
SET default_tablespace = '';
|
||||
|
||||
SET default_with_oids = false;
|
||||
SET default_table_access_method = heap;
|
||||
|
||||
--
|
||||
-- Name: account_auths; Type: TABLE; Schema: public; Owner: -
|
||||
@@ -606,17 +592,7 @@ CREATE TABLE public.contract_templates (
|
||||
term_text character varying,
|
||||
restriction_id bigint,
|
||||
restriction_text character varying,
|
||||
archived_at timestamp without time zone,
|
||||
question_1_text text,
|
||||
question_2_text text,
|
||||
question_3_text text,
|
||||
question_4_text text,
|
||||
question_5_text text,
|
||||
question_6_text text,
|
||||
question_7_text text,
|
||||
question_8_text text,
|
||||
question_9_text text,
|
||||
question_10_text text
|
||||
archived_at timestamp without time zone
|
||||
);
|
||||
|
||||
|
||||
@@ -639,6 +615,15 @@ CREATE SEQUENCE public.contract_templates_id_seq
|
||||
ALTER SEQUENCE public.contract_templates_id_seq OWNED BY public.contract_templates.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: data_migrations; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public.data_migrations (
|
||||
version character varying NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: directories; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
@@ -861,8 +846,7 @@ CREATE TABLE public.location_releases (
|
||||
filming_started_on date,
|
||||
filming_ended_on date,
|
||||
person_first_name character varying,
|
||||
person_last_name character varying,
|
||||
filming_hours text
|
||||
person_last_name character varying
|
||||
);
|
||||
|
||||
|
||||
@@ -943,61 +927,6 @@ CREATE SEQUENCE public.material_releases_id_seq
|
||||
ALTER SEQUENCE public.material_releases_id_seq OWNED BY public.material_releases.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public.medical_releases (
|
||||
id bigint NOT NULL,
|
||||
project_id bigint,
|
||||
contract_template_id bigint,
|
||||
person_first_name character varying,
|
||||
person_last_name character varying,
|
||||
person_address_street1 character varying,
|
||||
person_address_street2 character varying,
|
||||
person_address_city character varying,
|
||||
person_address_state character varying,
|
||||
person_address_zip character varying,
|
||||
person_address_country character varying,
|
||||
person_phone character varying,
|
||||
person_email character varying,
|
||||
locale character varying,
|
||||
notes text,
|
||||
signed_at timestamp without time zone,
|
||||
created_at timestamp(6) without time zone NOT NULL,
|
||||
updated_at timestamp(6) without time zone NOT NULL,
|
||||
question_1_answer text,
|
||||
question_2_answer text,
|
||||
question_3_answer text,
|
||||
question_4_answer text,
|
||||
question_5_answer text,
|
||||
question_6_answer text,
|
||||
question_7_answer text,
|
||||
question_8_answer text,
|
||||
question_9_answer text,
|
||||
question_10_answer text
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.medical_releases_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public.medical_releases_id_seq OWNED BY public.medical_releases.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: music_releases; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
@@ -1252,7 +1181,6 @@ CREATE TABLE public.settings (
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.settings_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
@@ -1288,7 +1216,6 @@ CREATE TABLE public.taggings (
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.taggings_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
@@ -1319,7 +1246,6 @@ CREATE TABLE public.tags (
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.tags_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
@@ -1400,6 +1326,43 @@ CREATE SEQUENCE public.talent_releases_id_seq
|
||||
ALTER SEQUENCE public.talent_releases_id_seq OWNED BY public.talent_releases.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: task_requests; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public.task_requests (
|
||||
id bigint NOT NULL,
|
||||
project_id bigint,
|
||||
description text,
|
||||
deadline timestamp without time zone,
|
||||
time_allowed character varying,
|
||||
additional_notes text,
|
||||
status integer DEFAULT 0,
|
||||
created_at timestamp(6) without time zone NOT NULL,
|
||||
updated_at timestamp(6) without time zone NOT NULL,
|
||||
deliverable_url character varying
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: task_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.task_requests_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: task_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public.task_requests_id_seq OWNED BY public.task_requests.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: terms; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
@@ -1633,9 +1596,9 @@ CREATE TABLE public.zoom_meetings (
|
||||
created_at timestamp(6) without time zone NOT NULL,
|
||||
updated_at timestamp(6) without time zone NOT NULL,
|
||||
broadcast_id bigint,
|
||||
status integer DEFAULT 0,
|
||||
zoom_user_id bigint,
|
||||
project_id bigint,
|
||||
status integer DEFAULT 0
|
||||
project_id bigint
|
||||
);
|
||||
|
||||
|
||||
@@ -1666,9 +1629,7 @@ CREATE TABLE public.zoom_users (
|
||||
id bigint NOT NULL,
|
||||
api_id character varying,
|
||||
created_at timestamp(6) without time zone NOT NULL,
|
||||
updated_at timestamp(6) without time zone NOT NULL,
|
||||
account_number character varying,
|
||||
tier integer DEFAULT 0
|
||||
updated_at timestamp(6) without time zone NOT NULL
|
||||
);
|
||||
|
||||
|
||||
@@ -1838,13 +1799,6 @@ ALTER TABLE ONLY public.location_releases ALTER COLUMN id SET DEFAULT nextval('p
|
||||
ALTER TABLE ONLY public.material_releases ALTER COLUMN id SET DEFAULT nextval('public.material_releases_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.medical_releases ALTER COLUMN id SET DEFAULT nextval('public.medical_releases_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: music_releases id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -1915,6 +1869,13 @@ ALTER TABLE ONLY public.tags ALTER COLUMN id SET DEFAULT nextval('public.tags_id
|
||||
ALTER TABLE ONLY public.talent_releases ALTER COLUMN id SET DEFAULT nextval('public.talent_releases_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: task_requests id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.task_requests ALTER COLUMN id SET DEFAULT nextval('public.task_requests_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: terms id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -2091,6 +2052,14 @@ ALTER TABLE ONLY public.contract_templates
|
||||
ADD CONSTRAINT contract_templates_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: data_migrations data_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.data_migrations
|
||||
ADD CONSTRAINT data_migrations_pkey PRIMARY KEY (version);
|
||||
|
||||
|
||||
--
|
||||
-- Name: directories directories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -2147,14 +2116,6 @@ ALTER TABLE ONLY public.material_releases
|
||||
ADD CONSTRAINT material_releases_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases medical_releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.medical_releases
|
||||
ADD CONSTRAINT medical_releases_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: music_releases music_releases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -2243,6 +2204,14 @@ ALTER TABLE ONLY public.talent_releases
|
||||
ADD CONSTRAINT talent_releases_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: task_requests task_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.task_requests
|
||||
ADD CONSTRAINT task_requests_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: terms terms_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -2650,20 +2619,6 @@ CREATE INDEX index_material_releases_on_term_id ON public.material_releases USIN
|
||||
CREATE INDEX index_material_releases_on_territory_id ON public.material_releases USING btree (territory_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_medical_releases_on_contract_template_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_medical_releases_on_contract_template_id ON public.medical_releases USING btree (contract_template_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_medical_releases_on_project_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_medical_releases_on_project_id ON public.medical_releases USING btree (project_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_music_releases_on_applicable_medium_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
@@ -2860,6 +2815,13 @@ CREATE INDEX index_talent_releases_on_term_id ON public.talent_releases USING bt
|
||||
CREATE INDEX index_talent_releases_on_territory_id ON public.talent_releases USING btree (territory_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_task_requests_on_project_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX index_task_requests_on_project_id ON public.task_requests USING btree (project_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_unreleased_appearances_on_video_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
@@ -3100,14 +3062,6 @@ ALTER TABLE ONLY public.video_release_confirmations
|
||||
ADD CONSTRAINT fk_rails_2787252ceb FOREIGN KEY (file_info_id) REFERENCES public.file_infos(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases fk_rails_325442c794; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.medical_releases
|
||||
ADD CONSTRAINT fk_rails_325442c794 FOREIGN KEY (contract_template_id) REFERENCES public.contract_templates(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: music_releases fk_rails_3a2b4033ad; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -3292,14 +3246,6 @@ ALTER TABLE ONLY public.zoom_meetings
|
||||
ADD CONSTRAINT fk_rails_8d814ea729 FOREIGN KEY (broadcast_id) REFERENCES public.broadcasts(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: medical_releases fk_rails_98aa92daa9; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.medical_releases
|
||||
ADD CONSTRAINT fk_rails_98aa92daa9 FOREIGN KEY (project_id) REFERENCES public.projects(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: contract_templates fk_rails_9b4d9d0e5a; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
@@ -3613,10 +3559,5 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20200428091105'),
|
||||
('20200507110804'),
|
||||
('20200512161738'),
|
||||
('20200526113516'),
|
||||
('20200603090419'),
|
||||
('20200606044747'),
|
||||
('20200610085411'),
|
||||
('20200610140459');
|
||||
|
||||
|
||||
('20200518200245'),
|
||||
('20200519191908');
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
require 'zoom_gateway'
|
||||
namespace :zoom do
|
||||
desc "Setup necessary zoom roles and users"
|
||||
task :setup => :environment do
|
||||
@@ -16,30 +17,4 @@ namespace :zoom do
|
||||
Rails.logger.info "Created role #{ZoomGateway.HOST_ROLE}."
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
desc "Synchronize ActiveRecord users with current account state"
|
||||
task :sync => :environment do
|
||||
zoom = Zoom.new
|
||||
|
||||
roles = zoom.roles_list["roles"]
|
||||
ActiveRecord::Base.transaction do
|
||||
ZoomUser.tiers.keys.each do |tier|
|
||||
full_role_name = ZoomGateway.host_role_name(tier)
|
||||
role_id = roles.select { |r| r["name"] == full_role_name }.first["id"]
|
||||
user_ids = zoom.roles_members(role_id: role_id).dig("members").pluck("id")
|
||||
|
||||
# Invalid db users (not existing on the given Zoom account, but existing in the app db)
|
||||
ZoomUser.current_account.public_send(tier).where.not(api_id: user_ids).each do |zu|
|
||||
zu.api_id = nil
|
||||
zu.destroy
|
||||
end
|
||||
|
||||
# Missing zoom users (existing in given Zoom account, but not existing in the app db)
|
||||
(user_ids - ZoomUser.current_account.public_send(tier).pluck(:api_id)).each do |api_user_id|
|
||||
ZoomUser.current_account.public_send(tier).create(api_id: api_user_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3,7 +3,6 @@ class ZoomGateway
|
||||
class MeetingExpired < StandardError; end
|
||||
class UserNotFound < StandardError; end
|
||||
class TooManyHosts < StandardError; end
|
||||
class UserAlreadyExists < StandardError; end
|
||||
|
||||
class << self
|
||||
def USER_TYPE_NAME
|
||||
@@ -21,24 +20,12 @@ class ZoomGateway
|
||||
end
|
||||
|
||||
def HOST_ROLE
|
||||
self.host_role_name(self.USER_TYPE_NAME)
|
||||
end
|
||||
|
||||
def ACCOUNT_NUMBER
|
||||
ENV['ZOOM_ACCOUNT_NUMBER']
|
||||
end
|
||||
|
||||
def enable_recordings?
|
||||
ENV['ZOOM_ENABLE_RECORDINGS'] == 'true'
|
||||
"#{self.USER_TYPE_NAME}-directme-host"
|
||||
end
|
||||
|
||||
def apply_limits?
|
||||
self.USER_TYPE_NAME == 'pro'
|
||||
end
|
||||
|
||||
def host_role_name(user_type_name)
|
||||
"#{user_type_name}-directme-host"
|
||||
end
|
||||
end
|
||||
|
||||
def initialize
|
||||
@@ -46,14 +33,12 @@ class ZoomGateway
|
||||
end
|
||||
|
||||
def create_meeting(host_id, **kwargs)
|
||||
recording_type = self.class.enable_recordings? ? 'cloud' : 'none'
|
||||
meeting = @client.meeting_create({ user_id: host_id,
|
||||
topic: kwargs[:topic],
|
||||
type: 1, # Instant meeting
|
||||
settings: {
|
||||
host_video: true,
|
||||
participant_video: true,
|
||||
auto_recording: recording_type,
|
||||
participant_video: true
|
||||
} })
|
||||
meeting["id"]
|
||||
end
|
||||
@@ -93,10 +78,6 @@ class ZoomGateway
|
||||
@client.user_delete(id: host_id)
|
||||
end
|
||||
|
||||
def delete_recording(meeting_id, recording_id)
|
||||
@client.recording_delete(meeting_id: meeting_id, recording_id: recording_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def parse_zoom_error(error)
|
||||
@@ -106,8 +87,6 @@ class ZoomGateway
|
||||
raise UserNotFound, error.message
|
||||
elsif error.status_code == 3001
|
||||
raise MeetingExpired, error.message
|
||||
elsif error.status_code == 1005
|
||||
raise UserAlreadyExists, error.message
|
||||
else
|
||||
raise error
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user