diff --git a/app/assets/javascripts/lectures.coffee b/app/assets/javascripts/lectures.coffee index 6e8d60759..3f588c467 100644 --- a/app/assets/javascripts/lectures.coffee +++ b/app/assets/javascripts/lectures.coffee @@ -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), @@ -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 diff --git a/app/assets/stylesheets/lectures.scss b/app/assets/stylesheets/lectures.scss index 6e31dd03d..64735889e 100644 --- a/app/assets/stylesheets/lectures.scss +++ b/app/assets/stylesheets/lectures.scss @@ -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; } \ No newline at end of file diff --git a/app/views/lectures/edit/_announcements.html.erb b/app/views/lectures/edit/_announcements.html.erb index 5d14d926e..63261f27f 100644 --- a/app/views/lectures/edit/_announcements.html.erb +++ b/app/views/lectures/edit/_announcements.html.erb @@ -1,44 +1,15 @@ -
-
- -
-
-
-
-
- <%= 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 %> -
-
- <% announcements.each do |a| %> -
- <%= render partial: 'announcements/row_for_lecture_edit', - locals: { announcement: a }%> -
- <% end %> -
-
+
+ <%= 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 %> +
+ +<% announcements.each do |a| %> +
+ <%= render partial: 'announcements/row_for_lecture_edit', + locals: { announcement: a }%>
+<% end %> diff --git a/app/views/lectures/edit/_assignments.html.erb b/app/views/lectures/edit/_assignments.html.erb index 2bdea32f3..83c0391f8 100644 --- a/app/views/lectures/edit/_assignments.html.erb +++ b/app/views/lectures/edit/_assignments.html.erb @@ -1,120 +1,94 @@ -
-
- +
+
+ <%= link_to t('admin.assignment.new'), + new_assignment_path(params: { lecture_id: lecture.id }), + class: 'btn btn-sm btn-primary', + id: 'newAssignmentButton', + remote: true %>
-
-
-
-
- <%= link_to t('admin.assignment.new'), - new_assignment_path(params: { lecture_id: lecture.id }), - class: 'btn btn-sm btn-primary', - id: 'newAssignmentButton', - remote: true %> -
+
+
+
+
+
+
+ <%= t('basics.title') %> +
+
+
+
+ <%= t('basics.deadline') %> +
+
+
+
+ <%= t('basics.medium') %> +
+
+
+
+ <%= t('submission.file_format') %> +
+
+
+
+ <%= t('assignment.deletion_date') %> +
-
-
-
-
-
- <%= t('basics.title') %> -
-
-
-
- <%= t('basics.deadline') %> -
-
-
-
- <%= t('basics.medium') %> -
-
-
-
- <%= t('submission.file_format') %> -
-
-
-
- <%= t('assignment.deletion_date') %> -
-
-
-
- <%= t('basics.action') %> - <%= helpdesk(t('assignment.destruction_info'), true) %> -
-
-
-
- <% (lecture.scheduled_assignments.sort_by(&:deadline).reverse + - lecture.assignments.order('deadline DESC')).each do |a| %> - <%= render partial: 'assignments/row', - locals: { assignment: a } %> - <% end %> +
+
+ <%= t('basics.action') %> + <%= helpdesk(t('assignment.destruction_info'), true) %> +
- <%= form_with model: lecture, - html: { id: 'lecture-assignments-form', - class: 'mt-4 px-2' } do |f| %> -
-
- <%= 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 } %> -
-
- <%= 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 } %> -
-
-
- <%= t('warnings.unsaved_changes') %> - <%= f.submit t('buttons.save_and_exit'), - class: "btn btn-sm btn-primary" %> - -
- <% end %>
-
\ No newline at end of file + <% (lecture.scheduled_assignments.sort_by(&:deadline).reverse + + lecture.assignments.order('deadline DESC')).each do |a| %> + <%= render partial: 'assignments/row', + locals: { assignment: a } %> + <% end %> +
+ +<%= form_with model: lecture, + html: { id: 'lecture-assignments-form', + class: 'mt-4 px-2' } do |f| %> +
+
+ <%= 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 } %> +
+
+ <%= 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 } %> +
+
+
+ <%= t('warnings.unsaved_changes') %> + <%= f.submit t('buttons.save_and_exit'), + class: "btn btn-sm btn-primary" %> + +
+<% end %> \ No newline at end of file diff --git a/app/views/lectures/edit/_comments.html.erb b/app/views/lectures/edit/_comments.html.erb index cdc6345c5..618fcee68 100644 --- a/app/views/lectures/edit/_comments.html.erb +++ b/app/views/lectures/edit/_comments.html.erb @@ -1,103 +1,77 @@ -
-
- +
+
+ <%= link_to t('buttons.close_comments'), + lecture_close_comments_path(lecture), + class: 'btn btn-sm btn-primary' %> + <%= link_to t('buttons.open_comments'), + lecture_open_comments_path(lecture), + class: 'btn btn-sm btn-primary' %> +
+
+ +<%= form_with model: lecture, + html: { id: 'lecture-comments-form' } do |f| %> +
+
+ <%= f.check_box :comments_disabled, + class: 'form-check-input' %> + <%= f.label :comments_disabled, + t('admin.lecture.comments_disabled'), + { class: 'form-check-label' } %> + <%= helpdesk(t('admin.lecture.info.comments_disabled'), + false) %> +
-
-
-
-
- <%= link_to t('buttons.close_comments'), - lecture_close_comments_path(lecture), - class: 'btn btn-sm btn-primary' %> - <%= link_to t('buttons.open_comments'), - lecture_open_comments_path(lecture), - class: 'btn btn-sm btn-primary' %> +
+
+
+ <%= t('warnings.unsaved_changes') %> + <%= f.submit t('buttons.save_and_exit'), + class: "btn btn-sm btn-primary" %> + +
+
+ +
+ <%= t('admin.lecture.enable_annotation_button') %> + <%= helpdesk(t('admin.lecture.enable_annotation_button_helpdesk'), + false) %> +
+
+ <%= f.radio_button :annotations_status, + 1, + class: 'form-check-input' %> + <%= f.label :annotations_status, + t('basics.yes_lc'), + value: 1, + class: 'form-check-label' %> +
+
+ <%= f.radio_button :annotations_status, + -1, + class: 'form-check-input' %> + <%= f.label :annotations_status, + t('basics.no_lc'), + value: -1, + class: 'form-check-label' %>
- <%= form_with model: lecture, - html: { id: 'lecture-comments-form' } do |f| %> -
-
- <%= f.check_box :comments_disabled, - class: 'form-check-input' %> - <%= f.label :comments_disabled, - t('admin.lecture.comments_disabled'), - { class: 'form-check-label' } %> - <%= helpdesk(t('admin.lecture.info.comments_disabled'), - false) %> -
+
+
+
+
+ <%= t('warnings.unsaved_changes') %> + <%= f.submit t('buttons.save_and_exit'), + class: "btn btn-sm btn-primary" %> +
-
-
-
- <%= t('warnings.unsaved_changes') %> - <%= f.submit t('buttons.save_and_exit'), - class: "btn btn-sm btn-primary" %> - -
-
- -
- <%= t('admin.lecture.enable_annotation_button') %> - <%= helpdesk(t('admin.lecture.enable_annotation_button_helpdesk'), - false) %> -
-
- <%= f.radio_button :annotations_status, - 1, - class: 'form-check-input' %> - <%= f.label :annotations_status, - t('basics.yes_lc'), - value: 1, - class: 'form-check-label' %> -
-
- <%= f.radio_button :annotations_status, - -1, - class: 'form-check-input' %> - <%= f.label :annotations_status, - t('basics.no_lc'), - value: -1, - class: 'form-check-label' %> -
-
-
-
-
-
- <%= t('warnings.unsaved_changes') %> - <%= f.submit t('buttons.save_and_exit'), - class: "btn btn-sm btn-primary" %> - -
-
-
- <% end %>
-
+<% end %> diff --git a/app/views/lectures/edit/_erdbeere.html.erb b/app/views/lectures/edit/_erdbeere.html.erb index b7a1267e8..a158a44db 100644 --- a/app/views/lectures/edit/_erdbeere.html.erb +++ b/app/views/lectures/edit/_erdbeere.html.erb @@ -1,29 +1,4 @@ -
-
- -
-
-
-
-
-
\ No newline at end of file +
+
diff --git a/app/views/lectures/edit/_form.html.erb b/app/views/lectures/edit/_form.html.erb index e0f17c223..c08624472 100644 --- a/app/views/lectures/edit/_form.html.erb +++ b/app/views/lectures/edit/_form.html.erb @@ -1,63 +1,164 @@ <% cache lecture do %>
- <%= render partial: 'lectures/edit/header', - locals: { lecture: lecture } %> -
- <% if !lecture.seminar? || lecture.legacy_seminar %> -
- <%= render partial: 'lectures/edit/content', - locals: { lecture: lecture } %> + +
+ <%= render partial: 'lectures/edit/header', + locals: { lecture: lecture } %> +
+ + + + +
+ +
+
+ <% if !lecture.seminar? || lecture.legacy_seminar %> +
+ <%= render partial: 'lectures/edit/content', + locals: { lecture: lecture } %> +
+ <% else %> +
+ <%= render partial: 'lectures/edit/seminar_content', + locals: { lecture: lecture } %> +
+ <% end %> +
+ <%= render partial: 'lectures/edit/media', + locals: { media: media, lecture: lecture } %> +
- <% else %> -
- <%= render partial: 'lectures/edit/seminar_content', - locals: { lecture: lecture } %> +
+ + +
+
+ <%= render partial: 'lectures/edit/preferences', + locals: { lecture: lecture } %>
- <% end %> -
- <%= render partial: 'lectures/edit/media', - locals: { media: media, - lecture: lecture } %>
-
-
-
- <%= render partial: 'lectures/edit/tags', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/imported_media', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/erdbeere', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/people', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/organizational_concept', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/tutorials', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/assignments', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/announcements', - locals: { lecture: lecture, - announcements: announcements } %> - <%= render partial: 'lectures/edit/forum', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/comments', - locals: { lecture: lecture } %> - <%= render partial: 'lectures/edit/preferences', - locals: { lecture: lecture } %> + + +
+
+ <%= render partial: 'lectures/edit/people', + locals: { lecture: lecture } %> + <%= render partial: 'lectures/edit/tutorials', + locals: { lecture: lecture } %> +
+
+ + +
+
+ <%= render partial: 'lectures/edit/organizational_concept', + locals: { lecture: lecture } %> +
+
+ + +
+
+ <%= render partial: 'lectures/edit/announcements', + locals: { lecture: lecture, announcements: announcements } %> + <%= render partial: 'lectures/edit/forum', + locals: { lecture: lecture } %> + <%= render partial: 'lectures/edit/comments', + locals: { lecture: lecture } %> +
+
+ + +
+
+ <%= render partial: 'lectures/edit/assignments', + locals: { lecture: lecture } %> +
+
+ + +
+
+ <%= render partial: 'lectures/edit/tags', + locals: { lecture: lecture } %> + <%= render partial: 'lectures/edit/imported_media', + locals: { lecture: lecture } %> + <%= render partial: 'lectures/edit/erdbeere', + locals: { lecture: lecture } %> +
+ + + <%= render partial: 'media/modal' %> <%= render partial: 'sections/content_modal' %> <%= render partial: 'tags/modal' %> <%= render partial: 'announcements/modal' %> <%= render partial: 'lectures/publish/publish', locals: { lecture: lecture } %> + <% unless lecture.stale? %> <%= render partial: 'lectures/edit/user_modal', locals: { lecture: lecture } %> <% end %> + <% if !lecture.seminar? || lecture.legacy_seminar %> <%= render partial: 'chapters/modal', locals: { lecture: lecture } %> @@ -67,8 +168,10 @@ <%= render partial: 'talks/modal', locals: { lecture: lecture } %> <% end %> + <% if lecture.importable_toc? %> <%= render partial: 'lectures/edit/import_toc_modal', locals: { lecture: lecture } %> <% end %> + <% end %> diff --git a/app/views/lectures/edit/_forum.html.erb b/app/views/lectures/edit/_forum.html.erb index 837854fb9..470289d32 100644 --- a/app/views/lectures/edit/_forum.html.erb +++ b/app/views/lectures/edit/_forum.html.erb @@ -1,49 +1,20 @@ -
-
- -
-
-
-
-
- <% if lecture.forum? && lecture.forum %> - <% if lecture.forum&.locked %> - <%= link_to t('buttons.unlock_board'), - unlock_forum_path(lecture), - class: 'btn btn-sm btn-primary' %> - <% else %> - <%= link_to t('buttons.lock_board'), - lock_forum_path(lecture), - class: 'btn btn-sm btn-primary' %> - <% end %> - <%= link_to t('buttons.delete_board'), - destroy_forum_path(lecture), - class: 'btn btn-sm btn-danger' %> - <% else %> - <%= link_to t('buttons.add_board'), - add_forum_path(lecture), - class: 'btn btn-sm btn-primary' %> - <% end %> -
-
-
-
-
\ No newline at end of file +
+ <% if lecture.forum? && lecture.forum %> + <% if lecture.forum&.locked %> + <%= link_to t('buttons.unlock_board'), + unlock_forum_path(lecture), + class: 'btn btn-sm btn-primary' %> + <% else %> + <%= link_to t('buttons.lock_board'), + lock_forum_path(lecture), + class: 'btn btn-sm btn-primary' %> + <% end %> + <%= link_to t('buttons.delete_board'), + destroy_forum_path(lecture), + class: 'btn btn-sm btn-danger' %> + <% else %> + <%= link_to t('buttons.add_board'), + add_forum_path(lecture), + class: 'btn btn-sm btn-primary' %> + <% end %> +
diff --git a/app/views/lectures/edit/_header.html.erb b/app/views/lectures/edit/_header.html.erb index c75e3ce1e..01be44f43 100644 --- a/app/views/lectures/edit/_header.html.erb +++ b/app/views/lectures/edit/_header.html.erb @@ -1,6 +1,6 @@ -
-
-

+
+
+

<%= lecture.sort_localized %> @@ -12,14 +12,14 @@ <%= lecture.title_with_teacher_no_type %> <%= link_to '', lecture_path(lecture), - class: 'fas fa-eye text-dark mt-3', + class: 'fas fa-eye text-dark d-contents', data: { toggle: 'tooltip', placement: 'bottom' }, title: t('buttons.show'), style: 'text-decoration: none;' %>

-
+
<% if current_user.admin || lecture.course.edited_by?(current_user) %> <%= link_to t('buttons.parent_course'), edit_course_path(lecture.course), diff --git a/app/views/lectures/edit/_imported_media.html.erb b/app/views/lectures/edit/_imported_media.html.erb index 03e1cccb3..228b07672 100644 --- a/app/views/lectures/edit/_imported_media.html.erb +++ b/app/views/lectures/edit/_imported_media.html.erb @@ -1,53 +1,24 @@ -
-
- -
-
-
-
- <%= render partial: 'lectures/import/imported_media', - locals: { media: lecture.imported_media, - lecture: lecture } %> -
-
-
- -
-
-
-
- <%= render partial: 'media/catalog/search_form', - locals: { purpose: 'import' } %> -
-
-
-
-
-
\ No newline at end of file +
+ <%= render partial: 'lectures/import/imported_media', + locals: { media: lecture.imported_media, + lecture: lecture } %> +
+ +
+
+ +
+
+ +
+
+ <%= render partial: 'media/catalog/search_form', + locals: { purpose: 'import' } %> +
+
+
diff --git a/app/views/lectures/edit/_organizational_concept.html.erb b/app/views/lectures/edit/_organizational_concept.html.erb index ef5875a98..759597fc6 100644 --- a/app/views/lectures/edit/_organizational_concept.html.erb +++ b/app/views/lectures/edit/_organizational_concept.html.erb @@ -1,85 +1,58 @@ -
-
- +
+ <% end %> +
+
+
+ <%= f.trix_editor :organizational_concept, + id: 'lecture-concept-trix', + data: { content: lecture.organizational_concept } %>
-
-
- <%= form_with model: lecture, - html: { id: 'lecture-organizational-form' } do |f| %> -
-
-
- <%= f.check_box :organizational, - class: 'form-check-input' %> - <%= f.label :organizational, - t('admin.lecture.organizational_visible'), - { class: 'form-check-label' } %> - <%= helpdesk(t('admin.lecture.info.organizational'), false) %> -
-
-
-
- <%= f.check_box :muesli, - class: 'form-check-input' %> - <%= f.label :muesli, - t('admin.lecture.uses_muesli'), - { class: 'form-label' } %> - <%= helpdesk(t('admin.lecture.info.muesli'), false) %> -
-
- <% if !lecture.term && lecture.organizational %> -
-
- <%= f.check_box :organizational_on_top, - class: 'form-check-input' %> - <%= f.label :organizational_on_top, - t('admin.lecture.organizational_on_top'), - { class: 'form-check-label' } %> - <%= helpdesk(t('admin.lecture.info.organizational_on_top'), - false) %> -
-
- <% end %> -
-
-
- <%= f.trix_editor :organizational_concept, - id: 'lecture-concept-trix', - data: { content: lecture.organizational_concept } %> -
-
-
-
-
- <%= t('warnings.unsaved_changes') %> - <%= f.submit t('buttons.save_and_exit'), - class: "btn btn-primary" %> - -
-
-
- <% end %> +
+
+
+
+ <%= t('warnings.unsaved_changes') %> + <%= f.submit t('buttons.save_and_exit'), + class: "btn btn-primary" %> +
-
\ No newline at end of file +
+<% end %> diff --git a/app/views/lectures/edit/_people.html.erb b/app/views/lectures/edit/_people.html.erb index c32de1a3b..eb8072a28 100644 --- a/app/views/lectures/edit/_people.html.erb +++ b/app/views/lectures/edit/_people.html.erb @@ -1,128 +1,101 @@ -
-
- -
-
-
- <% if current_user.can_update_personell?(lecture) %> - <%= form_with model: lecture, html: { id: 'lecture-form' } do |f| %> -
-
- <%= f.label :teacher_id, - t('basics.teacher'), - class: "form-label" %> - <%= helpdesk(t('admin.lecture.info.teacher'), false) %> -
- <%= f.select :teacher_id, - options_for_select([[lecture.teacher.info, - lecture.teacher.id]], - lecture.teacher.id), - {}, - { class: 'selectize', - data: { ajax: true, - model: 'user', - filled: false, - placeholder: - t('basics.enter_two_letters'), - no_results: - t('basics.no_results') } } %> -
-
-
-
-
- <%= t('basics.course_editors') %> - <%= helpdesk(t('admin.lecture.info.course_editors'), false) %> - <% if lecture.course.editors.present? %> -
    - <% lecture.course.editors.each do |e| %> -
  • - <%= e.name %> -
  • - <% end %> -
- <% else %> -
- <%= t('admin.lecture.no_course_editors') %> - <% end %> -
-
- <%= f.label :editor_ids, - t('basics.lecture_editors'), - class: "form-label" %> - <%= helpdesk(t('admin.lecture.info.lecture_editors'), false) %> -
- <%= f.select :editor_ids, - options_for_select([[t('none'), '']] + - lecture.select_editors, - lecture.editors.map(&:id)), - {}, - { multiple: true, - class: 'selectize', - data: { ajax: true, - model: 'user', - filled: false, - placeholder: t('basics.enter_two_letters'), - no_results: t('basics.no_results') } } %> -
-
-
-
-
- <%= t('basics.subscribers_count_nc') %> - - <%= lecture.users.count %> - - <%= helpdesk(t('admin.lecture.info.subscribers_count'), false) %> - <% if lecture.users.any? && !lecture.stale? %> - - <% end %> -
-
-
-
-
- <%= t('warnings.unsaved_changes') %> - <%= f.submit t('buttons.save'), - class: "btn btn-sm btn-primary" %> - -
-
-
- <% end %> +
+
+ <%= t('basics.course_editors') %> + <%= helpdesk(t('admin.lecture.info.course_editors'), false) %> + <% if lecture.course.editors.present? %> +
    + <% lecture.course.editors.each do |e| %> +
  • + <%= e.name %> +
  • + <% end %> +
<% else %> - <%= t('admin.lecture.no_access_to_users_html', - project_mail: mail_to(DefaultSetting::PROJECT_EMAIL, nil)) %> +
+ <%= t('admin.lecture.no_course_editors') %> + <% end %> +
+
+ <%= f.label :editor_ids, + t('basics.lecture_editors'), + class: "form-label" %> + <%= helpdesk(t('admin.lecture.info.lecture_editors'), false) %> +
+ <%= f.select :editor_ids, + options_for_select([[t('none'), '']] + + lecture.select_editors, + lecture.editors.map(&:id)), + {}, + { multiple: true, + class: 'selectize', + data: { ajax: true, + model: 'user', + filled: false, + placeholder: t('basics.enter_two_letters'), + no_results: t('basics.no_results') } } %> +
+
+
+
+
+ <%= t('basics.subscribers_count_nc') %> + + <%= lecture.users.count %> + + <%= helpdesk(t('admin.lecture.info.subscribers_count'), false) %> + <% if lecture.users.any? && !lecture.stale? %> + <% end %>
-
+
+
+
+ <%= t('warnings.unsaved_changes') %> + <%= f.submit t('buttons.save'), + class: "btn btn-sm btn-primary" %> + +
+
+
+ <% end %> +<% else %> + <%= t('admin.lecture.no_access_to_users_html', + project_mail: mail_to(DefaultSetting::PROJECT_EMAIL, nil)) %> +<% end %> diff --git a/app/views/lectures/edit/_preferences.html.erb b/app/views/lectures/edit/_preferences.html.erb index 9fb9adfcd..8a2b3c3da 100644 --- a/app/views/lectures/edit/_preferences.html.erb +++ b/app/views/lectures/edit/_preferences.html.erb @@ -1,177 +1,150 @@ -
-
- +
+ <% end %> + <% unless lecture.course.term_independent %> +
+ <%= f.label :sort, + t('basics.type'), + class: "form-label" %> + <%= f.select :sort, + options_for_select(Lecture.sort_localized.invert.to_a, + lecture.sort), + {}, + { class: 'form-select' } %> +
+
+
+ <% end %> + <% unless lecture.seminar? %> +
+ <%= f.label :start_chapter, t('admin.lecture.first_chapter'), + class: "form-label" %> + <%= helpdesk(t('admin.lecture.info.first_chapter'), false) %> + <%= f.number_field :start_chapter, + value: lecture.start_chapter || 1, + class: 'form-control' %> +
+
+
+ <%= f.label :start_section, + t('admin.lecture.first_section'), + class: "form-label" %> + <%= helpdesk(t('admin.lecture.info.first_section'), false) %> + <%= f.number_field :start_section, + value: lecture.start_section || 1, + class: 'form-control', + disabled: !lecture.absolute_numbering %> +
+
+
+
+ <%= f.check_box :absolute_numbering, + class: 'form-check-input' %> + <%= f.label :absolute_numbering, + t('admin.lecture.absolute_numbering'), + { class: 'form-check-label' } %> + <%= helpdesk(t('admin.lecture.info.absolute_numbering'), + false) %> +
+
+ <% end %> +
+
+
+ <%= f.label :passphrase, + t('admin.lecture.passphrase'), + class: "form-label" %> + <%= helpdesk(t('admin.lecture.info.passphrase'), false) %> + <%= f.text_field :passphrase, + { class: 'form-control', + size: 50 } %> +
+
+
+ <%= t('basics.language') %> +
+ <% I18n.available_locales.each do |locale| %> +
+ <%= f.radio_button :locale, + locale.to_s, + class: 'form-check-input' %> + <%= f.label :locale, + t('locales.' + locale.to_s), + value: locale.to_s, + class: 'form-check-label' %> +
+ <% end %> +
+
+ <% unless lecture.seminar? %> +
+ <%= t('admin.lecture.content_mode') %> + <%= helpdesk(t('admin.lecture.info.variants'), true) %> +
+
+ <%= f.radio_button :content_mode, + 'video', + class: 'form-check-input' %> + <%= f.label :content_mode, + t('admin.lecture.video_based'), + value: 'video', + class: 'form-check-label' %> +
+
+ <%= f.radio_button :content_mode, + 'manuscript', + class: 'form-check-input' %> + <%= f.label :content_mode, + t('admin.lecture.script_based'), + value: 'manuscript', + class: 'form-check-label' %> +
+
+
+ <% end %> + <% if !lecture.term %> +
+
+
+ <%= f.check_box :disable_teacher_display, + class: 'form-check-input' %> + <%= f.label :disable_teacher_display, + t('admin.lecture.disable_teacher_display'), + { class: 'form-check-label' } %> + <%= helpdesk(t('admin.lecture.info.disable_teacher_display'), + false) %> +
+
-
-
- <%= form_with model: lecture, - html: { id: 'lecture-preferences-form' } do |f| %> -
- <% unless lecture.course.term_independent %> -
- <%= f.label :term_id, - t('basics.term'), - class: "form-label" %> - <%= helpdesk(t('admin.lecture.info.term'), false) %> - <%= f.select :term_id, - options_for_select(@terms, - lecture.term&.id), - {}, - { class: 'form-select' } %> -
-
-
- <% end %> - <% unless lecture.course.term_independent %> -
- <%= f.label :sort, - t('basics.type'), - class: "form-label" %> - <%= f.select :sort, - options_for_select(Lecture.sort_localized.invert.to_a, - lecture.sort), - {}, - { class: 'form-select' } %> -
-
-
- <% end %> - <% unless lecture.seminar? %> -
- <%= f.label :start_chapter, t('admin.lecture.first_chapter'), - class: "form-label" %> - <%= helpdesk(t('admin.lecture.info.first_chapter'), false) %> - <%= f.number_field :start_chapter, - value: lecture.start_chapter || 1, - class: 'form-control' %> -
-
-
- <%= f.label :start_section, - t('admin.lecture.first_section'), - class: "form-label" %> - <%= helpdesk(t('admin.lecture.info.first_section'), false) %> - <%= f.number_field :start_section, - value: lecture.start_section || 1, - class: 'form-control', - disabled: !lecture.absolute_numbering %> -
-
-
-
- <%= f.check_box :absolute_numbering, - class: 'form-check-input' %> - <%= f.label :absolute_numbering, - t('admin.lecture.absolute_numbering'), - { class: 'form-check-label' } %> - <%= helpdesk(t('admin.lecture.info.absolute_numbering'), - false) %> -
-
- <% end %> -
-
-
- <%= f.label :passphrase, - t('admin.lecture.passphrase'), - class: "form-label" %> - <%= helpdesk(t('admin.lecture.info.passphrase'), false) %> - <%= f.text_field :passphrase, - { class: 'form-control', - size: 50 } %> -
-
-
- <%= t('basics.language') %> -
- <% I18n.available_locales.each do |locale| %> -
- <%= f.radio_button :locale, - locale.to_s, - class: 'form-check-input' %> - <%= f.label :locale, - t('locales.' + locale.to_s), - value: locale.to_s, - class: 'form-check-label' %> -
- <% end %> -
-
- <% unless lecture.seminar? %> -
- <%= t('admin.lecture.content_mode') %> - <%= helpdesk(t('admin.lecture.info.variants'), true) %> -
-
- <%= f.radio_button :content_mode, - 'video', - class: 'form-check-input' %> - <%= f.label :content_mode, - t('admin.lecture.video_based'), - value: 'video', - class: 'form-check-label' %> -
-
- <%= f.radio_button :content_mode, - 'manuscript', - class: 'form-check-input' %> - <%= f.label :content_mode, - t('admin.lecture.script_based'), - value: 'manuscript', - class: 'form-check-label' %> -
-
-
- <% end %> - <% if !lecture.term %> -
-
-
- <%= f.check_box :disable_teacher_display, - class: 'form-check-input' %> - <%= f.label :disable_teacher_display, - t('admin.lecture.disable_teacher_display'), - { class: 'form-check-label' } %> - <%= helpdesk(t('admin.lecture.info.disable_teacher_display'), - false) %> -
-
-
- <% end %> -
-
-
- <%= t('warnings.unsaved_changes') %> - <%= f.submit t('buttons.save_and_exit'), - class: "btn btn-primary" %> - -
-
-
- <% end %> + <% end %> +
+
+
+ <%= t('warnings.unsaved_changes') %> + <%= f.submit t('buttons.save_and_exit'), + class: "btn btn-primary" %> +
+<% end %> diff --git a/app/views/lectures/edit/_tags.html.erb b/app/views/lectures/edit/_tags.html.erb index 391797b3c..48257b2dd 100644 --- a/app/views/lectures/edit/_tags.html.erb +++ b/app/views/lectures/edit/_tags.html.erb @@ -1,65 +1,37 @@ -
-
- -
-
-
-
    -
  • -
    - <%= t('admin.lecture.course_tags_html', - course: course_link_or_text(lecture.course, current_user), - count: @course_tags.size) %> - <%= helpdesk(t('admin.lecture.info.course_tags'), false) %> -
    - <% if @course_tags %> - <%= render partial: "tags/tag", - collection: @course_tags.natural_sort_by(&:title), - cached: true %> - <% else %> - <%= t('admin.lecture.no_course_tags') %> - <% end %> -
  • -
  • -
    - <%= t('admin.lecture.additional_tags', - count: @extra_tags.size) %> - <%= helpdesk(t('admin.lecture.info.additional_tags'), false) %> -
    - <%= render partial: "tags/tag", - collection: @extra_tags.natural_sort_by(&:title), - cached: true %> -
  • -
  • -
    - <%= t('admin.lecture.untreated_tags', - count: @deferred_tags.size) %> - <%= helpdesk(t('admin.lecture.info.untreated_tags'), false) %> -
    - <%= render partial: "tags/tag", - collection: @deferred_tags.natural_sort_by(&:title), - cached: true %> -
  • -
-
-
-
+
    +
  • +
    + <%= t('admin.lecture.course_tags_html', + course: course_link_or_text(lecture.course, current_user), + count: @course_tags.size) %> + <%= helpdesk(t('admin.lecture.info.course_tags'), false) %> +
    + <% if @course_tags %> + <%= render partial: "tags/tag", + collection: @course_tags.natural_sort_by(&:title), + cached: true %> + <% else %> + <%= t('admin.lecture.no_course_tags') %> + <% end %> +
  • +
  • +
    + <%= t('admin.lecture.additional_tags', + count: @extra_tags.size) %> + <%= helpdesk(t('admin.lecture.info.additional_tags'), false) %> +
    + <%= render partial: "tags/tag", + collection: @extra_tags.natural_sort_by(&:title), + cached: true %> +
  • +
  • +
    + <%= t('admin.lecture.untreated_tags', + count: @deferred_tags.size) %> + <%= helpdesk(t('admin.lecture.info.untreated_tags'), false) %> +
    + <%= render partial: "tags/tag", + collection: @deferred_tags.natural_sort_by(&:title), + cached: true %> +
  • +
diff --git a/app/views/lectures/edit/_tutorials.html.erb b/app/views/lectures/edit/_tutorials.html.erb index 8152e34eb..46d207fdf 100644 --- a/app/views/lectures/edit/_tutorials.html.erb +++ b/app/views/lectures/edit/_tutorials.html.erb @@ -1,69 +1,42 @@ -
-
- -
-
-
- <% if current_user.can_update_personell?(lecture) %> -
-
- <%= link_to t('admin.tutorial.new'), - new_tutorial_path(params: { lecture_id: lecture.id }), - class: 'btn btn-sm btn-primary', - id: 'newTutorialButton', - remote: true %> -
+
+
+ <%= t('basics.tutors') %> +
-
-
-
-
-
- <%= t('basics.title') %> -
-
-
-
- <%= t('basics.tutors') %> -
-
-
-
- <%= t('basics.action') %> - <%= helpdesk(t('tutorial.destruction_info'), true) %> -
-
-
-
- <% lecture.tutorials.each do |t| %> - <%= render partial: 'tutorials/row', - locals: { tutorial: t } %> - <% end %> +
+
+ <%= t('basics.action') %> + <%= helpdesk(t('tutorial.destruction_info'), true) %> +
- <% else %> - <%= t('admin.lecture.no_access_to_users_html', - project_mail: mail_to(DefaultSetting::PROJECT_EMAIL, nil)) %> - <% end %> +
+ <% lecture.tutorials.each do |t| %> + <%= render partial: 'tutorials/row', + locals: { tutorial: t } %> + <% end %>
-
\ No newline at end of file +<% else %> + <%= t('admin.lecture.no_access_to_users_html', + project_mail: mail_to(DefaultSetting::PROJECT_EMAIL, nil)) %> +<% end %>