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

Enhance UI layout and add project file management templates #2

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ venv/
*.pyc
.gitmodules
.DS_Store
.gitmodules
uploads/
.coverage
coverage.xml
DevOpsCustomerView/db.sqlite3
DevOpsCustomerView/main/local.py
report.xml
DevOpsCustomerView/userinterface/templates/software-design
local.py
local.py
.vscode/
30 changes: 30 additions & 0 deletions DevOpsCustomerView/data/employees.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Title;First Name;Family Name;Picture;Team;Short;Code;Description;Mattermost-User
Herr;André;Hagemann;Andre_1;Organisation;ah;53;Datenschutz, Vertragswesen & Entwicklung;@andre
Herr;Daniel;Kemen;Daniel_1;Geschäftsleitung;dk;51;Geschäftsführung & Entwicklung;@daniel
Herr;Julian;Bürklin;Julian_1;Geschäftsleitung;jb;52;Prokurist & Leitung Entwicklung;@julian
Frau;Jennifer;Luhr;Jennifer_1;Organisation;jl;54;Leitung Buchhaltung & Organisation;@jenny
Herr;Kevin;Neumann;Kevin_1;Team easyVerein;kn;57;Projektleitung easyVerein;@kevin
Herr;Harry;Bejol;Harry_1;Team easyVerein;hb;61;Technischer Support;@harry
Frau;Samira;Horstmann;Samira_1;Team easyVerein;sh;58;Marketing & Kommunikation;@samira
Herr;Frederic;Cremer;Frederic_1;Entwicklung / IT;fc;59;Softwareentwicklung (Mobile);@frederic
Frau;Johanna;Götz;Johanna_1;Entwicklung / IT;jgo;56;Softwareentwicklung;@johanna_g
Herr;Dennis;Wawrzyniak;Dennis_1;Entwicklung / IT;dw;55;Softwareentwicklung (Full-Stack);@denniswawrzyniak
Herr;Andrej;Schwanke;Andrej_1;Entwicklung / IT;as;56;Softwareentwicklung;@andrej_schwanke
Frau;Jessica;Grissmann;Jessica_1;Organisation;jgr;64;Buchhaltung & Organisation;@jessicagrissmann
Herr;Leonard;König;Leonard_1;Entwicklung / IT;lk;56;Softwareentwicklung;@leonard
Herr;Pascal;Mellert;Pascal_1;Entwicklung / IT;pm;56;Softwareentwicklung;@pascal
Herr;Jonathan;Goldschmidt;Jonathan_1;Entwicklung / IT;jg;56;Softwareentwicklung;@jonathan
Herr;Niklas;Baumert;;Entwicklung / IT;nb;61;Softwareentwicklung (Full-Stack);@sd-baumertn
Herr;Majid;Schmitt;;Entwicklung / IT;ms;56;Softwareentwicklung;@majid
Herr;Simon;Bärmann;Simon_1;Entwicklung / IT;sb;56;Softwareentwicklung;@Simon
Herr;Julian;Bührer;Julian_2;Entwicklung / IT;jbu;60;Softwareentwicklung (API);@jbuehrer
Herr;Markus;Pomrehn;Markus_1;Entwicklung / IT;mp;60;Softwareentwicklung (Backend);@markus
Frau;Nadja;Schmidt;Nadja_1;Entwicklung / IT;nsc;56;Softwareentwicklung;@nadja
Herr;Noah;Ibers;Noah_1;Entwicklung / IT;ni;61;UX / UI Design;@noah
Herr;Niklas;Brunnemann;Niklas_2;Entwicklung / IT;nbr;55;Softwareentwicklung;@niklas2
Herr;Nico;Karrer;Nico_1;Entwicklung / IT;nk;59;Softwareentwicklung (Mobile);@nico
Frau;Ina;Müller;Ina_1;Team easyVerein;im;65;Produktsupport;@inamueller
Herr;Jonas;Krause;Jonas_1;Entwicklung / IT;jk;63;Softwareentwicklung;@jonas
Herr;Johannes;Schwarz;Johannes_1;Entwicklung / IT;js;63;Softwareentwicklung;@johannesschwarzsd
Herr;Linus;Walliser;;Organisation;lw;67;Kaufmännischer Support;@linus
Herr;Dennis;Brückner;;Entwicklung / IT;db;63;UX / UI Design;@dennisbrueckner
25 changes: 25 additions & 0 deletions DevOpsCustomerView/main/githubService.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# DevOpsCustomerView/main/github_service.py
import requests

class GitHubService:
def __init__(self, token):
self.token = token
self.base_url = "https://api.github.com"

def get_headers(self):
return {
"Authorization": f"token {self.token}",
"Accept": "application/vnd.github.v3+json",
}

def get_user_repos(self, username):
url = f"{self.base_url}/users/{username}/repos"
response = requests.get(url, headers=self.get_headers())
response.raise_for_status()
return response.json()

def get_repo_issues(self, repo):
url = f"{self.base_url}/repos/SD-Software-Design-GmbH/{repo}/issues"
response = requests.get(url, headers=self.get_headers())
response.raise_for_status()
return response.json()
51 changes: 0 additions & 51 deletions DevOpsCustomerView/main/local.py.example

This file was deleted.

103 changes: 96 additions & 7 deletions DevOpsCustomerView/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
]


# SevDesk API settings
SEVDESK_API_URL = "https://my.sevdesk.de/api/v1/"
SEVDESK_TOKEN = "dd56e88ddf7db9f4d1ca1c4fbd4675d"


# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/

Expand All @@ -113,8 +118,9 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

MEDIA_ROOT = "uploads/"
MEDIA_URL = "uploads/"
MEDIA_ROOT = BASE_DIR / "uploads"
MEDIA_ROOT = BASE_DIR / "uploads"
MEDIA_URL = "/uploads/"

STATIC_URL = "static/"
LOGIN_URL = "/"
Expand All @@ -130,13 +136,14 @@
X_FRAME_OPTIONS = "SAMEORIGIN"

CSP_DEFAULT_SRC = "'none'"
CSP_STYLE_SRC = "'self'"
CSP_SCRIPT_SRC = "'self'"
CSP_FONT_SRC = "'self'"
CSP_IMG_SRC = "data: 'self' https://gitlab.com"
CSP_OBJECT_SRC = "blob: data: 'self'"
CSP_BASE_URI = "'none'"
CSP_INCLUDE_NONCE_IN = ["script-src"]
CSP_STYLE_SRC = "'self' 'unsafe-inline' https://software-design.de"
CSP_SCRIPT_SRC = "'self' 'unsafe-inline' https://software-design.de"
CSP_IMG_SRC = "'self' data: https://software-design.de"
CSP_FONT_SRC = "'self' https://software-design.de"

# set to True to use eMail System
SEND_MAIL = False
Expand All @@ -159,7 +166,7 @@
"login_logo_dark": None,
"site_logo_classes": "img-circle",
"site_icon": None,
"welcome_sign": "Welcome to the Twayn PM Tool",
"welcome_sign": "Willkommen im Twayn PM Tool",
"copyright": "SD Software-Design GmbH",
"user_avatar": None,
"usermenu_links": [
Expand All @@ -174,6 +181,85 @@
"custom_js": None,
"use_google_fonts_cdn": False,
"show_ui_builder": False,
"topmenu_links": [
{
"name": "",
"url": "/",
"permissions": ["auth.view_user"],
"icon": "fas fa-home",
},
{"name": "Nutzer", "model": "auth.User"},
{
"name": "Projekte",
"url": "admin:userinterface_project_changelist",
"permissions": ["auth.view_user"],
},
{"app": "userinterface"},
],
"show_sidebar": True,
"navigation_expanded": True,
"hide_apps": [],
"hide_models": [],
"order_with_respect_to": [
"userinterface.Company",
"userinterface.CustomerUser",
"userinterface.Project",
"userinterface.Team",
"userinterface.TeamMember",
"auth",
],
"custom_links": {
"Unternehmen": [
{
"name": "Unternehmen",
"url": "admin:userinterface_company_changelist",
"icon": "fas fa-building",
},
{
"name": "Kundenbenutzer",
"url": "admin:userinterface_customeruser_changelist",
"icon": "fas fa-user-tie",
},
],
"Projekte": [
{
"name": "Projekte",
"url": "admin:userinterface_project_changelist",
"icon": "fas fa-project-diagram",
},
],
"Teams": [
{
"name": "Teams",
"url": "admin:userinterface_team_changelist",
"icon": "fas fa-users",
},
{
"name": "Teammitglieder",
"url": "admin:userinterface_teammember_changelist",
"icon": "fas fa-user-friends",
},
],
},
"icons": {
"auth": "fas fa-users-cog",
"auth.user": "fas fa-user",
"auth.Group": "fas fa-users",
"userinterface.Company": "fas fa-building",
"userinterface.CustomerUser": "fas fa-user-tie",
"userinterface.DownloadableFile": "fas fa-file-download",
"userinterface.Project": "fas fa-project-diagram",
"userinterface.Team": "fas fa-users",
"userinterface.TeamMember": "fas fa-user-friends",
},
"default_icon_parents": "fas fa-chevron-circle-right",
"default_icon_children": "fas fa-circle",
"related_modal_active": True,
"changeform_format": "horizontal_tabs",
"changeform_format_overrides": {
"auth.user": "collapsible",
"auth.group": "vertical_tabs",
},
}


Expand All @@ -183,13 +269,16 @@
=========================================================
"""

NO_SECRET_KEY = ""
try:
from .local import *
except ModuleNotFoundError:
print("No local settings file")

VERIFICATION_SECRET = NO_SECRET_KEY
SECRET_KEY = NO_SECRET_KEY
# if VERIFICATION_KEY is not set set it to secret key
try:
VERIFICATION_SECRET
VERIFICATION_SECRET = ""
except NameError:
VERIFICATION_SECRET = SECRET_KEY
13 changes: 10 additions & 3 deletions DevOpsCustomerView/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from userinterface import views

urlpatterns = [
path('', include('userinterface.urls')),
path('admin/', admin.site.urls),
path('i18n/', include('django.conf.urls.i18n')),
path("", include("userinterface.urls")),
path("admin/", admin.site.urls),
path("i18n/", include("django.conf.urls.i18n")),
path(
"github/repos/<str:repo>/issues/",
views.github_issues,
name="github_issues",
),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
4 changes: 2 additions & 2 deletions DevOpsCustomerView/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand All @@ -18,5 +18,5 @@ def main():
execute_from_command_line(sys.argv)


if __name__ == '__main__':
if __name__ == "__main__":
main()
Loading