Compare commits

...

8 commits

Author SHA1 Message Date
Víðir Valberg Guðmundsson ad6564b510 WIP. 2024-04-20 10:32:56 +02:00
Víðir Valberg Guðmundsson f351e8735c Merge branch 'main' into services 2024-03-03 18:02:55 +01:00
Víðir Valberg Guðmundsson 712c50fac7 Use hatch for installing.
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-03 11:05:21 +01:00
Víðir Valberg Guðmundsson 9a884c782c WIP. 2024-03-03 11:04:41 +01:00
Halfdan Mouritzen fedfca25a5 Adding flow to add new emails to an account
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-02 17:43:16 +01:00
Halfdan Mouritzen 89d7c9c9d5 CSS should be merged correctly now
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-02 14:49:50 +01:00
Halfdan Mouritzen f5acfbedd4 Cleaning 2024-03-02 12:15:33 +01:00
Halfdan Mouritzen 02907a7684 Minimal CSS for tables
Some checks failed
continuous-integration/drone/pr Build is failing
2024-01-13 22:14:23 +01:00
8 changed files with 104 additions and 147 deletions

View file

@ -5,3 +5,5 @@
!src/
!requirements/
!entrypoint.sh
!pyproject.toml
!README.md

View file

@ -11,7 +11,13 @@ ARG DJANGO_ENV
ARG BUILD
ENV BUILD ${BUILD}
RUN apt-get update \
WORKDIR /app
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www
COPY --chown=www:www . .
RUN mkdir /app/src/static \
&& chown www:www /app/src/static \
&& apt-get update \
&& apt-get install -y \
binutils \
libpq-dev \
@ -23,15 +29,9 @@ RUN apt-get update \
libgdk-pixbuf2.0-0 \
libffi-dev \
shared-mime-info \
gettext
WORKDIR /app
RUN groupadd -g 1000 www && useradd -u 1000 -ms /bin/bash -g www www
COPY --chown=www:www . /app/
RUN mkdir /app/src/static && chown www:www /app/src/static
RUN pip install -r requirements/$([ "$DJANGO_ENV" = "production" ] && echo "base.txt" || echo "dev.txt") &&\
django-admin compilemessages
gettext \
&& pip install . \
&& django-admin compilemessages
ENTRYPOINT ["./entrypoint.sh"]

View file

@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
@ -22,11 +22,12 @@ dependencies = [
"django-zen-queries==2.1.0",
"django-registries==0.0.3",
"django-view-decorator==0.0.4",
"django-oauth-toolkit==2.3.0",
]
dynamic = ["version"]
version = "0.0.1"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["src"]
[tool.hatch.envs.default]
dependencies = [
@ -59,7 +60,7 @@ cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src --
no-cov = "cov --no-cov {args}"
typecheck = "mypy --config-file=pyproject.toml ."
requirements = "pip-compile --output-file requirements/base.txt pyproject.toml"
server = "./src/manage.py runserver"
server = "./src/manage.py runserver 0.0.0.0:8000"
migrate = "./src/manage.py migrate"
makemigrations = "./src/manage.py makemigrations"
createsuperuser = "./src/manage.py createsuperuser"

View file

@ -42,6 +42,7 @@ THIRD_PARTY_APPS = [
"allauth.account",
"django_view_decorator",
"django_registries",
"oauth2_provider",
]
LOCAL_APPS = [
@ -156,6 +157,16 @@ ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = False
ACCOUNT_USERNAME_REQUIRED = False
# OAuth2 configuration
OAUTH2_PROVIDER = {
"OIDC_ENABLED": True,
"SCOPES": {
"openid": "OpenID Connect scope",
"profile": "Profile Information",
},
"PKCE_REQUIRED": False, # this can be a callable - https://github.com/jazzband/django-oauth-toolkit/issues/711#issuecomment-497073038
}
# Logging
# We want to log everything to stdout in docker
LOGGING = {

View file

@ -54,3 +54,14 @@ html.dark article table tbody tr:nth-child(2n+1) td {
html.dark article table tbody tr:last-child td {
border-bottom: var(--half-space) solid var(--twilight);
}
html.dark form>div>input[type="text"],
html.dark form>div>input[type="password"],
html.dark input[type="email"] {
border: 2px solid var(--twilight);
border-radius: 6px;
padding: 8px;
background: var(--dark-dark);
width: 100%;
color: var(--light-dust);
}

View file

@ -94,7 +94,7 @@ h6 {
}
a {
<<<<<<< HEAD font-weight: 500;
font-weight: 500;
color: var(--splash);
text-decoration: none;
cursor: pointer;
@ -105,10 +105,6 @@ hr {
height: 0;
border: 0;
border-bottom: 1px solid var(--dark-custard);
=======font-weight: 500;
color: var(--splash);
text-decoration: none;
>>>>>>>bdc2d8717cbcab1795b1b2dc4f08f83242e4a4ca
}
body {
@ -248,7 +244,7 @@ article {
padding: var(--double-space) var(--outer-space);
}
article>div.content-view {
article div.content-view {
background: var(--dust);
padding: var(--double-space);
margin-bottom: var(--space);
@ -267,12 +263,7 @@ div.services {
div.services>div,
div.infobox {
<<<<<<< HEAD background: var(--light);
padding: var(--double-space);
border-radius: 6px;
flex: 240px;
max-width: 420px;
=======background: var(--light);
background: var(--light);
padding: var(--double-space);
border-radius: 6px;
flex: 240px;
@ -294,111 +285,6 @@ div.services>div>div.description>p {
margin-top: var(--half-space);
}
div.services>div>a,
a.button,
button {
display: block;
color: var(--light);
background: var(--splash);
padding: var(--space) var(--double-space);
border-radius: 3px;
opacity: 0.9;
cursor: pointer;
text-align: center;
border: 0;
font-weight: 600;
letter-spacing: 0.03em;
text-decoration: none;
}
div.services>div>a:hover,
a.button:hover,
button:hover {
opacity: 1.0;
}
article table {
width: 100%;
border-spacing: 0;
margin: var(--space) 0;
}
article table thead th {
text-align: left;
}
article table tbody tr:nth-child(odd) {
background: var(--medium-dust);
}
article table thead th,
article table tbody td {
padding: var(--half-space);
}
form>div {
margin: 0 0 var(--double-space);
}
form>div>label {
display: block;
margin: 0 0 6px;
}
form>div>input[type="text"],
form>div>input[type="password"] {
border: 2px solid var(--twilight);
border-radius: 6px;
padding: 8px;
background: var(--light-dust);
width: 100%;
}
#login {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
#loginbox {
border-radius: var(--space);
border: 6px solid white;
width: 800px;
height: 500px;
display: flex;
flex-flow: row;
}
#loginbox>div {
padding: var(--double-space);
flex: 1;
}
#loginbox label {
color: var(--twilight);
}
#loginbox>div.login {
background: var(--light-dust);
>>>>>>>bdc2d8717cbcab1795b1b2dc4f08f83242e4a4ca display: flex;
flex-flow: column;
justify-content: space-between;
}
div.infobox button {
margin-top: var(--double-space);
}
div.services>div>div.description {
margin-bottom: var(--double-space);
}
div.services>div>div.description>p {
margin-top: var(--half-space);
}
div.services>div>a,
a.button,
button {
@ -434,6 +320,10 @@ button:disabled {
cursor: default;
}
button.secondary {
background: var(--twilight);
}
article table {
width: 100%;
border-spacing: 0;
@ -514,6 +404,28 @@ form div.buttonHolder button {
display: inline-block;
}
#email-add-overlay {
display: none;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.8);
align-items: center;
justify-content: center;
z-index: 1000;
}
#email-add-overlay .content-view {
width: 600px;
padding: var(--double-space);
}
#email-add-overlay .content-view p {
margin: var(--double-space) 0;
}
#login {
height: 100%;
display: flex;

View file

@ -16,7 +16,7 @@
{% csrf_token %}
<fieldset class="blockLabels">
<div class="buttonHolder">
<button class="small" name="action_add" style="float:right">Add Email …</button>
<button class="small" name="action_add_open" style="float:right">Add Email …</button>
<button class="small" disabled type="submit" id="action_primary" name="action_primary">Make Primary</button>
<button class="small" type="submit" name="action_send">Re-send Verification</button>
<button class="small" type="submit" name="action_remove">Remove</button>
@ -76,21 +76,22 @@
{% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
</p>
{% endif %}
<!--
<hr />
<h3>{% trans "Add E-mail" %}</h3>
<div class="panel-body">
<form method="post" action="{% url 'account_email' %}"
class="add_email">
{% csrf_token %}
{{ form.as_p }}
<button name="action_add" class="btn btn-success" type="submit">
{% trans "Add E-mail" %}
</button>
</form>
</div>
<div id="email-add-overlay">
<div class="content-view">
<h3>{% trans "Add E-mail" %}</h3>
<div class="panel-body">
<form method="post" action="{% url 'account_email' %}"
class="add_email">
{% csrf_token %}
{{ form.as_p }}
<button name="action_add" style="float:right" type="submit">
{% trans "Add E-mail" %}
</button>
<button id="overlay-close-button" class="secondary">Cancel</button>
</form>
</div>
</div>
-->
</div>
<script type="text/javascript">
@ -105,6 +106,24 @@
});
}
let addEmail = document.getElementsByName('action_add_open')[0];
addEmail.addEventListener('click', function(e) {
e.preventDefault();
let overlay = document.getElementById('email-add-overlay')
overlay.style.display = 'flex'
window.addEventListener('keydown', function(e) {
if (e.key == 'Escape') {
overlay.style.display = 'none'
}
})
document.getElementById('overlay-close-button').addEventListener('click', function() {
overlay.style.display = 'none'
})
})
let radio_actions = document.getElementsByName('email');
if (radio_actions.length) {
for (radio of radio_actions) {

View file

@ -7,6 +7,7 @@ from django_view_decorator import include_view_urls
urlpatterns = [
path("", include_view_urls(extra_modules=["project.views"])),
path("o/", include("oauth2_provider.urls", namespace="oauth2_provider")),
path("accounts/", include("allauth.urls")),
path("_admin/", admin.site.urls),
]