Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign "Edit lecture" page #627

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2731378
Continuous Release v1.9.3
Splines Feb 16, 2024
ee2bc9a
Continuous Release 1.10.0
Splines Mar 21, 2024
a0e26f8
Continuous Release 1.10.1
Splines Mar 23, 2024
c81dc10
Continuous Release 1.11.0
Splines Apr 2, 2024
4a37d85
Continuous Release 1.11.1
Splines Apr 3, 2024
fd44232
Upgrade Rails to v7.1 and run `bundle update`
Splines Apr 6, 2024
456ed14
Use older version of `html-parser` for `thredded`
Splines Apr 6, 2024
6aee7bb
Use new `config.autoload_lib` in Rails 7.1
Splines Apr 6, 2024
97ea0da
Remove unused app environment variables usage
Splines Apr 6, 2024
e066740
Run `bin/rails app:update` to update configurations
Splines Apr 6, 2024
1236c1b
Add new framework defaults for Rails 7.1 file
Splines Apr 6, 2024
b5cb411
Update `listen` gem version
Splines Apr 6, 2024
0aa94e8
Add TODO note for upcoming serialize change
Splines Apr 6, 2024
2988751
Reduce new framework defaults list
Splines Apr 6, 2024
8d5486d
Add migrations introduced by rails update task
Splines Apr 6, 2024
889e291
Remove unneeded ActiveStorage migrations
Splines Apr 7, 2024
16a33b1
Remove defaults for sha-256 as we are unaffected
Splines Apr 7, 2024
334d7f0
Merge branch 'dev' into deps/upgrade-rails
Splines Apr 9, 2024
5d37d16
Use new Rails 7.1 defaults
Splines Apr 9, 2024
826a800
Fix TODO rubocop warning
Splines Apr 9, 2024
27cd996
Merge branch 'dev' into deps/upgrade-rails & update
Splines Apr 16, 2024
ab6143d
Update bundler version to 2.5.9
Splines Apr 16, 2024
3035022
Merge branch 'dev' into deps/upgrade-rails
Splines Apr 17, 2024
7f97403
Remove unnecessary entries in `Gemfile.lock`
Splines Apr 17, 2024
2b17c87
Address `Passing the coder as positional arg` deprecation
Splines Apr 22, 2024
59c023e
add yaml coder explicitly for serializing arrays
fosterfarrell9 Apr 23, 2024
64fba87
Migrate from globalize to mobility due to serialization warnings
fosterfarrell9 Apr 23, 2024
d695188
Update gem lockfile to include `mobility`
Splines Apr 24, 2024
2c0e7d7
Merge branch 'dev' into deps/upgrade-rails
Splines Apr 24, 2024
f486935
Add `I18nLocaleAccessors` as replacement for `globalize_attribute_names`
Splines Apr 24, 2024
fe65192
Remove obsolete comment regarding `globalize`
Splines Apr 24, 2024
4b8ad59
Fix Rails `secrets` deprecation warning (Devise)
Splines Apr 24, 2024
652f8be
Use `install_folder` in cypress on rails
Splines Apr 24, 2024
b192dd6
Init dummy Bootstrap nav pills
Splines Apr 25, 2024
04f6650
Group accordion items into nav pane
Splines Apr 25, 2024
003b3cb
Style pillars & improve accessibility
Splines Apr 25, 2024
3ced2a7
Remove accordion wrappers & design lecture content pane
Splines Apr 25, 2024
8514c31
Center lectures header & improve vertical alignment
Splines Apr 25, 2024
b53f804
Merge branch 'dev' into feature/admin-lecture-edit-redesign
Splines Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions app/assets/javascripts/lectures.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ disableExceptOrganizational = ->
$('[data-bs-toggle="collapse"]').prop('disabled', true).removeClass('clickable')
return

# Load example data (erdbeere) for structures
loadExampleStructures = ->
structuresBody = $('#erdbeereStructuresBody')
lectureId = structuresBody.data('lecture')
loading = structuresBody.data('loading')
structuresBody.empty().append(loading)
$.ajax Routes.edit_structures_path(lectureId),
type: 'GET'
dataType: 'script'
return

$(document).on 'turbolinks:load', ->
initBootstrapPopovers()
# if any input is given to the lecture form (for people in lecture),
Expand Down Expand Up @@ -282,14 +293,7 @@ $(document).on 'turbolinks:load', ->
largeDisplay()
return

$('#erdbeere_structures_heading').on 'click', ->
lectureId = $(this).data('lecture')
loading = $(this).data('loading')
$('#erdbeereStructuresBody').empty().append(loading)
$.ajax Routes.edit_structures_path(lectureId),
type: 'GET'
dataType: 'script'
return
loadExampleStructures()

$lectureStructures = $('#lectureStructuresInfo')
if $lectureStructures.length > 0
Expand Down
31 changes: 31 additions & 0 deletions app/assets/stylesheets/lectures.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,35 @@
&:hover {
color: white !important;
}
}

#lecture-nav-pills {
background-color: white;
justify-content: center;
padding-top: 1em;
padding-bottom: 1em;

box-shadow: 0px 2px 7px 0rem rgba(130,26,59,0.2);
border: #821A3B solid 1px;
border-radius: 0.4em;
margin-bottom: 1.5em;
}

.lecture-nav-pill-button {
--bs-nav-link-color: #821A3B;
--bs-nav-link-hover-color: #8d1c40;
--bs-nav-pills-link-active-bg: #821A3B;

&:focus-visible {
box-shadow: 0 0 0 0.25rem rgba(130, 26, 59, 0.25);
}
}


.lecture-pane {
background-color: white;
padding: 1.5em 1em;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
border: gray 1px solid;
border-radius: 0.4em;
}
57 changes: 14 additions & 43 deletions app/views/lectures/edit/_announcements.html.erb
Original file line number Diff line number Diff line change
@@ -1,44 +1,15 @@
<div class="accordion-item bg-light">
<div class="accordion-header">
<button class="accordion-button collapsed"
type="button"
id="announcements_heading"
data-bs-toggle="collapse"
data-bs-target="#announcements_collapse"
aria-expanded="false"
aria-controls="announcements_collapse">
<div class="row">
<div class="col-12">
<h5>
<%= t('categories.announcements') %>
(<%= lecture.announcements.size %>)
</h5>
</div>
</div>
</button>
</div>
<div id="announcements_collapse"
class="collapse"
role="tabpanel"
aria-labelledby="heading"
data-bs-parent="#lectureAccordion">
<div class="accordion-body">
<div class="row mb-2">
<div class="col-12 text-center">
<%= link_to t('buttons.create_announcement'),
new_announcement_path(params: { lecture: lecture.id }),
class: 'btn btn-sm btn-secondary',
id: 'new-announcement-button',
remote: true %>
</div>
</div>
<% announcements.each do |a| %>
<div class="row border-bottom mx-2 px-4 py-2"
id="row-announcement-<%= a.id %>">
<%= render partial: 'announcements/row_for_lecture_edit',
locals: { announcement: a }%>
</div>
<% end %>
</div>
</div>
<div class="col-12 text-center">
<%= link_to t('buttons.create_announcement'),
new_announcement_path(params: { lecture: lecture.id }),
class: 'btn btn-sm btn-secondary',
id: 'new-announcement-button',
remote: true %>
</div>

<% announcements.each do |a| %>
<div class="row border-bottom mx-2 px-4 py-2"
id="row-announcement-<%= a.id %>">
<%= render partial: 'announcements/row_for_lecture_edit',
locals: { announcement: a }%>
</div>
<% end %>
204 changes: 89 additions & 115 deletions app/views/lectures/edit/_assignments.html.erb
Original file line number Diff line number Diff line change
@@ -1,120 +1,94 @@
<div class="accordion-item bg-light">
<div class="accordion-header">
<button class="accordion-button collapsed"
type="button"
id="assignments_heading"
data-bs-toggle="collapse"
data-bs-target="#assignments_collapse"
aria-expanded="false"
aria-controls="assignments_collapse">
<div class="row">
<div class="col-12">
<h5>
<%= t('basics.assignments') %>
</h5>
</div>
</div>
</button>
<div class="row mb-3">
<div class="col-12 text-center">
<%= link_to t('admin.assignment.new'),
new_assignment_path(params: { lecture_id: lecture.id }),
class: 'btn btn-sm btn-primary',
id: 'newAssignmentButton',
remote: true %>
</div>
<div id="assignments_collapse"
class="collapse"
role="tabpanel"
aria-labelledby="heading"
data-bs-parent="#lectureAccordion">
<div class="accordion-body">
<div class="row mb-3">
<div class="col-12 text-center">
<%= link_to t('admin.assignment.new'),
new_assignment_path(params: { lecture_id: lecture.id }),
class: 'btn btn-sm btn-primary',
id: 'newAssignmentButton',
remote: true %>
</div>
</div>
<div class="list-group">
<div class="list-group-item bg-light"
id="assignmentListHeader"
style="display: <%= show(lecture.assignments?) %>">
<div class="row">
<div class="col-2">
<h6>
<%= t('basics.title') %>
</h6>
</div>
<div class="col-3">
<h6>
<%= t('basics.deadline') %>
</h6>
</div>
<div class="col-2">
<h6>
<%= t('basics.medium') %>
</h6>
</div>
<div class="col-2">
<h6>
<%= t('submission.file_format') %>
</h6>
</div>
<div class="col-2">
<h6>
<%= t('assignment.deletion_date') %>
</h6>
</div>
<div class="list-group">
<div class="list-group-item bg-light"
id="assignmentListHeader"
style="display: <%= show(lecture.assignments?) %>">
<div class="row">
<div class="col-2">
<h6>
<%= t('basics.title') %>
</h6>
</div>
<div class="col-3">
<h6>
<%= t('basics.deadline') %>
</h6>
</div>
<div class="col-2">
<h6>
<%= t('basics.medium') %>
</h6>
</div>
<div class="col-2">
<h6>
<%= t('submission.file_format') %>
</h6>
</div>
<div class="col-2">
<h6>
<%= t('assignment.deletion_date') %>
</h6>
</div>
<div class="col-1">
<h6>
<%= t('basics.action') %>
<%= helpdesk(t('assignment.destruction_info'), true) %>
</h6>
</div>
</div>
</div>
<% (lecture.scheduled_assignments.sort_by(&:deadline).reverse +
lecture.assignments.order('deadline DESC')).each do |a| %>
<%= render partial: 'assignments/row',
locals: { assignment: a } %>
<% end %>
<div class="col-1">
<h6>
<%= t('basics.action') %>
<%= helpdesk(t('assignment.destruction_info'), true) %>
</h6>
</div>
<%= form_with model: lecture,
html: { id: 'lecture-assignments-form',
class: 'mt-4 px-2' } do |f| %>
<div class="row">
<div class="mb-3 col-md-6">
<%= f.label :submission_max_team_size,
t('admin.lecture.submission_max_team_size'),
class: "form-label" %>
<%= helpdesk t('admin.lecture.info.submission_max_team_size'),
false %>
<%= f.number_field :submission_max_team_size,
min: 1,
max: 10000,
class: 'form-control mx-2',
data:
{ value: lecture.submission_max_team_size } %>
</div>
<div class="mb-3 col-md-6">
<%= f.label :submission_grace_period,
t('admin.lecture.submission_grace_period'),
class: "form-label" %>
<%= helpdesk t('admin.lecture.info.submission_grace_period'),
false %>
<%= f.number_field :submission_grace_period,
min: 0,
max: 262800,
class: 'form-control mx-2',
data: { value: lecture.submission_grace_period } %>
</div>
</div>
<div id="lecture-assignments-warning" class="mt-3">
<%= t('warnings.unsaved_changes') %>
<%= f.submit t('buttons.save_and_exit'),
class: "btn btn-sm btn-primary" %>
<button type="button" id="cancel-lecture-assignments"
class="btn btn-sm btn-secondary">
<%= t('buttons.cancel') %>
</button>
</div>
<% end %>
</div>
</div>
</div>
<% (lecture.scheduled_assignments.sort_by(&:deadline).reverse +
lecture.assignments.order('deadline DESC')).each do |a| %>
<%= render partial: 'assignments/row',
locals: { assignment: a } %>
<% end %>
</div>

<%= form_with model: lecture,
html: { id: 'lecture-assignments-form',
class: 'mt-4 px-2' } do |f| %>
<div class="row">
<div class="mb-3 col-md-6">
<%= f.label :submission_max_team_size,
t('admin.lecture.submission_max_team_size'),
class: "form-label" %>
<%= helpdesk t('admin.lecture.info.submission_max_team_size'),
false %>
<%= f.number_field :submission_max_team_size,
min: 1,
max: 10000,
class: 'form-control mx-2',
data:
{ value: lecture.submission_max_team_size } %>
</div>
<div class="mb-3 col-md-6">
<%= f.label :submission_grace_period,
t('admin.lecture.submission_grace_period'),
class: "form-label" %>
<%= helpdesk t('admin.lecture.info.submission_grace_period'),
false %>
<%= f.number_field :submission_grace_period,
min: 0,
max: 262800,
class: 'form-control mx-2',
data: { value: lecture.submission_grace_period } %>
</div>
</div>
<div id="lecture-assignments-warning" class="mt-3">
<%= t('warnings.unsaved_changes') %>
<%= f.submit t('buttons.save_and_exit'),
class: "btn btn-sm btn-primary" %>
<button type="button" id="cancel-lecture-assignments"
class="btn btn-sm btn-secondary">
<%= t('buttons.cancel') %>
</button>
</div>
<% end %>
Loading