Skip to content

Commit

Permalink
Merge pull request #172 from stephengtuggy/Django-4.1
Browse files Browse the repository at this point in the history
Upgrade to Django 4.1
  • Loading branch information
stephengtuggy authored Jul 2, 2024
2 parents 566374b + c3121a6 commit ddf2dce
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
43 changes: 43 additions & 0 deletions app/jobHistory/static/css/jobHistory.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,46 @@ body {
align-items: center;
justify-content: center;
}

#logout-form {
display: inline;
}

button.btn-link {
align-items: normal;
background-color: rgba(0, 0, 0, 0);
border-color: rgb(0, 0, 238);
border-style: none;
box-sizing: content-box;
color: rgb(0, 0, 238);
cursor: pointer;
display: inline;
font: inherit;
height: auto;
padding: 0;
perspective-origin: 0 0;
text-align: start;
text-decoration: underline;
transform-origin: 0 0;
width: auto;
-moz-appearance: none;
-webkit-logical-height: 1em; /* Chrome ignores auto, so we have to use this hack to set the correct height */
-webkit-logical-width: auto; /* Chrome ignores auto, but here for completeness */
}


/* Mozilla uses a pseudo-element to show focus on buttons, */
/* but anchors are highlighted via the focus pseudo-class. */

@supports (-moz-appearance:none) {
/* Mozilla-only */
button.btn-link::-moz-focus-inner { /* reset any predefined properties */
border: none;
padding: 0;
}

button.btn-link:focus { /* add outline to focus pseudo-class */
outline-style: dotted;
outline-width: 1px;
}
}
2 changes: 2 additions & 0 deletions app/jobHistorySite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,5 @@
LOGIN_REDIRECT_URL = reverse_lazy('jobHistory:index')

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

FORM_RENDERER = "django.forms.renderers.DjangoDivFormRenderer"
2 changes: 1 addition & 1 deletion app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ asgiref==3.8.1
astroid==3.2.2
colorama==0.4.6
dill==0.3.8
Django==4.0.10
Django==4.1.13
django-environ==0.11.2
isort==5.13.2
lazy-object-proxy==1.10.0
Expand Down
11 changes: 9 additions & 2 deletions app/templates/base/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
<div id="header-block">
<nav id="header-nav" class="header-nav">
{% if user.is_authenticated %}
<p>Welcome, {{ user.username }}. <a href="{% url 'admin:index' %}">Enter data</a>. <a href="{% url 'jobHistory:index' %}">View job history</a>. <a href="{% url 'logout' %}">Log out</a>.</p>
<div>Welcome, {{ user.username }}.
<a href="{% url 'admin:index' %}">Enter data</a>.
<a href="{% url 'jobHistory:index' %}">View job history</a>.
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
{% csrf_token %}
<button type="submit" class="btn-link">Log out</button>
</form>.
</div>
{% else %}
<p>Please <a href="{% url 'login' %}">log in</a>.</p>
<div>Please <a href="{% url 'login' %}">log in</a>.</div>
{% endif %}
</nav>
</div>
Expand Down

0 comments on commit ddf2dce

Please sign in to comment.