<% if user.edited_courses.any? || user.edited_lectures.any? || - user.given_lectures.any? %> + user.given_lectures.any? || user.edited_media.any? %> <%= render partial: 'users/content', locals: { user: user, f: f } %> diff --git a/config/routes.rb b/config/routes.rb index 964976b33..a19b72ba5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -859,7 +859,7 @@ authenticated :user do root to: 'main#start' end - + unauthenticated do root to: 'devise/sessions#new', as: :unauthenticated_root end @@ -873,8 +873,6 @@ get 'error', to: 'main#error' - get 'main/home' - get 'main/news', to: 'main#news', as: 'news' From ecd878f11eeb2c4ad6d203105d9ca2c3ea1fc406 Mon Sep 17 00:00:00 2001 From: Splines <37160523+Splines@users.noreply.github.com> Date: Fri, 21 Apr 2023 14:57:15 +0200 Subject: [PATCH 3/6] Fix card body flex css (#468) --- app/assets/stylesheets/sidebar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/sidebar.scss b/app/assets/stylesheets/sidebar.scss index 9b9ccc91c..11bc53eaf 100644 --- a/app/assets/stylesheets/sidebar.scss +++ b/app/assets/stylesheets/sidebar.scss @@ -33,7 +33,7 @@ } } -li { +.sidebar-item li { display: flex; align-items: center; From e75f748ec826edc2ece6bc48b876361e7c5ba258 Mon Sep 17 00:00:00 2001 From: Splines <37160523+Splines@users.noreply.github.com> Date: Fri, 21 Apr 2023 23:12:22 +0200 Subject: [PATCH 4/6] Avoid confusion with "Request data" button (#470) * Left-align data request button * Add back to home button to profile view --- app/views/profile/_data.html.erb | 4 ++-- app/views/profile/edit.html.erb | 7 +++++++ config/locales/de.yml | 1 + config/locales/en.yml | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/profile/_data.html.erb b/app/views/profile/_data.html.erb index 29893fff6..e898e74f0 100644 --- a/app/views/profile/_data.html.erb +++ b/app/views/profile/_data.html.erb @@ -1,7 +1,7 @@ -
+
<%= t('profile.data_explanation') %>
-
+
<%= link_to t('profile.data_request'), request_data_path, class: 'btn btn-sm btn-primary', diff --git a/app/views/profile/edit.html.erb b/app/views/profile/edit.html.erb index d37a961d0..50efaff34 100644 --- a/app/views/profile/edit.html.erb +++ b/app/views/profile/edit.html.erb @@ -137,3 +137,10 @@ <%= render partial: 'shared/generic_modal', locals: { sort: 'deleteAccount', title: t('profile.delete_account') } %> + +
+ <%= link_to :root, class: "btn btn-sm btn-primary" do %> + + <%= t('back_to_home') %> + <% end %> +
\ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index 9f6959fd4..bddf9a740 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -2103,6 +2103,7 @@ de: details: 'Details' none: 'keine' back: 'Zurück' + back_to_home: 'Zurück zur Startseite' today: 'heute' yesterday: 'gestern' chapter: 'Kapitel %{number}. %{title}' diff --git a/config/locales/en.yml b/config/locales/en.yml index b514032d5..7f11b8c01 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1977,6 +1977,7 @@ en: details: 'Details' none: 'none' back: 'Back' + back_to_home: 'Back to home' today: 'today' yesterday: 'yesterday' chapter: 'Chapter %{number}. %{title}' From 03b6c003add13eb0923302cf76b806609c056cb7 Mon Sep 17 00:00:00 2001 From: Splines <37160523+Splines@users.noreply.github.com> Date: Fri, 21 Apr 2023 23:12:56 +0200 Subject: [PATCH 5/6] Use a modal to show sponsors (#465) * Use a modal to show sponsors * Redirect old sponsors route * Remove "#sponsors" slug when closing modal * Remove sponsors_html language key * Wait for turbolink load * Move onclick event to js file * Remove whitespaces around link * Get rid of old sponsors route * Don't use browser history for modal --- app/assets/javascripts/footer_modal.js | 5 ++ app/views/main/_sponsors.html.erb | 111 +++++++++++++++++++++++++ app/views/main/sponsors.html.erb | 107 ------------------------ app/views/shared/_footer.html.erb | 18 +++- config/locales/de.yml | 2 - config/locales/en.yml | 2 - config/routes.rb | 4 - 7 files changed, 131 insertions(+), 118 deletions(-) create mode 100644 app/assets/javascripts/footer_modal.js create mode 100644 app/views/main/_sponsors.html.erb delete mode 100644 app/views/main/sponsors.html.erb diff --git a/app/assets/javascripts/footer_modal.js b/app/assets/javascripts/footer_modal.js new file mode 100644 index 000000000..28d02804f --- /dev/null +++ b/app/assets/javascripts/footer_modal.js @@ -0,0 +1,5 @@ +document.addEventListener("turbolinks:load", () => { + if (window.location.hash == "#sponsors") { + $('#sponsors').modal('show'); + } +}); diff --git a/app/views/main/_sponsors.html.erb b/app/views/main/_sponsors.html.erb new file mode 100644 index 000000000..298612e94 --- /dev/null +++ b/app/views/main/_sponsors.html.erb @@ -0,0 +1,111 @@ +

+ <%= t('sponsors.sponsorships') %> +

+
+ <%= t('sponsors.uni_hd') %> +
+
    +
  • + + 2022-2023: + + <%= t('sponsors.heiquality_html', + hendrik: link_to('Hendrik Kasten', + 'https://www.mathi.uni-heidelberg.de/~kasten/', + target: :_blank), + denis: link_to('Denis Vogel', + 'https://www.mathi.uni-heidelberg.de/~vogel/', + target: :_blank)) %> +
  • +
  • + + 2019-2020: + + <%= t('sponsors.heistart_html', + hendrik: link_to('Hendrik Kasten', + 'https://www.mathi.uni-heidelberg.de/~kasten/', + target: :_blank), + oli: link_to('Oliver Thomas', + 'https://www.mathi.uni-heidelberg.de/~othomas/', + target: :_blank), + denis: link_to('Denis Vogel', + 'https://www.mathi.uni-heidelberg.de/~vogel/', + target: :_blank), + fs_mathphysinfo: link_to('Fachschaft MathPhysInfo', + 'https://mathphys.fsk.uni-heidelberg.de/w/', + target: :_blank)) %> +
  • +
  • + + 2018: + + <%= t('sponsors.physics_html', + physics_faculty: link_to('Fakultät für Physik und Astronomie', + 'https://www.physik.uni-heidelberg.de/', + target: :_blank)) %> +
  • +
  • + + <%= t('basics.since') %> 2017: + + <%= t('sponsors.math_html', + math_faculty: link_to('Fakultät für Mathematik und Informatik', + 'https://mathinf.uni-heidelberg.de/', + target: :_blank)) %> +
  • +
+
+ <%= t('sponsors.hse') %> +
+
    +
  • + + 2019: + + <%= t('sponsors.go_digital_html', + digital_now: link_to('HSE: Go digital! Now!', + 'https://hse-heidelberg.de/ueber-uns/hse-go-digital-now', + target: :_blank)) %> +
  • +
  • + + 2018-2019: + + <%= t('sponsors.fellowship_html', + place: link_to('PLACE', + 'https://www.hse-heidelberg.de/ueber-uns/place', + target: :_blank), + hendrik: link_to('Hendrik Kasten', + 'https://www.mathi.uni-heidelberg.de/~kasten/', + target: :_blank), + fellowship_project: link_to('"Geometrie und Unterricht - Ausgestaltung eines + profillinienübergreifenden Verschränkungsmoduls im + Fach Mathematik"', + 'https://hse-heidelberg.de/forschung/forschungsprojekte/geometrie-und-unterricht-ausgestaltung-eines', + target: :_blank)) %> +
  • +
  • + + 2018: + + <%= t('sponsors.zurlamitmu_html', + place: link_to('PLACE', + 'https://www.hse-heidelberg.de/ueber-uns/place', + target: :_blank), + markus: link_to('Markus Vogel', + 'https://www.ph-heidelberg.de/vogel-markus.html', + target: :_blank), + denis: link_to('Denis Vogel', + 'https://www.mathi.uni-heidelberg.de/~vogel/', + target: :_blank), + zurlamitmu_project: link_to('"ZurLAmitMU"', + 'https://hse-heidelberg.de/forschung/forschungsprojekte/zurlamitmu-zugaenge-zur-linearen-algebra-mit-multimedia-erleichtern', + target: :_blank)) %> +
  • +
+ + \ No newline at end of file diff --git a/app/views/main/sponsors.html.erb b/app/views/main/sponsors.html.erb deleted file mode 100644 index 6302bba28..000000000 --- a/app/views/main/sponsors.html.erb +++ /dev/null @@ -1,107 +0,0 @@ -
-

- <%= t('sponsors.sponsorships') %> -

-
- <%= t('sponsors.uni_hd') %> -
-
    -
  • - - 2022-2023: - - <%= t('sponsors.heiquality_html', - hendrik: link_to('Hendrik Kasten', - 'https://www.mathi.uni-heidelberg.de/~kasten/', - target: :_blank), - denis: link_to('Denis Vogel', - 'https://www.mathi.uni-heidelberg.de/~vogel/', - target: :_blank)) %> -
  • -
  • - - 2019-2020: - - <%= t('sponsors.heistart_html', - hendrik: link_to('Hendrik Kasten', - 'https://www.mathi.uni-heidelberg.de/~kasten/', - target: :_blank), - oli: link_to('Oliver Thomas', - 'https://www.mathi.uni-heidelberg.de/~othomas/', - target: :_blank), - denis: link_to('Denis Vogel', - 'https://www.mathi.uni-heidelberg.de/~vogel/', - target: :_blank), - fs_mathphysinfo: link_to('Fachschaft MathPhysInfo', - 'https://mathphys.fsk.uni-heidelberg.de/w/', - target: :_blank)) %> -
  • -
  • - - 2018: - - <%= t('sponsors.physics_html', - physics_faculty: link_to('Fakultät für Physik und Astronomie', - 'https://www.physik.uni-heidelberg.de/', - target: :_blank)) %> -
  • -
  • - - <%= t('basics.since') %> 2017: - - <%= t('sponsors.math_html', - math_faculty: link_to('Fakultät für Mathematik und Informatik', - 'https://mathinf.uni-heidelberg.de/', - target: :_blank)) %> -
  • -
-
- <%= t('sponsors.hse') %> -
-
    -
  • - - 2019: - - <%= t('sponsors.go_digital_html', - digital_now: link_to('HSE: Go digital! Now!', - 'https://hse-heidelberg.de/ueber-uns/hse-go-digital-now', - target: :_blank)) %> -
  • -
  • - - 2018-2019: - - <%= t('sponsors.fellowship_html', - place: link_to('PLACE', - 'https://www.hse-heidelberg.de/ueber-uns/place', - target: :_blank), - hendrik: link_to('Hendrik Kasten', - 'https://www.mathi.uni-heidelberg.de/~kasten/', - target: :_blank), - fellowship_project: link_to('"Geometrie und Unterricht - Ausgestaltung eines - profillinienübergreifenden Verschränkungsmoduls im - Fach Mathematik"', - 'https://hse-heidelberg.de/forschung/forschungsprojekte/geometrie-und-unterricht-ausgestaltung-eines', - target: :_blank)) %> -
  • -
  • - - 2018: - - <%= t('sponsors.zurlamitmu_html', - place: link_to('PLACE', - 'https://www.hse-heidelberg.de/ueber-uns/place', - target: :_blank), - markus: link_to('Markus Vogel', - 'https://www.ph-heidelberg.de/vogel-markus.html', - target: :_blank), - denis: link_to('Denis Vogel', - 'https://www.mathi.uni-heidelberg.de/~vogel/', - target: :_blank), - zurlamitmu_project: link_to('"ZurLAmitMU"', - 'https://hse-heidelberg.de/forschung/forschungsprojekte/zurlamitmu-zugaenge-zur-linearen-algebra-mit-multimedia-erleichtern', - target: :_blank)) %> -
  • -
-
\ No newline at end of file diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index c0666d56f..ed42a2b91 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -1,4 +1,17 @@ +<%= javascript_include_tag :footer_modal %> + <% I18n.with_locale(current_user.try(:locale)) do %> + +<%# Sponsors modal %> + + +<%# Footbar %>
@@ -39,9 +52,8 @@ target: :_blank)) %>
- <%= t('footer.sponsors_html', - sponsors: link_to(t('basics.sponsors'), - sponsors_path)) %> + <%= t('basics.sponsors') %> - %{sponsors}: sponsors: sponsorships: 'Projektförderungen' hse: 'Heidelberg School of Education (HSE)' diff --git a/config/locales/en.yml b/config/locales/en.yml index 7f11b8c01..00f6d4ada 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -107,8 +107,6 @@ en: Bugs can be reported %{bugs}. We encourage you to send further feedback to %{feedback}. Background image by %{background_photo_credit}. - sponsors_html: > - %{sponsors}: sponsors: sponsorships: 'Projekt funding' hse: 'Heidelberg School of Education (HSE)' diff --git a/config/routes.rb b/config/routes.rb index a19b72ba5..3b871df55 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -881,10 +881,6 @@ to: 'main#comments', as: 'comments' - get 'main/sponsors', - to: 'main#sponsors', - as: 'sponsors' - get 'main/start', to: 'main#start', as: 'start' From 77ccd6250cec735e7fbc67a6627f7e379f4eaab9 Mon Sep 17 00:00:00 2001 From: Splines <37160523+Splines@users.noreply.github.com> Date: Sun, 23 Apr 2023 02:48:03 +0200 Subject: [PATCH 6/6] Always show module sidebar link (#471) * Always show module sidebar link (do not disable) * Fix closing list item --- app/views/shared/_sidebar.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/shared/_sidebar.html.erb b/app/views/shared/_sidebar.html.erb index 5da00361f..3b2b0bfdf 100644 --- a/app/views/shared/_sidebar.html.erb +++ b/app/views/shared/_sidebar.html.erb @@ -203,8 +203,7 @@ <%# Modul %> <% path = display_course_path(lecture) %> <% active_class = get_class_for_path(path) %> -