Skip to content

Commit ac713d8

Browse files
authored
Merge pull request #6 from ktalik/master
Major improvements
2 parents 94981e5 + 097d40c commit ac713d8

File tree

17 files changed

+194
-57
lines changed

17 files changed

+194
-57
lines changed

adminlteui/context_processors.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.conf import settings
2+
3+
4+
def adminlte_settings(request):
5+
if hasattr(settings, 'ADMINLTE_SETTINGS'):
6+
return {
7+
'adminlte': settings.ADMINLTE_SETTINGS
8+
}
9+
else:
10+
return {
11+
'adminlte': {}
12+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/** Django-related improvements to AdminLTE UI **/
2+
3+
div.inline-related {
4+
padding: 10px;
5+
}
6+
7+
.form-row {
8+
padding: 5px;
9+
}
10+
11+
.inlinechangelink {
12+
content: url('/static/admin/img/icon-changelink.svg');
13+
}
14+
15+
.inline-related .tabular {
16+
background-color: white;
17+
box-shadow: 0 1px 1px rgba(0,0,0,0.1);
18+
}
19+
20+
td.djn-td,
21+
th.djn-th {
22+
padding: 10px;
23+
}
24+
25+
td.delete input {
26+
margin: 10px;
27+
}
28+
29+
tr.djn-tr > .original {
30+
padding-left: 20px;
31+
}
32+
33+
/* Checkbox selection table header */
34+
.djn-checkbox-select-all {
35+
padding-right: 0px !important;
36+
width: 0px;
37+
}
38+

adminlteui/static/admin/font-awesome/css/font-awesome.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
184 KB
Binary file not shown.
66.3 KB
Binary file not shown.

adminlteui/static/admin/ionicons/ionicons.min.css

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adminlteui/templates/admin/base.html

Lines changed: 99 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,28 @@
1010
<!-- Bootstrap 3.3.6 -->
1111
<link rel="stylesheet" href={% static "admin/bootstrap/css/bootstrap.min.css" %}>
1212
<!-- Font Awesome -->
13-
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css">
13+
<!--<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css">-->
14+
<link rel="stylesheet" href={% static "admin/font-awesome/css/font-awesome.min.css" %}>
1415
<!-- Ionicons -->
15-
<link rel="stylesheet" href="//cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css">
16+
<link rel="stylesheet" href={% static "admin/ionicons/ionicons.min.css" %}>
17+
1618
{% block extrastyle %} {% endblock %}
1719

1820
{% block extrahead %} {% endblock %}
1921
<!-- Theme style -->
2022
<link rel="stylesheet" href={% static "admin/dist/css/AdminLTE.min.css" %}>
2123
<!-- AdminLTE Skins. Choose a skin from the css/skins
2224
folder instead of downloading all of them to reduce the load. -->
25+
{% if adminlte.skin %}
26+
<link rel="stylesheet" href={% static "admin/dist/css/skins/skin-"|add:adminlte.skin|add:".min.css" %}>
27+
{% else %}
2328
<link rel="stylesheet" href={% static "admin/dist/css/skins/_all-skins.min.css" %}>
29+
{% endif %}
30+
31+
<link rel="stylesheet" href={% static "admin/dist/css/django.css" %}>
32+
33+
<link rel="apple-touch-icon" href="/{{ adminlte_site_logo.site_logo }}">
34+
<link rel="icon" href="/{{ adminlte_site_logo.site_logo }}">
2435

2536
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
2637
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@@ -30,7 +41,7 @@
3041
<![endif]-->
3142

3243
</head>
33-
<body class="hold-transition skin-blue sidebar-mini fixed">
44+
<body class="hold-transition skin-{% if adminlte.skin %}{{ adminlte.skin }}{% else %}blue{% endif %} sidebar-mini fixed">
3445

3546
<div class="wrapper">
3647
{% if not is_popup %}
@@ -173,7 +184,9 @@
173184
</li>
174185
<!-- Control Sidebar Toggle Button -->
175186
<li>
187+
{% if adminlte.demo %}
176188
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
189+
{% endif %}
177190
</li>
178191
</ul>
179192
</div>
@@ -202,6 +215,7 @@
202215
</div>
203216
{% endif %}
204217
<!-- search form -->
218+
{% if adminlte.search_form %}
205219
<form action="#" method="get" class="sidebar-form">
206220
<div class="input-group">
207221
<input type="text" name="q" class="form-control" placeholder="{% trans 'Search' %}...">
@@ -211,60 +225,96 @@
211225
</span>
212226
</div>
213227
</form>
228+
{% endif %}
214229
<!-- /.search form -->
215230
<!-- sidebar menu: : style can be found in sidebar.less -->
216231
<ul class="sidebar-menu">
217-
<li class="header">{% trans 'MAIN NAVIGATION' %}</li>
218-
<li>
219-
<a id="adminIndex" href="{% url 'admin:index' %}">
220-
<i class="fa fa-dashboard"></i> <span>{% trans 'Dashboard' %}</span>
221-
</a>
222-
</li>
223-
{% get_menu request as app_list %}
224-
{% if app_list %}
225-
{% for app in app_list %}
226-
<li {% if not app.admin_url %}class="treeview"{% endif %}>
227-
<a href="{% if app.admin_url %}{{app.admin_url}}{% else %}javascript:void(0){% endif %}">
228-
<i class="fa {% if app.icon %} {{app.icon}} {% else %}fa-database{% endif %}"></i>
229-
<span style="overflow: hidden; display: inline-block; vertical-align:top;">{{ app.name }}</span>
230-
{% if not app.admin_url %}
231-
<span class="pull-right-container">
232-
<i class="fa fa-angle-left pull-right"></i>
233-
</span>
232+
233+
<li class="header">{% trans 'MAIN NAVIGATION' %}</li>
234+
<li>
235+
<a id="adminIndex" href="{% url 'admin:index' %}">
236+
<i class="fa fa-dashboard"></i> <span>{% trans 'Dashboard' %}</span>
237+
</a>
238+
</li>
239+
240+
{% if adminlte.main_navigation_app %}
241+
242+
{% get_menu request as app_list %}
243+
{% if app_list %}
244+
{% for app in app_list %}
245+
{% if app.app_label == adminlte.main_navigation_app %}
246+
{% for model in app.models %}
247+
{% if model.admin_url %}
248+
<li>
249+
<a href="{{ model.admin_url }}">
250+
<i class="fa {% if model.icon %} {{model.icon}} {% else %}fa-circle-o{% endif %}"></i> <span>{{ model.name }}</span>
251+
</a>
252+
</li>
253+
{% endif %}
254+
{% endfor %}
255+
{% endif %}
256+
{% endfor %}
234257
{% endif %}
235-
</a>
236-
{% if not app.admin_url %}
237-
<ul class="treeview-menu">
258+
259+
{% endif %}
260+
261+
{% if adminlte.navigation_expanded %}
262+
263+
{% get_menu request as app_list %}
264+
{% if app_list %}
265+
{% for app in app_list %}
266+
{% if not adminlte.show_apps or adminlte.show_apps and app.app_label in adminlte.show_apps %}
267+
{% if app.app_label != adminlte.main_navigation_app %}
268+
<li class="header">{{ app.name|upper }}</li>
238269
{% for model in app.models %}
270+
{% ifchanged %}
239271
{% if model.admin_url %}
240-
<li><a href="{{ model.admin_url }}" ><i class="fa {% if model.icon %} {{model.icon}} {% else %}fa-circle-o{% endif %}"></i>{{ model.name }}</a></li>
272+
<li>
273+
<a href="{{ model.admin_url }}">
274+
<i class="fa {% if model.icon %} {{model.icon}} {% else %}fa-circle-o{% endif %}"></i> <span>{{ model.name }}</span>
275+
</a>
276+
</li>
241277
{% endif %}
278+
{% endifchanged %}
242279
{% endfor %}
243-
</ul>
280+
{% endif %}
281+
{% endif %}
282+
{% endfor %}
283+
{% endif %}
284+
285+
{% else %}
286+
287+
{% get_menu request as app_list %}
288+
{% if app_list %}
289+
{% for app in app_list %}
290+
{% if not adminlte.show_apps or adminlte.show_apps and app.app_label in adminlte.show_apps %}
291+
{% if app.app_label != adminlte.main_navigation_app %}
292+
<li {% if not app.admin_url %}class="treeview"{% endif %}>
293+
<a href="{% if app.admin_url %}{{app.admin_url}}{% else %}javascript:void(0){% endif %}">
294+
<i class="fa {% if app.icon %} {{app.icon}} {% else %}fa-database{% endif %}"></i>
295+
<span style="overflow: hidden; display: inline-block; vertical-align:top;">{{ app.name }}</span>
296+
{% if not app.admin_url %}
297+
<span class="pull-right-container">
298+
<i class="fa fa-angle-left pull-right"></i>
299+
</span>
300+
{% endif %}
301+
</a>
302+
{% if not app.admin_url %}
303+
<ul class="treeview-menu">
304+
{% for model in app.models %}
305+
{% if model.admin_url %}
306+
<li><a href="{{ model.admin_url }}" ><i class="fa {% if model.icon %} {{model.icon}} {% else %}fa-circle-o{% endif %}"></i>{{ model.name }}</a></li>
307+
{% endif %}
308+
{% endfor %}
309+
</ul>
310+
{% endif %}
311+
</li>
312+
{% endif %}
313+
{% endif %}
314+
{% endfor %}
244315
{% endif %}
245-
</li>
246-
{% endfor %}
316+
247317
{% endif %}
248-
<!--{% if request.user.is_superuser %}-->
249-
<!--<li class="treeview">-->
250-
<!--<a href="#">-->
251-
<!--<i class="fa fa-cog"></i>-->
252-
<!--<span>{% trans 'System manage' %}</span>-->
253-
<!--<span class="pull-right-container">-->
254-
<!--<i class="fa fa-angle-left pull-right"></i>-->
255-
<!--</span>-->
256-
<!--</a>-->
257-
<!--<ul class="treeview-menu">-->
258-
<!--<li><a href="" ><i class="fa fa-file-text-o"></i>{% trans 'Log manage' %}</a></li>-->
259-
<!--<li><a href="/admin/config/system/" ><i class="fa fa-wrench"></i>{% trans 'System config' %}</a></li>-->
260-
<!--</ul>-->
261-
<!--</li>-->
262-
<!--{% endif %}-->
263-
264-
<!--<li class="header">LABELS</li>-->
265-
<!--<li><a href="#"><i class="fa fa-circle-o text-red"></i> <span>{% trans 'Important' %}</span></a></li>-->
266-
<!--<li><a href="#"><i class="fa fa-circle-o text-yellow"></i> <span>{% trans 'Warning' %}</span></a></li>-->
267-
<!--<li><a href="#"><i class="fa fa-circle-o text-aqua"></i> <span>{% trans 'Information' %}</span></a></li>-->
268318
</ul>
269319
</section>
270320
<!-- /.sidebar -->
@@ -497,7 +547,9 @@ <h3 class="control-sidebar-heading">Chat Settings</h3>
497547
<!-- AdminLTE App -->
498548
<script src={% static "admin/dist/js/app.min.js" %}></script>
499549
<!-- AdminLTE for demo purposes -->
550+
{% if adminlte.demo %}
500551
<script src={% static "admin/dist/js/demo.js" %}></script>
552+
{% endif %}
501553
<script>
502554
// use js control active status of siderbar-menu
503555
$(function() {

0 commit comments

Comments
 (0)