Skip to content

Commit bd94aca

Browse files
committed
support number & translation id
1 parent 6fb3b22 commit bd94aca

File tree

9 files changed

+103
-8
lines changed

9 files changed

+103
-8
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Django Log Viewer
44

55
|pypi version| |license| |build status|
66

7-
``Django Log Viewer`` allows you to read log files in the admin page.
7+
``Django Log Viewer`` allows you to read log files in the admin page by using ``DataTables``.
88
This project was modified from: https://bitbucket.org/inkalabsinc/django-log-viewer
99

1010
-----------------
1111

12-
.. image:: https://i.imgur.com/sGRlW9b.png
12+
.. image:: https://i.imgur.com/2BFzilV.png
1313

1414

1515
Quick start
421 Bytes
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2019-07-09 19:54+0700\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <[email protected]>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#: templates/log_viewer/logfile_viewer.html:6
22+
msgid "Home"
23+
msgstr ""
24+
25+
#: templates/log_viewer/logfile_viewer.html:8
26+
msgid "Log Viewer"
27+
msgstr ""
28+
29+
#: templates/log_viewer/logfile_viewer.html:36
30+
msgid "Log Files"
31+
msgstr ""
32+
33+
#: templates/log_viewer/logfile_viewer.html:45
34+
msgid "No."
35+
msgstr ""
36+
37+
#: templates/log_viewer/logfile_viewer.html:46
38+
msgid "Log entries"
39+
msgstr ""
40+
41+
#: templates/log_viewer/logfile_viewer.html:50
42+
msgid "No entries!"
43+
msgstr ""
657 Bytes
Binary file not shown.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2019-07-09 19:54+0700\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <[email protected]>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
"Plural-Forms: nplurals=1; plural=0;\n"
20+
21+
#: templates/log_viewer/logfile_viewer.html:6
22+
msgid "Home"
23+
msgstr "Beranda"
24+
25+
#: templates/log_viewer/logfile_viewer.html:8
26+
msgid "Log Viewer"
27+
msgstr "Penampil Log"
28+
29+
#: templates/log_viewer/logfile_viewer.html:36
30+
msgid "Log Files"
31+
msgstr "File log"
32+
33+
#: templates/log_viewer/logfile_viewer.html:45
34+
msgid "No."
35+
msgstr "No."
36+
37+
#: templates/log_viewer/logfile_viewer.html:46
38+
msgid "Log entries"
39+
msgstr "Entri log"
40+
41+
#: templates/log_viewer/logfile_viewer.html:50
42+
msgid "No entries!"
43+
msgstr "Tidak ada entri!"
44+
45+
#~ msgid "No anything to show !"
46+
#~ msgstr "Tidak ada sesuatu untuk ditampilkan !"

log_viewer/templates/log_viewer/logfile_viewer.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ <h2>{% trans 'Log Files' %}</h2>
4141
<div class="results">
4242
<table id="log-entries" class="display" style="width:100%">
4343
<thead>
44-
<tr><th scope="col">{% trans 'Log entries' %}</th></tr>
44+
<tr>
45+
<th scope="col">{% trans 'No.' %}</th>
46+
<th scope="col">{% trans 'Log entries' %}</th>
47+
</tr>
4548
</thead>
49+
<tbody>
50+
<tr><td colspan="2">{% trans 'No entries!' %}</td></tr>
51+
</tbody>
4652
</table>
4753
</div>
4854
</form>
@@ -54,6 +60,7 @@ <h2>{% trans 'Log Files' %}</h2>
5460
function loadDataTableTrigger(table_name, url_json) {
5561
$(table_name).DataTable({
5662
pageLength: '{{ page_length }}',
63+
columns: [{data: 0}, {data: 1}],
5764
ajax: function (data, callback, settings) {
5865
$.ajax({
5966
type: 'get',
@@ -62,8 +69,8 @@ <h2>{% trans 'Log Files' %}</h2>
6269
const new_logs = [];
6370
var next_page = response.next_page || 1;
6471

65-
response.logs.forEach(function(text){
66-
new_logs.push([text])
72+
response.logs.forEach(function(text, numb, logs){
73+
new_logs.push([numb, text])
6774
});
6875

6976
callback({
3.84 KB
Loading

runtests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
TEMPLATES=[{
2626
'BACKEND': 'django.template.backends.django.DjangoTemplates',
2727
'DIRS': [
28-
os.path.join(BASE_DIR, 'django-markdown-editor/martor/templates'),
29-
os.path.join(BASE_DIR, 'django-markdown-editor/martor/tests/templates'),
28+
os.path.join(BASE_DIR, 'django-log-viewer/log_viewer/templates'),
3029
],
3130
'APP_DIRS': True,
3231
'OPTIONS': {

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from setuptools import (setup, find_packages)
55

6-
__version__ = '1.0.3'
6+
__version__ = '1.0.4'
77

88
setup(
99
name='django-log-viewer',

0 commit comments

Comments
 (0)