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

Merge main to dev #36

Merged
merged 14 commits into from
Mar 22, 2024
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.2.0"
current_version = "0.4.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
Expand Down
20 changes: 0 additions & 20 deletions .devcontainer/bashrc.override.sh

This file was deleted.

41 changes: 0 additions & 41 deletions .devcontainer/devcontainer.json

This file was deleted.

36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ jobs:
uses: pre-commit/[email protected]

# With no caching at all the entire ci process takes 4m 30s to complete!
pytest:
runs-on: ubuntu-latest

steps:
- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Build the Stack
run: docker compose -f local.yml build

- name: Run DB Migrations
run: docker compose -f local.yml run --rm django python manage.py migrate

- name: Run Django Tests
run: docker compose -f local.yml run django pytest

- name: Tear down the Stack
run: docker compose -f local.yml down
# pytest:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Code Repository
# uses: actions/checkout@v3
#
# - name: Build the Stack
# run: docker compose -f local.yml build
#
# - name: Run DB Migrations
# run: docker compose -f local.yml run --rm django python manage.py migrate
#
# - name: Run Django Tests
# run: docker compose -f local.yml run django pytest
#
# - name: Tear down the Stack
# run: docker compose -f local.yml down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repos:
- id: flake8

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.32.1
rev: v1.34.1
hooks:
- id: djlint-reformat-django
- id: djlint-django
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project tries to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0] - 2024-03-22
### Changed
- integrate structure and collection selection from django_energysystem_viewer in version v0.5.0

## [0.3.3] - 2024-03-06
### Changed
- update django_energysystem_viewer to v0.4.2

## [0.3.2] - 2024-03-06
### Changed
- update django_energysystem_viewer to v0.4.1

## [0.3.1] - 2024-03-06
### Changed
- remove pytest from CI

## [0.3.0] - 2024-03-06
### Changed
- remove crispy-forms dependencies
- update django_energysystem_viewer to v0.3.1

## [0.2.0] - 2024-03-05
### Added
- version bumping tool
Expand Down
2 changes: 0 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@
"django.forms",
]
THIRD_PARTY_APPS = [
"crispy_forms",
"crispy_bootstrap5",
"allauth",
"allauth.account",
"allauth.socialaccount",
Expand Down
4 changes: 1 addition & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ django==4.2.4 # pyup: < 5.0 # https://www.djangoproject.com/
django-environ==0.10.0 # https://github.com/joke2k/django-environ
django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils
django-allauth==0.54.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==2.0 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==0.7 # https://github.com/django-crispy-forms/crispy-bootstrap5
django-compressor==4.4 # https://github.com/django-compressor/django-compressor
django-libsass==0.9 # https://github.com/torchbox/django-libsass
django-redis==5.3.0 # https://github.com/jazzband/django-redis
Expand All @@ -27,4 +25,4 @@ django-cors-headers==4.2.0 # https://github.com/adamchainz/django-cors-headers
drf-spectacular==0.26.4 # https://github.com/tfranzel/drf-spectacular

git+https://github.com/OpenEnergyPlatform/[email protected]
git+https://github.com/sedos-project/django_energysystem_viewer.git@v0.3.1
git+https://github.com/sedos-project/django_energysystem_viewer.git@v0.5.0
2 changes: 1 addition & 1 deletion sedos_dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.2.0"
__version__ = "0.4.0"
__version_info__ = tuple(int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split("."))
4 changes: 3 additions & 1 deletion sedos_dashboard/templates/403.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "base.html" %}

{% block title %}Forbidden (403){% endblock title %}
{% block title %}
Forbidden (403)
{% endblock title %}
{% block content %}
<h1>Forbidden (403)</h1>
<p>
Expand Down
4 changes: 3 additions & 1 deletion sedos_dashboard/templates/403_csrf.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "base.html" %}

{% block title %}Forbidden (403){% endblock title %}
{% block title %}
Forbidden (403)
{% endblock title %}
{% block content %}
<h1>Forbidden (403)</h1>
<p>
Expand Down
4 changes: 3 additions & 1 deletion sedos_dashboard/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "base.html" %}

{% block title %}Page not found{% endblock title %}
{% block title %}
Page not found
{% endblock title %}
{% block content %}
<h1>Page not found</h1>
<p>
Expand Down
4 changes: 3 additions & 1 deletion sedos_dashboard/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "base.html" %}

{% block title %}Server Error{% endblock title %}
{% block title %}
Server Error
{% endblock title %}
{% block content %}
<h1>Ooops!!! 500</h1>
<h3>Looks like something went wrong!</h3>
Expand Down
3 changes: 2 additions & 1 deletion sedos_dashboard/templates/account/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
{% block content %}
<div class="row">
<div class="col-md-6 offset-md-3">
{% block inner %}{% endblock inner %}
{% block inner %}
{% endblock inner %}
</div>
</div>
{% endblock content %}
1 change: 0 additions & 1 deletion sedos_dashboard/templates/account/email.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{% extends "account/base.html" %}

{% load i18n %}
Expand Down
2 changes: 1 addition & 1 deletion sedos_dashboard/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Comparison Dashboard</h2>
<h2>Energysystem Viewer</h2>
<ul>
<li>
<a href="{% url 'django_energysystem_viewer:collections' %}">Collections</a>
<a href="{% url 'django_energysystem_viewer:selection' %}">Explore Energysystem</a>
</li>
</ul>
{% endblock content %}
2 changes: 0 additions & 2 deletions sedos_dashboard/templates/pages/about.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{% extends "base.html" %}


2 changes: 0 additions & 2 deletions sedos_dashboard/templates/pages/home.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{% extends "base.html" %}


46 changes: 18 additions & 28 deletions sedos_dashboard/templates/users/user_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,29 @@
{% load static %}

{% block title %}
User:

{{ object.username }}


User:
{{ object.username }}
{% endblock title %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-sm-12">
<h2>


{{ object.username }}

</h2>
{% if object.name %}
<p>{{ object.name }}</p>
{% endif %}
</div>
</div>
{% if object == request.user %}
<!-- Action buttons -->
<div class="row">
<div class="col-sm-12">
<a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a>
<a class="btn btn-primary"
href="{% url 'account_email' %}"
role="button">E-Mail</a>
<!-- Your Stuff: Custom user template urls -->
<h2>{{ object.username }}</h2>
{% if object.name %}<p>{{ object.name }}</p>{% endif %}
</div>
</div>
<!-- End Action buttons -->
{% endif %}
</div>
{% if object == request.user %}
<!-- Action buttons -->
<div class="row">
<div class="col-sm-12">
<a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a>
<a class="btn btn-primary"
href="{% url 'account_email' %}"
role="button">E-Mail</a>
<!-- Your Stuff: Custom user template urls -->
</div>
</div>
<!-- End Action buttons -->
{% endif %}
</div>
{% endblock content %}
32 changes: 11 additions & 21 deletions sedos_dashboard/templates/users/user_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,19 @@
{% load crispy_forms_tags %}

{% block title %}


{{ user.username }}


{% endblock title %}
{% block content %}
<h1>


{{ user.username }}


</h1>
<form class="form-horizontal"
method="post"
action="{% url 'users:update' %}">
{% csrf_token %}
{{ form|crispy }}
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">Update</button>
<h1>{{ user.username }}</h1>
<form class="form-horizontal"
method="post"
action="{% url 'users:update' %}">
{% csrf_token %}
{{ form|crispy }}
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">Update</button>
</div>
</div>
</div>
</form>
</form>
{% endblock content %}
1 change: 1 addition & 0 deletions sedos_dashboard/users/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

if typing.TYPE_CHECKING:
from allauth.socialaccount.models import SocialLogin

from sedos_dashboard.users.models import User


Expand Down
2 changes: 1 addition & 1 deletion sedos_dashboard/users/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model, decorators
from django.contrib.auth import decorators, get_user_model
from django.utils.translation import gettext_lazy as _

from sedos_dashboard.users.forms import UserAdminChangeForm, UserAdminCreationForm
Expand Down
1 change: 0 additions & 1 deletion sedos_dashboard/users/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from sedos_dashboard.users.models import User as UserType


User = get_user_model()


Expand Down
6 changes: 1 addition & 5 deletions sedos_dashboard/users/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
from sedos_dashboard.users.forms import UserAdminChangeForm
from sedos_dashboard.users.models import User
from sedos_dashboard.users.tests.factories import UserFactory
from sedos_dashboard.users.views import (
UserRedirectView,
UserUpdateView,
user_detail_view,
)
from sedos_dashboard.users.views import UserRedirectView, UserUpdateView, user_detail_view

pytestmark = pytest.mark.django_db

Expand Down
6 changes: 1 addition & 5 deletions sedos_dashboard/users/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from django.urls import path

from sedos_dashboard.users.views import (
user_detail_view,
user_redirect_view,
user_update_view,
)
from sedos_dashboard.users.views import user_detail_view, user_redirect_view, user_update_view

app_name = "users"
urlpatterns = [
Expand Down
1 change: 0 additions & 1 deletion sedos_dashboard/utils/storages.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Loading