Skip to content

Commit

Permalink
fix: hotfix 3.13.8 serve static files (#241)
Browse files Browse the repository at this point in the history
Co-authored-by: hicham <hicham.taroq-ext@aphp.fr>
  • Loading branch information
thicham43 and hicham authored Aug 3, 2023
1 parent 2e82e7a commit 2e14048
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 110 deletions.
2 changes: 1 addition & 1 deletion admin_cohort/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'Portail/Cohort360 API'
__version__ = '3.13.7'
__version__ = '3.13.8'
__author__ = 'Assistance Publique - Hopitaux de Paris, Département I&D'


Expand Down
3 changes: 0 additions & 3 deletions admin_cohort/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@

ROOT_URLCONF = 'admin_cohort.urls'

MEDIA_ROOT = BASE_DIR / 'admin_cohort/media'
MEDIA_URL = '/media/'

TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'admin_cohort/templates'],
'APP_DIRS': True,
Expand Down
79 changes: 79 additions & 0 deletions admin_cohort/static/admin_cohort/css/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.center {
display: block;
margin: 5% auto;
width: 50%;
}

body {
margin: 0;
padding: 0;
background-color: #FAFAFA;
}

.login {
width: 382px;
overflow: hidden;
margin: auto;
padding: 80px;
border-radius: 15px;
}

.login-background {
margin: auto;
padding-top: 15%;
padding-bottom: 2%;
border-radius: 15px;
background: #1e488e;
text-align: center;
}

h2 {
text-align: center;
color: #5BC5F2;
padding: 20px;
}

label {
color: #5BC5F2;
font-size: 17px;
}

#id_username {
width: 300px;
height: 30px;
padding-left: 8px;
}

#id_password {
width: 300px;
height: 30px;
padding-left: 8px;
}

#login {
width: 150px;
height: 30px;
border: none;
border-radius: 17px;
padding-left: 7px;
background-color: #5BC5F2;
color: #FFFFFF;
margin-top: 2%;
}

#login:hover {
cursor: pointer;
}

span {
color: white;
font-size: 17px;
}

input {
margin-bottom: 2%;
}

input:focus {
outline: none !important;
}
Binary file added admin_cohort/static/admin_cohort/img/favicon.ico
Binary file not shown.
File renamed without changes
128 changes: 24 additions & 104 deletions admin_cohort/templates/login.html
Original file line number Diff line number Diff line change
@@ -1,108 +1,28 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login</title>
</head>
<body>
<div id="login-form-wrap">
<div class="login">
<img src="/media/Logo_user_data_SVG_cohort360_small.png" alt="Cohort360" class="center"/>
<div class="login-background">
<form method="post" id="login-form">
{% csrf_token %}
<input type="text" id="id_username" name="username" placeholder="Username"><i
class="validation"><span></span><span></span></i>
<input type="password" id="id_password" name="password" placeholder="Password" required><i
class="validation"><span></span><span></span></i>
<input type="submit" id="login" value="Login">
</form>
<img src="/media/logo-aphp-white.png" alt="Cohort360" class="center"/>
<head>
<meta charset="UTF-8">
<link rel="icon" href="{% static 'admin_cohort/img/favicon.ico' %}"/>
<title>Login</title>
<link rel="stylesheet" href="{% static 'admin_cohort/css/login.css' %}">
</head>
<body>
<div id="login-form-wrap">
<div class="login">
<img src="{% static 'admin_cohort/img/Logo_user_data_SVG_cohort360_small.png' %}" alt="Cohort360" class="center"/>
<div class="login-background">
<form method="post" id="login-form">
{% csrf_token %}
<input type="text" id="id_username" name="username" placeholder="Username"><i
class="validation"><span></span><span></span></i>
<input type="password" id="id_password" name="password" placeholder="Password" required><i
class="validation"><span></span><span></span></i>
<input type="submit" id="login" value="Login">
</form>
<img src="{% static 'admin_cohort/img/logo-aphp-white.png' %}" alt="Cohort360" class="center"/>
</div>
</div>
</div>
</div>
</div>

</body>
</body>
</html>

<style media="screen">
.center {
display: block;
margin: 5% auto;
width: 50%;
}

body {
margin: 0;
padding: 0;
background-color: #FAFAFA;
}

.login {
width: 382px;
overflow: hidden;
margin: auto;
padding: 80px;
border-radius: 15px;
}

.login-background {
margin: auto;
padding-top: 15%;
padding-bottom: 2%;
border-radius: 15px;
background: #1e488e;
text-align: center;
}

h2 {
text-align: center;
color: #5BC5F2;
padding: 20px;
}

label {
color: #5BC5F2;
font-size: 17px;
}

#id_username {
width: 300px;
height: 30px;
padding-left: 8px;
}

#id_password {
width: 300px;
height: 30px;
padding-left: 8px;
}

#login {
width: 150px;
height: 30px;
border: none;
border-radius: 17px;
padding-left: 7px;
background-color: #5BC5F2;
color: #FFFFFF;
margin-top: 2%;
}

#login:hover {
cursor: pointer;
}

span {
color: white;
font-size: 17px;
}

input {
margin-bottom: 2%;
}

input:focus {
outline: none !important;
}
</style>
2 changes: 1 addition & 1 deletion admin_cohort/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class NestedDefaultRouter(NestedRouterMixin, routers.DefaultRouter):
path("workspaces/", include(("workspaces.urls", "workspaces"), namespace="workspaces")),
re_path(r"^docs", schema_view.with_ui(renderer="swagger", cache_timeout=0, )),
re_path(r"^redoc/$", schema_view.with_ui(renderer="redoc", cache_timeout=0), name="schema-redoc"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

mkdir -p static/ /app/log
mkdir -p /app/log

# update variables in nginx
sed -i s/{{BACK_HOST}}/"$BACK_HOST"/g /etc/nginx/nginx.conf;
Expand Down

0 comments on commit 2e14048

Please sign in to comment.