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

Use a modal to show sponsors #465

Merged
merged 9 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
9 changes: 9 additions & 0 deletions app/assets/javascripts/footer_modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$(document).ready(() => {
Splines marked this conversation as resolved.
Show resolved Hide resolved
if (window.location.hash == "#sponsors") {
$('#sponsors').modal('show');
}

$('#sponsors').on('hide.bs.modal', () => {
window.history.pushState(null, null, location.pathname);
});
});
111 changes: 111 additions & 0 deletions app/views/main/_sponsors.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<h3 class="mb-4">
<%= t('sponsors.sponsorships') %>
</h3>
<h5>
<%= t('sponsors.uni_hd') %>
</h5>
<ul>
<li class="d-block">
<strong>
2022-2023:
</strong>
<%= 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)) %>
</li>
<li class="d-block">
<strong>
2019-2020:
</strong>
<%= 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)) %>
</li>
<li class="d-block">
<strong>
2018:
</strong>
<%= t('sponsors.physics_html',
physics_faculty: link_to('Fakultät für Physik und Astronomie',
'https://www.physik.uni-heidelberg.de/',
target: :_blank)) %>
</li>
<li class="d-block">
<strong>
<%= t('basics.since') %> 2017:
</strong>
<%= t('sponsors.math_html',
math_faculty: link_to('Fakultät für Mathematik und Informatik',
'https://mathinf.uni-heidelberg.de/',
target: :_blank)) %>
</li>
</ul>
<h5>
<%= t('sponsors.hse') %>
</h5>
<ul>
<li class="d-block">
<strong>
2019:
</strong>
<%= 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)) %>
</li>
<li class="d-block">
<strong>
2018-2019:
</strong>
<%= 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)) %>
</li>
<li class="d-block">
<strong>
2018:
</strong>
<%= 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)) %>
</li>
</ul>

<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;
</span>
</button>
107 changes: 0 additions & 107 deletions app/views/main/sponsors.html.erb

This file was deleted.

20 changes: 17 additions & 3 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<%= javascript_include_tag :footer_modal %>

<% I18n.with_locale(current_user.try(:locale)) do %>

<%# Sponsors modal %>
<div id="sponsors" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="Sponsors list modal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content p-4">
<%= render partial: 'main/sponsors' %>
</div>
</div>
</div>

<%# Footbar %>
<div class="container-fluid bg-grey-lighten-6 p-3">
<div class="row">
<div class="col text-md-left">
Expand Down Expand Up @@ -39,9 +52,10 @@
target: :_blank)) %>
</div>
<div class="col text-md-right">
<%= t('footer.sponsors_html',
sponsors: link_to(t('basics.sponsors'),
sponsors_path)) %>
<a href="#sponsors" data-toggle="modal" data-target="#sponsors"
onclick="window.history.pushState(null, null, '#sponsors');">
<%= t('basics.sponsors') %>
Splines marked this conversation as resolved.
Show resolved Hide resolved
</a>
<span style="margin-left: 20px;"></span>
<a href="https://hse-heidelberg.de/"
target="_blank"
Expand Down
2 changes: 0 additions & 2 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ de:
Bugs meldest Du am besten %{bugs}.
Weiteres Feedback kannst Du gerne auch an %{feedback} schicken.
Hintergrundbild von %{background_photo_credit}.
sponsors_html: >
%{sponsors}:
sponsors:
sponsorships: 'Projektförderungen'
hse: 'Heidelberg School of Education (HSE)'
Expand Down
2 changes: 0 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@
as: 'comments'

get 'main/sponsors',
to: 'main#sponsors',
to: redirect('#sponsors'),
as: 'sponsors'
Splines marked this conversation as resolved.
Show resolved Hide resolved

get 'main/start',
Expand Down