Commit 7746cbda authored by Taico Aerts's avatar Taico Aerts
Browse files

Merge branch 'development' into 'master'

Project Forum Release v2.6.1 - 20-04-2022

See merge request eip/bepsys/bepsys2!708
parents a4d58294 6a94bad7
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
# Constants
TITLE_TRUNCATION_LIMIT = 100
# -----------------------------------------------------------------------------------------------
# Before any action happens in a controller, perform these actions (in this order):
# -----------------------------------------------------------------------------------------------
......
......@@ -24,7 +24,7 @@ class AttachmentsController < ApplicationController
group = Group.find_by(id: attachment.group_id)
send_file attachment.file.path, disposition: 'inline'\
if group.is_involved?(current_user)
if group.involved?(current_user)
end
protected
......
......@@ -136,8 +136,9 @@ class User < ApplicationRecord
validates :first_name, presence: true
validates :last_name, presence: true
after_create :auto_associate_import_entries!, :convert_role_invitations,
:assign_to_course_specific_roles
after_save :auto_associate_import_entries!, :convert_role_invitations,
:assign_to_course_specific_roles,
if: -> { saved_change_to_email }
# -----------------------------------------------------------------------------------------------
# Scopes
......
......@@ -32,8 +32,9 @@
else
User.none
end %>
<% other = User.staff_and_admins.where.not(id: interested.ids).sort_by_name %>
<% other_staff = User.staff_and_admins.where.not(id: interested.ids).sort_by_name %>
<% students = User.role_student.sort_by_name %>
<% external = User.role_company.sort_by_name %>
<% end %>
<% edition.course_specific_roles.each do |csr| %>
......@@ -87,14 +88,16 @@
'data-backdrop' => 'static') do %>
<%= modal_body do %>
<%= form.grouped_collection_select :user_id,
['Interested Supervisors', 'TU Delft Staff', 'Students'],
['Interested Supervisors', 'TU Delft Staff', 'TU Delft Students', 'External'],
->(s) {
if s == 'Interested Supervisors'
interested
elsif s == 'TU Delft Staff'
other
else
other_staff
elsif s == 'TU Delft Students'
students
else
external
end
}, :to_s,
:id, :name,
......
......@@ -8,7 +8,7 @@
<th><%= Group.human_attribute_name(:course_edition) %></th>
<th><%= sort_link @q, :status %></th>
<th><%= sort_link @q, :client_status %></th>
<th><%= sort_link @q, t('activerecord.attributes.project.interested_coaches_count') %></th>
<th><%= t('activerecord.attributes.project.interested_coaches_count') %></th>
</tr>
</thead>
<tbody>
......
......@@ -8,7 +8,7 @@
<th><%= sort_link @q, :course_edition_id %></th>
<th><%= sort_link @q, :offerer_id %></th>
<th><%= sort_link @q, :created_at %></th>
<th><%= sort_link @q, t('activerecord.attributes.project.interested_coaches_count') %></th>
<th><%= t('activerecord.attributes.project.interested_coaches_count') %></th>
</tr>
</thead>
<tbody>
......
<% content_for :header do %>
<h1><%= truncate @course_edition.display_name, length: 30 %></h1>
<h1><%= truncate @course_edition.display_name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<p>Edit options related to supervising this course edition.</p>
<% end %>
<%= render 'availability_page' do %>
......
<% content_for :header do %>
<h1><%= truncate @course_edition.display_name, length: 30 %></h1>
<h1><%= truncate @course_edition.display_name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<p>Submit enrolment to join the course.</p>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @course_edition.display_name, length: 30 %></h1>
<h1><%= truncate @course_edition.display_name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<h3>Round <%= @course_edition.round %></h3>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @experiment_project.name, length: 30 %></h1>
<h1><%= truncate @experiment_project.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<% end %>
<div class="row">
......
<% project_name = @course_edition.configuration.project_name_text(false, false) %>
<% projects_name = @course_edition.configuration.project_name_text(false, true) %>
<% content_for :header do %>
<h1><%= truncate @project.name, length: 30 %></h1>
<h1><%= truncate @project.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<h4>Provided by <i><%= @project.offerer.name %></i> for the <i><%= @course_edition.display_name %></i> course.</h4>
<% end %>
......
<% project_name = @course_edition.configuration.project_name_text(false, false) %>
<% projects_name = @course_edition.configuration.project_name_text(false, true) %>
<% content_for :header do %>
<h1><%= truncate @project.name, length: 30 %></h1>
<h1><%= truncate @project.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<h4>Provided by <i><%= @project.offerer.name %></i> for the <i><%= @course_edition.display_name %></i> course.</h4>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @course_edition.display_name, length: 30 %></h1>
<h1><%= truncate @course_edition.display_name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<p>Enter your <%= @project_name %> preferences</p>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @project.name, length: 30 %></h1>
<h1><%= truncate @project.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<h4>Edit your group's settings and options.</h4>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @project.name, length: 30 %></h1>
<h1><%= truncate @project.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<h4>Perform operations related to group management for this project.</h4>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @project.name, length: 30 %></h1>
<h1><%= truncate @project.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<h4>Group Dashboard, Files, and Group Management.</h4>
<% end %>
<div class="row">
......
<% content_for :header do %>
<h1><%= truncate @course_edition.display_name, length: 30 %></h1>
<h1><%= truncate @course_edition.display_name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<p>Select a <%= @course_edition.configuration.project_name %> to view details and join groups.</p>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @research_group.name, length: 100 %></h1>
<h1><%= truncate @research_group.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<p>Research Group</p>
<% end %>
......
<% content_for :header do %>
<h1><%= truncate @course_edition.display_name, length: 30 %></h1>
<h1><%= truncate @course_edition.display_name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<% if @course_edition.configuration.experiment_workflow? %>
<p>Experiments overview.</p>
<% else %>
......
<% content_for :header do %>
<h1><%= truncate @theme.name, length: 100 %></h1>
<h1><%= truncate @theme.name, length: ApplicationController::TITLE_TRUNCATION_LIMIT %></h1>
<p>Theme of the <%= @theme.research_group.name %> research group</p>
<% end %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment