Browse Source

code editing

newsletter
Esther Kleinhenz 6 years ago
parent
commit
84ea0b4d08
4 changed files with 69 additions and 48 deletions
  1. 3
    3
      application/models.py
  2. 44
    43
      application/templates/base.html
  3. 1
    1
      application/templates/index.html
  4. 21
    1
      user.json

+ 3
- 3
application/models.py View File

title = models.CharField(max_length=200) title = models.CharField(max_length=200)
text = models.TextField() text = models.TextField()
created_date = models.DateTimeField( created_date = models.DateTimeField(
default=timezone.now)
default=timezone.now)
published_date = models.DateTimeField( published_date = models.DateTimeField(
blank=True, null=True)
blank=True, null=True)
def publish(self): def publish(self):
self.published_date = timezone.now() self.published_date = timezone.now()
self.save() self.save()

+ 44
- 43
application/templates/base.html View File

<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
{% load static %} {% load static %}

<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="{% static 'css/mysite.css' %}" rel="stylesheet"> <link href="{% static 'css/mysite.css' %}" rel="stylesheet">
<link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet"> <link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet">
</head> </head>

<body> <body>




<img src="{% static 'images/efi.jpg' %}" width="35" height="35" alt="efi"> <img src="{% static 'images/efi.jpg' %}" width="35" height="35" alt="efi">
</a> </a>


<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>


<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
{% if user.is_superuser %} {% if user.is_superuser %}
<li class="nav-item">
<a class="nav-link" href="{% url 'admin:index' %}">Administration</a>
</li>
{% endif %}
{% if user.is_staff %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{% url 'studis:index' %}">Stammdaten</a>
<a class="nav-link" href="{% url 'admin:index' %}">Administration</a>
</li> </li>
{% endif %}
{% endif %} {% if user.is_staff %}
<li class="nav-item">
<a class="nav-link" href="{% url 'studis:index' %}">Stammdaten von</a>
</li>
{% endif %}
</ul> </ul>


<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link disabled" href="#">{{ user.first_name }} {{ user.last_name }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}?next={{ LOGOUT_REDIRECT_URL }}">Abmelden</a>
</li>
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link disabled" href="#">{{ user.first_name }} {{ user.last_name }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}?next={{ LOGOUT_REDIRECT_URL }}">Abmelden</a>
</li>
{% else %} {% else %}
<li class="dropdown">
<a id="login-button" href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">
Anmelden<span class="caret"></span>
</a>
<ul id="login-dp" class="dropdown-menu">
<li>
<form class="form" role="form" method="post" action="{% url 'login' %}" accept-charset="UTF-8" id="login-nav">
{% csrf_token %}
{% if next %}
<input type="hidden" name="next" value="{{ next }}" />
{% endif %}
<div class="form-group">
<label class="sr-only" for="username">Benutzername</label>
<input type="text" class="form-control" id="username" name="username" placeholder="Benutzername" required>
</div>
<div class="form-group">
<label class="sr-only" for="password">Kennwort</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Kennwort" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Anmelden</button>
</div>
</form>
</li>
</ul>
</li>
{% endif %}
<li class="dropdown">
<a id="login-button" href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">
Anmelden
<span class="caret"></span>
</a>
<ul id="login-dp" class="dropdown-menu">
<li>
<form class="form" role="form" method="post" action="{% url 'login' %}" accept-charset="UTF-8" id="login-nav">
{% csrf_token %} {% if next %}
<input type="hidden" name="next" value="{{ next }}" /> {% endif %}
<div class="form-group">
<label class="sr-only" for="username">Benutzername</label>
<input type="text" class="form-control" id="username" name="username" placeholder="Benutzername" required>
</div>
<div class="form-group">
<label class="sr-only" for="password">Kennwort</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Kennwort" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Anmelden</button>
</div>
</form>
</li>
</ul>
</li>
{% endif %}
</ul> </ul>
</div> </div>
</nav> </nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="{% static 'bootstrap/js/bootstrap.bundle.js' %}"></script> <script src="{% static 'bootstrap/js/bootstrap.bundle.js' %}"></script>
</body> </body>

</html> </html>

+ 1
- 1
application/templates/index.html View File

<div class="jumbotron"> <div class="jumbotron">
<h1>efi Medizintechnik Informationssystem</h1> <h1>efi Medizintechnik Informationssystem</h1>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<p>Herzlich Willkommen!</p>
<p>Herzlich Willkommen {{user.get_username}}!</p>
{% else %} {% else %}
<p>Bitte melden Sie sich mit Ihrer Domänenkennung an.</p> <p>Bitte melden Sie sich mit Ihrer Domänenkennung an.</p>
{% endif %} {% endif %}

+ 21
- 1
user.json View File

"pk": 1, "pk": 1,
"fields": { "fields": {
"password": "pbkdf2_sha256$100000$pu4yd74Yw8vd$cpecLMlMn0/X2vPqQb2U7QFyjq939RFiXHVECRFtaVU=", "password": "pbkdf2_sha256$100000$pu4yd74Yw8vd$cpecLMlMn0/X2vPqQb2U7QFyjq939RFiXHVECRFtaVU=",
"last_login": "2018-07-01T10:45:39.649Z",
"last_login": "2018-07-01T13:56:56.740Z",
"is_superuser": true, "is_superuser": true,
"username": "esthi", "username": "esthi",
"first_name": "", "first_name": "",
"groups": [], "groups": [],
"user_permissions": [] "user_permissions": []
} }
},
{
"model": "auth.user",
"pk": 5,
"fields": {
"password": "pbkdf2_sha256$100000$JfhBNx94qFkw$b0Zefa6oyWN4P8NoZ0vxUlGJp4HkOKSDOR7mROjHuJQ=",
"last_login": null,
"is_superuser": false,
"username": "willsmith",
"first_name": "",
"last_name": "",
"email": "",
"is_staff": false,
"is_active": true,
"date_joined": "2018-07-01T14:00:11Z",
"groups": [
1
],
"user_permissions": []
}
} }
] ]

Loading…
Cancel
Save