Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
templates: Add admin templates
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithpabbati committed Sep 4, 2019
1 parent ca44adc commit e25422d
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qujini/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates'),os.path.join(BASE_DIR, 'static')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down
38 changes: 38 additions & 0 deletions templates/admin/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends 'admin/base.html' %}
{% load i18n %}
{% block usertools %}
{% if has_permission %}
<div id="user-tools">
<div>
{% block welcome-msg %}
<div style="font-size: 150%; padding: 0.3rem; text-transform: none">
{% trans 'Welcome ' %}
<strong>@{% firstof user.get_short_name user.get_username %}</strong> !
</div>
{% endblock %}
{% block userlinks %}
<a href="https://github.com/amfoss/qujini/wiki">{% trans 'Documentation' %}</a> /
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
{% endif %}
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
{% endblock %}
</div>
</div>
{% endif %}
{% endblock %}

{% block footer %}
<style>
#footer
{
text-align: center;
padding: 2rem;
background: #eee;
}
</style>
<div id="footer">
Qujini<br>
<span style="font-size: 75%">Question Paper Generator</span>
</div>
{% endblock %}
106 changes: 106 additions & 0 deletions templates/admin/base_site.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{% extends 'admin/base_site.html' %}
{% load staticfiles %}
{% load static %}

{% block branding %}
<style>
.dashboard { background: #eee; }
#header {
padding: 1rem 10%;
min-height: 3.5rem;
}
#branding { height: 100%; }
.head {
display: flex;
align-items: center;
height: 100%;
}
.aligned label
{
float: none;
}
#changelist
{
box-shadow: None;
background: none;
}
.help
{
padding-left: 0!important;
margin-left: 0!important;
margin-top: 5px!important;
}
.form-row
{
padding: 20px
}
.module, #content-related, #changelist-filter
{
box-shadow: 2px 1px 1px 1px rgba(0,0,0,0.3);
}
#recent-actions-module
{
box-shadow: none!Important;
}
div.breadcrumbs
{
color: black!important;
}
div.breadcrumbs a
{
color: black!important;
}
.module h2, .module caption, .module caption a
{
color: black!important;
padding: 0.8rem;
font-weight: 900;
}
#user-tools
{
display: block;
}
#header
{
line-height: 1.2;
}
.submit-row input
{
color: black!important;
box-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}
#content
{
background: #eee;
min-height: 80vh;
}
.module a:link, a:visited
{
font-size: 1rem;
}
.dashboard #content
{
width: auto!Important;
}
#user-tools
{
display: flex;
align-items: center;
height: 100%;
}
#user-tools a
{
border-bottom: 0;
padding-right: 0.35rem;
padding-left: 0.35rem;
}
.submit-row { background: none!important; border: none!important; }
.aligned label + p, .aligned label + div.help, .aligned label + div.readonly { margin-left: 0!important; }
#changelist .actions select { background: white; }
#changelist #toolbar, #changelist .actions, #changelist .paginator { background: none!important; }
.module table caption a:hover { text-decoration: none; }
</style>
<div class="head">
<h1 style="padding: 0 1rem; font-weight: 900; color: white">Qujini</h1>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
font-family: monospace;
font-weight: 400;
font-size: 1rem;
/* color: #333; */
}
</style>
<div id="footer">
Expand All @@ -22,7 +21,6 @@
{% block script %}


<script src="{% static 'questions/js/login-extra.js' %}"></script>
{% endblock %}


Expand Down Expand Up @@ -79,6 +77,6 @@
</style>

<div class="head">
<img class="brand_img" src="{% static 'questions/logo_light.png' %}" style="height: 5rem;" alt="logo">
<h1 style="padding: 1rem; font-weight:900; font-size:30px;">Qujini</h1>
</div>
{% endblock %}

0 comments on commit e25422d

Please sign in to comment.