diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.scss b/app/assets/stylesheets/bootstrap_and_overrides.css.scss index 902b862..f291db6 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.scss +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.scss @@ -1,11 +1,157 @@ +/************************/ +/*** YORKU CSS START ***/ +/************************/ +// Import Bootstrap's default functions first +// then add your custom variables +// then import variables, mixins +// then import bootstrap +// then add your custom css + +@import "bootstrap/functions"; + +//YorkU Colors +/* 2021 YorkU colours */ +/* http://toolbox.info.yorku.ca/visual-identity/colours/ */ +$york-grey-dark: #686260; +$york-grey-medium: #B7AEA9; +$york-grey-pewter: #D6CFCA; +$york-grey-light: #E8E4DF; +$york-grey-lighter: #FAFAFA; +$york-red-pms-186: #E31837; +$york-red-medium: #B82025; +$york-red-dark: #8C0000; +$york-light-blue: #ACE6F8; +$york-bright-blue: #3AC2EF; + +// Custom theme colors +$primary: $york-red-pms-186; +$secondary: $york-grey-dark; +$success: #2e8540 !default; //#35B01C !default; //$green !default; $success: #3AC2EF; +$info: darken($york-light-blue, 50%); +$warning: #ffc107; +$danger: $york-red-medium; +$light: $york-grey-lighter; +$dark: $york-grey-dark; + +// Additional custom styles +$border-radius: .25rem; +$btn-border-radius: .25rem; +$btn-padding-y: .5rem; +$btn-padding-x: 1rem; +$btn-font-weight: 400; + +$theme-colors: ( + 'primary': $primary, + 'secondary': $secondary, + 'success': $success, + 'info': $info, + 'warning': $warning, + 'danger': $danger, + 'light': $light, + 'dark': $dark, +); + +$yorku-colors: ( + 'york-grey-dark': $york-grey-dark, + 'york-grey-medium': $york-grey-medium, + 'york-grey-pewter': $york-grey-pewter, + 'york-grey-light': $york-grey-light, + 'york-grey-lighter': $york-grey-lighter, + 'york-red-pms-186': $york-red-pms-186, + 'york-red-medium': $york-red-medium, + 'york-red-dark': $york-red-dark, + 'york-light-blue': $york-light-blue, + 'york-bright-blue': $york-bright-blue +); + +// Merge the maps +$theme-colors: map-merge($theme-colors, $yorku-colors); +$theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value"); + + +@import "bootstrap/variables"; +@import "bootstrap/mixins"; @import "bootstrap"; -$color_h6: #d2452a; -$color_h6_green: #009900; -h6 { - color: $color_h6; + +// Headings customization +.container { + + h1, .h1 { + color: $black; + font-weight: 700; + } + + h2, .h2 { + color: $primary; + font-weight: 600; + } + + h3, .h3 { + color: darken($info, 30%); + font-weight: 500; + } + + h4, .h4, h5, .h5, h6, .h6 { + color: $secondary; + font-weight: 400; + } + + // Subheadings customization + .subheading { + color: $secondary; + font-weight: 300; + font-size: 1.25rem; // Adjust as needed + } +} +// Key-Value pairs in forms +.dl-horizontal dt { + font-weight: 500; + color: $primary; } -h6.green{ - color: $color_h6_green; - border-bottom: 1px solid rgb(228, 228, 228); +.dl-horizontal dd { + color: $secondary; +} + +.page-header { + margin-bottom: 10px; +} +.student-view { + margin-top: 10px; +} + +// Custom styles can go here, if needed +.record-data { + margin-top: 10px; + margin-bottom: 10px; + tr { + td:nth-child(1) { + @extend .lead; + // font-size: $small-font-size; + font-size: 1rem; + color: $secondary; + } + td:nth-child(2) { + // color: $secondary; + font-weight: 600; + } + } +} + +.simple_form { + // background-color: lighten($york-grey-pewter, 8%); + // background-color: $york-grey-pewter; + background-color: $light; + padding: 0.875rem; +} +.simple_form .form-control { + font-size: 1.1rem; + margin-bottom: 10px; +} +.simple_form .form-text { + margin-bottom: 0.25rem; +} +.container section { + padding-top: 15px; + padding-bottom: 15px; } \ No newline at end of file diff --git a/app/controllers/committee_members_controller.rb b/app/controllers/committee_members_controller.rb index 7dc631e..a5ecb9b 100644 --- a/app/controllers/committee_members_controller.rb +++ b/app/controllers/committee_members_controller.rb @@ -44,6 +44,6 @@ def destroy private def committee_member_params - params.require(:committee_member).permit(:first_name, :last_name, :role, :thesis_id) + params.require(:committee_member).permit(:first_name, :last_name, :role, :thesis_id, :gem_record_id) end end diff --git a/app/controllers/student_view_controller.rb b/app/controllers/student_view_controller.rb index 8be639c..25e91c3 100644 --- a/app/controllers/student_view_controller.rb +++ b/app/controllers/student_view_controller.rb @@ -46,10 +46,13 @@ def thesis_process_router when Thesis::PROCESS_REVIEW @primary_documents = @thesis.documents.not_deleted.primary @supplemental_documents = @thesis.documents.not_deleted.supplemental + @supplemental_licence_documents = @thesis.documents.not_deleted.supplemental.licence_type render_according_to_validation('student_view/process/review') when Thesis::PROCESS_SUBMIT @primary_documents = @thesis.documents.not_deleted.primary @supplemental_documents = @thesis.documents.not_deleted.supplemental + @supplemental_licence_documents = @thesis.documents.not_deleted.supplemental.licence_type + @supplemental_embargo_documents = @thesis.documents.not_deleted.supplemental.embargo_type render_according_to_validation('student_view/process/submit') when Thesis::PROCESS_STATUS render_according_to_validation('student_view/process/status') diff --git a/app/controllers/theses_controller.rb b/app/controllers/theses_controller.rb index 6609911..8bd6871 100644 --- a/app/controllers/theses_controller.rb +++ b/app/controllers/theses_controller.rb @@ -45,6 +45,8 @@ def new @thesis.exam_date = record.examdate @thesis.program = record.program @thesis.assign_degree_name_and_level + @thesis.committee_members = record.committee_members + end def create @@ -53,8 +55,18 @@ def create @thesis.student = @student @thesis.audit_comment = 'Starting a new thesis. Status: OPEN.' + @thesis.audit_comment = 'Starting a new thesis. Status: OPEN.' + @thesis.status = Thesis::OPEN if @thesis.save + if params[:committee_member_ids].present? + params[:committee_member_ids].each do |committee_member_id| + if committee_member_id.present? + committee_member = CommitteeMember.find(committee_member_id) + committee_member.update(thesis: @thesis) + end + end + end redirect_to [@student, @thesis], notice: 'ETD record successfully created.' else render action: 'new' diff --git a/app/models/app_settings.rb b/app/models/app_settings.rb index baac95f..a662791 100644 --- a/app/models/app_settings.rb +++ b/app/models/app_settings.rb @@ -43,6 +43,12 @@ class AppSettings < RailsSettings::Base
  • Video: 8-10 bit uncompressed AVI (.avi)
  • Audio: Free Lossless Audio Codec or WAVE (.flac or .wav)
  • ' + field :student_supplementary_embargo_upload_files, default: '

    Please Upload the following documents:

    + ' field :student_review_license_info, default: 'Please review the licences below, you must agree to all to proceed.' field :student_review_license_lac, default: 'LAC Licence is required. Please download the form (lac-non-exclusive-licence-en.pdf), sign it and upload it.' field :student_review_lac_licence_instructions, default: '

    Please download, sign and upload the LAC Licence file. You must upload the licence to proceed to next step

    diff --git a/app/models/committee_member.rb b/app/models/committee_member.rb index 3c755b3..91ebd7a 100644 --- a/app/models/committee_member.rb +++ b/app/models/committee_member.rb @@ -13,6 +13,7 @@ class CommitteeMember < ApplicationRecord ## RELATIONS ## belongs_to :thesis + belongs_to :gem_record ## VALIDATIONS ## validates_presence_of :first_name, message: 'Please choose a name.' diff --git a/app/models/document.rb b/app/models/document.rb index 53ab748..30d9ff2 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -20,6 +20,8 @@ class Document < ApplicationRecord scope :supplemental, -> { where('supplemental = ? ', true) } scope :deleted, -> { where('deleted = ?', true) } scope :not_deleted, -> { where('deleted = ?', false) } + scope :licence_type, -> { where(usage: :licence) } + scope :embargo_type, -> { where(usage: [:embargo, :embargo_letter])} enum usage: %i[thesis embargo embargo_letter licence] diff --git a/app/models/gem_record.rb b/app/models/gem_record.rb index baba38b..87d02c9 100644 --- a/app/models/gem_record.rb +++ b/app/models/gem_record.rb @@ -14,6 +14,8 @@ class GemRecord < ApplicationRecord MASTERS_EXAM = "Master's Thesis Exam" ACCEPTED = 'Accepted' + has_many :committee_members + scope :completed, lambda { where('eventtype = ? OR eventtype = ?', GemRecord::PHD_COMPLETED, GemRecord::MASTERS_COMPLETED) } diff --git a/app/views/committee_members/_committee_member.html.erb b/app/views/committee_members/_committee_member.html.erb index 5e3abb8..69607b4 100644 --- a/app/views/committee_members/_committee_member.html.erb +++ b/app/views/committee_members/_committee_member.html.erb @@ -2,9 +2,16 @@
    <%= committee_member.name %>
    <%= committee_member.role %>
    - <% if can?(:destroy, committee_member) && @thesis.status != Thesis::PUBLISHED %> - <%= link_to student_thesis_committee_member_path(@student, @thesis, committee_member), - method: :delete, class: "btn btn-close pull-right", remote: true, data: { confirm: "Are you sure?" } do %> <% end %> + <% if @thesis.id && %> + <% if can?(:destroy, committee_member) && @thesis.status != Thesis::PUBLISHED %> + <%= link_to student_thesis_committee_member_path(@student, @thesis, committee_member), + method: :delete, class: "btn btn-close pull-right", remote: true, data: { confirm: "Are you sure?" } do %> <% end %> + <% end %> + <% else %> + <%= hidden_field_tag "committee_member_ids[]", committee_member.id %> + +   + <% end %>
    diff --git a/app/views/documents/_new_embargo_form.html.erb b/app/views/documents/_new_embargo_form.html.erb new file mode 100644 index 0000000..96bb8e2 --- /dev/null +++ b/app/views/documents/_new_embargo_form.html.erb @@ -0,0 +1,52 @@ +<% primary = false if local_assigns[:primary].nil? %> + \ No newline at end of file diff --git a/app/views/documents/_new_form.html.erb b/app/views/documents/_new_form.html.erb index 71c128d..6b2e0ad 100644 --- a/app/views/documents/_new_form.html.erb +++ b/app/views/documents/_new_form.html.erb @@ -37,7 +37,7 @@ <%= f.hidden_field :usage, value: :thesis %> <%= f.hidden_field :supplemental, value: false %> <% else %> - <%= f.input :usage, label: "Document type", collection: Document.usages.keys.map(&:to_sym).reject { |usage| usage == :licence }, required: true, label_html: { class: 'pt-2' } %> + <%= f.input :usage, label: "Document type", collection: Document.usages.keys.map(&:to_sym).reject { |usage| usage != :thesis }, required: true, label_html: { class: 'pt-2' } %> <%= f.hidden_field :supplemental, value: true %> <% end %> diff --git a/app/views/gem_records/_gem_record.html.erb b/app/views/gem_records/_gem_record.html.erb index a6d9e74..666dd02 100644 --- a/app/views/gem_records/_gem_record.html.erb +++ b/app/views/gem_records/_gem_record.html.erb @@ -24,6 +24,12 @@

    <%= gem_record.eventtype%>

    Program

    <%= gem_record.program %>

    +
    Committee Members
    + <% gem_record.committee_members.each do |committee_member| %> +
    +
    <%= committee_member.name %> - <%= committee_member.role %>
    +
    + <% end %>
    Event date
    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fd987bb..de85b1a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,7 +23,7 @@
    <% end %>
    -
    +
    <%= image_tag("yorklogo.gif", alt: "York University - Graduate Studies" )%> diff --git a/app/views/settings/_student_submission.html.erb b/app/views/settings/_student_submission.html.erb index d680738..f79f2fd 100644 --- a/app/views/settings/_student_submission.html.erb +++ b/app/views/settings/_student_submission.html.erb @@ -22,6 +22,7 @@