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

Make popup qr codes for external links #541

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions stregsystem/static/stregsystem/external_link_qrs/code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions stregsystem/static/stregsystem/external_link_qrs/tos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 39 additions & 8 deletions stregsystem/static/stregsystem/stregsystem.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,47 @@ ol span {
font-weight: normal;
}

button.linkalike {
background: none;
border: none;
button {
cursor: pointer;
font: inherit;
text-decoration: underline;
color: LinkText;

&:active{
color: ActiveText;
&.linkalike {
background: none;
border: none;
cursor: pointer;
font: inherit;
text-decoration: underline;
color: LinkText;

&:active{
color: ActiveText;
}
}
}

.external-link-popover {
font-size: 1.5em;
padding: 1em;

& p {
margin: 0;
}
& button {
position: absolute;
top: 0;
right: 0;
padding: .1em;
background: none;
border: none;

& svg {
width: 2.2em;
height: 2.2em;
}
}
& img {
width: 100vw;
max-width: 40vmin;
max-height: 40vmin;
}
}

Expand Down
4 changes: 2 additions & 2 deletions stregsystem/templates/stregsystem/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ <h1>
</div>
<ul id="footer-notes">
<li>Skabt med ☕ og 🖤 af Fklubben</li>
<li><a target="_blank" href="https://fklub.dk/tos">Terms of Service</a></li>
<li><a target="_blank" href="https://github.com/f-klubben/stregsystemet">Se koden</a></li>
<li>{% include "./external_link.html" with id="tos" href="https://fklub.dk/tos" text="Terms of Service" %}</li>
<li>{% include "./external_link.html" with id="code" href="https://github.com/f-klubben/stregsystemet" text="Se koden" %}</li>
</ul>
</footer>
{% theme_content %}
Expand Down
13 changes: 13 additions & 0 deletions stregsystem/templates/stregsystem/cross.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1"
viewBox="0 -960 960 960"
width="24"
height="24"
>
<title>{{ title }}</title>
<path
fill="currentcolor"
d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"
/>
</svg>
11 changes: 11 additions & 0 deletions stregsystem/templates/stregsystem/external_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% load static %}

<button class="external-link" popovertarget="external-link-popover-{{ id }}">
{{ text }}
</button>
<div popover id="external-link-popover-{{ id }}" class="external-link-popover">
<p>{{ text }}</p>
<button autofocus popovertarget="external-link-popover-{{ id }}">{% include "./cross.html" with title="Luk" %}</button>
<img alt="" src="{% static "/stregsystem/external_link_qrs/" %}{{ id }}.svg"/>
<p>{{ href }}</p>
</div>
Loading