Merge branch 'hotfix/v0.12.2' into development

Conflicts:
	apps/common/__init__.py
	apps/documents/forms.py
	apps/feedback/__init__.py
	apps/history/__init__.py
	apps/main/__init__.py
	apps/scheduler/api.py
	apps/sources/models.py
	docs/releases/index.rst
	requirements/production.txt
	settings.py
	urls.py
This commit is contained in:
Roberto Rosario
2012-06-30 04:00:01 -04:00
438 changed files with 12762 additions and 4473 deletions

View File

@@ -3,8 +3,28 @@ from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from project_tools.api import register_tool
from navigation.api import Link
from navigation.api import register_model_list_columns, register_links
from common.utils import encapsulate
from .permissions import PERMISSION_HISTORY_VIEW
from .models import History
from .widgets import history_entry_summary, history_entry_type_link
from .links import history_list, history_details
register_tool(history_list)
register_tool(Link(text=_(u'history'), view='history_list', sprite='book', icon='book.png', permissions=[PERMISSION_HISTORY_VIEW], children_view_regex=[r'history_[l,v]']))
register_model_list_columns(History, [
{
'name': _(u'date and time'),
'attribute': 'datetime'
},
{
'name': _(u'type'),
'attribute': encapsulate(lambda entry: history_entry_type_link(entry))
},
{
'name': _(u'summary'),
'attribute': encapsulate(lambda entry: unicode(entry.get_processed_summary()))
}
])
register_links(History, [history_details])

View File

@@ -32,7 +32,7 @@ def register_history_type(history_type_dict):
'label': history_type_dict['label'],
'summary': history_type_dict.get('summary', u''),
'details': history_type_dict.get('details', u''),
'expressions': history_type_dict.get('expressions', []),
'expressions': history_type_dict.get('expressions', {}),
}

10
apps/history/links.py Normal file
View File

@@ -0,0 +1,10 @@
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from navigation.api import Link
from .permissions import PERMISSION_HISTORY_VIEW
history_list = Link(text=_(u'history'), view='history_list', sprite='book', icon='book.png', permissions=[PERMISSION_HISTORY_VIEW], children_view_regex=[r'history_[l,v]'])
history_details = Link(text=_(u'details'), view='history_view', sprite='book_open', args='object.pk', permissions=[PERMISSION_HISTORY_VIEW])

Binary file not shown.

View File

@@ -0,0 +1,122 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# <tetja.rediske@googlemail.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: Mayan EDMS\n"
"Report-Msgid-Bugs-To: http://github.com/rosarior/mayan/issues\n"
"POT-Creation-Date: 2012-06-17 18:09-0400\n"
"PO-Revision-Date: 2012-06-17 22:12+0000\n"
"Last-Translator: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>\n"
"Language-Team: German (Germany) (http://www.transifex.net/projects/p/mayan-edms/language/de_DE/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de_DE\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: __init__.py:17
msgid "date and time"
msgstr "Datum und Uhrzeit"
#: __init__.py:21
msgid "type"
msgstr ""
#: __init__.py:25
msgid "summary"
msgstr "Zusammenfassung"
#: links.py:7 models.py:78
msgid "history"
msgstr "Verlauf"
#: links.py:8
msgid "details"
msgstr ""
#: models.py:18
msgid "namespace"
msgstr "Namensraum"
#: models.py:19
msgid "name"
msgstr "Name"
#: models.py:34 models.py:43
msgid "history type"
msgstr "Verlaufs Typ"
#: models.py:35
msgid "history types"
msgstr "Verlaufs Typen"
#: models.py:39
msgid "date time"
msgstr "Datum Uhrzeit"
#: models.py:44
msgid "dictionary"
msgstr "Wörterbuch"
#: models.py:79
msgid "histories"
msgstr "Verläufe"
#: permissions.py:7
msgid "History"
msgstr "Verlauf"
#: permissions.py:8
msgid "Access the history of an object"
msgstr "Zugriff auf den Verlauf eine Objekts"
#: views.py:37
msgid "history events"
msgstr "Verlaufs Ereignis"
#: views.py:40
msgid "object link"
msgstr ""
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr "Verlauf Ereignisse für: %s"
#: views.py:86
msgid "Date"
msgstr "Datum"
#: views.py:87
msgid "Time"
msgstr "Zeit"
#: views.py:88
msgid "Object"
msgstr "Objekt"
#: views.py:89
msgid "Event type"
msgstr "Ereignis Typ"
#: views.py:90
msgid "Additional details"
msgstr ""
#: views.py:90
msgid "None"
msgstr ""
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr "Details für: %s"
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr ""

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-02-12 15:20-0400\n"
"POT-Creation-Date: 2012-06-17 19:02-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,10 +17,26 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: __init__.py:10 models.py:71
#: __init__.py:17
msgid "date and time"
msgstr ""
#: __init__.py:21
msgid "type"
msgstr ""
#: __init__.py:25
msgid "summary"
msgstr ""
#: links.py:7 models.py:78
msgid "history"
msgstr ""
#: links.py:8
msgid "details"
msgstr ""
#: models.py:18
msgid "namespace"
msgstr ""
@@ -29,23 +45,23 @@ msgstr ""
msgid "name"
msgstr ""
#: models.py:27 models.py:36
#: models.py:34 models.py:43
msgid "history type"
msgstr ""
#: models.py:28
#: models.py:35
msgid "history types"
msgstr ""
#: models.py:32
#: models.py:39
msgid "date time"
msgstr ""
#: models.py:37
#: models.py:44
msgid "dictionary"
msgstr ""
#: models.py:72
#: models.py:79
msgid "histories"
msgstr ""
@@ -57,48 +73,49 @@ msgstr ""
msgid "Access the history of an object"
msgstr ""
#: views.py:27
#: views.py:37
msgid "history events"
msgstr ""
#: views.py:30 views.py:67
msgid "date and time"
#: views.py:40
msgid "object link"
msgstr ""
#: views.py:34
msgid "object"
msgstr ""
#: views.py:38 views.py:71
msgid "summary"
msgstr ""
#: views.py:63
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr ""
#: views.py:91
#: views.py:86
msgid "Date"
msgstr ""
#: views.py:92
#: views.py:87
msgid "Time"
msgstr ""
#: views.py:93
#: views.py:88
msgid "Object"
msgstr ""
#: views.py:94
#: views.py:89
msgid "Event type"
msgstr ""
#: views.py:95
msgid "Event details"
#: views.py:90
msgid "Additional details"
msgstr ""
#: views.py:99
#: views.py:90
msgid "None"
msgstr ""
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr ""
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr ""

View File

@@ -1,27 +1,43 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
#
# Translators:
# Roberto Rosario <roberto.rosario.gonzalez@gmail.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: Mayan EDMS\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-02-12 15:20-0400\n"
"PO-Revision-Date: 2012-02-02 18:19+0000\n"
"Report-Msgid-Bugs-To: http://github.com/rosarior/mayan/issues\n"
"POT-Creation-Date: 2012-06-17 18:09-0400\n"
"PO-Revision-Date: 2012-06-17 22:24+0000\n"
"Last-Translator: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>\n"
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/"
"mayan-edms/team/es/)\n"
"Language: es\n"
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/mayan-edms/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: __init__.py:10 models.py:71
#: __init__.py:17
msgid "date and time"
msgstr "fecha y hora"
#: __init__.py:21
msgid "type"
msgstr "tipo"
#: __init__.py:25
msgid "summary"
msgstr "resumen"
#: links.py:7 models.py:78
msgid "history"
msgstr "historial"
#: links.py:8
msgid "details"
msgstr "detalles"
#: models.py:18
msgid "namespace"
msgstr "espacio de nombres"
@@ -30,23 +46,23 @@ msgstr "espacio de nombres"
msgid "name"
msgstr "nombre"
#: models.py:27 models.py:36
#: models.py:34 models.py:43
msgid "history type"
msgstr "tipo de historial"
#: models.py:28
#: models.py:35
msgid "history types"
msgstr "tipos de la historiales"
#: models.py:32
#: models.py:39
msgid "date time"
msgstr "fecha y hora"
#: models.py:37
#: models.py:44
msgid "dictionary"
msgstr "diccionario"
#: models.py:72
#: models.py:79
msgid "histories"
msgstr "historiales"
@@ -56,50 +72,51 @@ msgstr "Historial"
#: permissions.py:8
msgid "Access the history of an object"
msgstr ""
msgstr "Accesar la historia de un objeto"
#: views.py:27
#: views.py:37
msgid "history events"
msgstr "eventos de historial"
#: views.py:30 views.py:67
msgid "date and time"
msgstr "fecha y hora"
#: views.py:40
msgid "object link"
msgstr "enlace al objeto"
#: views.py:34
msgid "object"
msgstr "objeto"
#: views.py:38 views.py:71
msgid "summary"
msgstr "resumen"
#: views.py:63
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr "eventos de historial para: %s"
#: views.py:91
#: views.py:86
msgid "Date"
msgstr "Fecha"
#: views.py:92
#: views.py:87
msgid "Time"
msgstr "Tiempo"
#: views.py:93
#: views.py:88
msgid "Object"
msgstr "Objeto"
#: views.py:94
#: views.py:89
msgid "Event type"
msgstr "Tipo de evento"
#: views.py:95
msgid "Event details"
msgstr "Detalles del evento"
#: views.py:90
msgid "Additional details"
msgstr "Detalles adicionales"
#: views.py:99
#: views.py:90
msgid "None"
msgstr "Ninguno"
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr "Detalles para: %s"
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr "eventos de historia de tipo: %s"

View File

@@ -9,9 +9,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Mayan EDMS\n"
"Report-Msgid-Bugs-To: http://github.com/rosarior/mayan/issues\n"
"POT-Creation-Date: 2012-02-12 15:20-0400\n"
"PO-Revision-Date: 2012-03-21 13:30+0000\n"
"Last-Translator: Pierpaolo Baldan <pierpaolo.baldan@gmail.com>\n"
"POT-Creation-Date: 2012-06-17 18:09-0400\n"
"PO-Revision-Date: 2012-06-17 22:12+0000\n"
"Last-Translator: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.net/projects/p/mayan-edms/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,10 +19,26 @@ msgstr ""
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: __init__.py:10 models.py:71
#: __init__.py:17
msgid "date and time"
msgstr "data e orario"
#: __init__.py:21
msgid "type"
msgstr ""
#: __init__.py:25
msgid "summary"
msgstr "sommario"
#: links.py:7 models.py:78
msgid "history"
msgstr "versioni"
#: links.py:8
msgid "details"
msgstr ""
#: models.py:18
msgid "namespace"
msgstr "namespace"
@@ -31,23 +47,23 @@ msgstr "namespace"
msgid "name"
msgstr "nome"
#: models.py:27 models.py:36
#: models.py:34 models.py:43
msgid "history type"
msgstr "Tipo versione"
#: models.py:28
#: models.py:35
msgid "history types"
msgstr "Tipi di versioni"
#: models.py:32
#: models.py:39
msgid "date time"
msgstr "data"
#: models.py:37
#: models.py:44
msgid "dictionary"
msgstr "dizionario"
#: models.py:72
#: models.py:79
msgid "histories"
msgstr "cronologie"
@@ -59,48 +75,49 @@ msgstr "Versioni"
msgid "Access the history of an object"
msgstr "Accedi alla storia di un oggetto"
#: views.py:27
#: views.py:37
msgid "history events"
msgstr "eventi cronologia"
#: views.py:30 views.py:67
msgid "date and time"
msgstr "data e orario"
#: views.py:40
msgid "object link"
msgstr ""
#: views.py:34
msgid "object"
msgstr "oggetto"
#: views.py:38 views.py:71
msgid "summary"
msgstr "sommario"
#: views.py:63
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr "cronologia per gli eventi per: %s"
#: views.py:91
#: views.py:86
msgid "Date"
msgstr "Data"
#: views.py:92
#: views.py:87
msgid "Time"
msgstr "Orario"
#: views.py:93
#: views.py:88
msgid "Object"
msgstr "Oggetto"
#: views.py:94
#: views.py:89
msgid "Event type"
msgstr "Tipo evento"
#: views.py:95
msgid "Event details"
msgstr "Dettaglio evento"
#: views.py:90
msgid "Additional details"
msgstr ""
#: views.py:99
#: views.py:90
msgid "None"
msgstr ""
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr "dettaglio per:%s"
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr ""

View File

@@ -10,9 +10,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Mayan EDMS\n"
"Report-Msgid-Bugs-To: http://github.com/rosarior/mayan/issues\n"
"POT-Creation-Date: 2012-02-12 15:20-0400\n"
"PO-Revision-Date: 2012-02-21 14:46+0000\n"
"Last-Translator: mic <winterfall24@gmail.com>\n"
"POT-Creation-Date: 2012-06-17 18:09-0400\n"
"PO-Revision-Date: 2012-06-17 22:12+0000\n"
"Last-Translator: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.net/projects/p/mayan-edms/language/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -20,10 +20,26 @@ msgstr ""
"Language: pl\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
#: __init__.py:10 models.py:71
#: __init__.py:17
msgid "date and time"
msgstr "data i godzina"
#: __init__.py:21
msgid "type"
msgstr ""
#: __init__.py:25
msgid "summary"
msgstr "streszczenie"
#: links.py:7 models.py:78
msgid "history"
msgstr "historia"
#: links.py:8
msgid "details"
msgstr ""
#: models.py:18
msgid "namespace"
msgstr "przestrzeń nazw"
@@ -32,23 +48,23 @@ msgstr "przestrzeń nazw"
msgid "name"
msgstr "nazwa"
#: models.py:27 models.py:36
#: models.py:34 models.py:43
msgid "history type"
msgstr "typ historii"
#: models.py:28
#: models.py:35
msgid "history types"
msgstr "typy historii"
#: models.py:32
#: models.py:39
msgid "date time"
msgstr "data i godzina"
#: models.py:37
#: models.py:44
msgid "dictionary"
msgstr "słownik"
#: models.py:72
#: models.py:79
msgid "histories"
msgstr "historie"
@@ -60,48 +76,49 @@ msgstr "Historia"
msgid "Access the history of an object"
msgstr "Dostęp do historii obiektu"
#: views.py:27
#: views.py:37
msgid "history events"
msgstr "historia wydarzeń"
#: views.py:30 views.py:67
msgid "date and time"
msgstr "data i godzina"
#: views.py:40
msgid "object link"
msgstr ""
#: views.py:34
msgid "object"
msgstr "obiekt"
#: views.py:38 views.py:71
msgid "summary"
msgstr "streszczenie"
#: views.py:63
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr "zdarzenia historii dla:%s"
#: views.py:91
#: views.py:86
msgid "Date"
msgstr "Data"
#: views.py:92
#: views.py:87
msgid "Time"
msgstr "Czas"
#: views.py:93
#: views.py:88
msgid "Object"
msgstr "Obiekt"
#: views.py:94
#: views.py:89
msgid "Event type"
msgstr "Typ zdarzenia"
#: views.py:95
msgid "Event details"
msgstr "Szczegóły wydarzenia"
#: views.py:90
msgid "Additional details"
msgstr ""
#: views.py:99
#: views.py:90
msgid "None"
msgstr ""
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr "szczegóły dla %s"
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr ""

View File

@@ -1,28 +1,43 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
#
# Translators:
# <dev.emerson@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Mayan EDMS\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-02-12 15:20-0400\n"
"PO-Revision-Date: 2012-02-02 18:19+0000\n"
"Report-Msgid-Bugs-To: http://github.com/rosarior/mayan/issues\n"
"POT-Creation-Date: 2012-06-17 18:09-0400\n"
"PO-Revision-Date: 2012-06-17 22:12+0000\n"
"Last-Translator: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>\n"
"Language-Team: Portuguese (http://www.transifex.net/projects/p/mayan-edms/"
"team/pt/)\n"
"Language: pt\n"
"Language-Team: Portuguese (http://www.transifex.net/projects/p/mayan-edms/language/pt/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pt\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
#: __init__.py:10 models.py:71
#: __init__.py:17
msgid "date and time"
msgstr "data e hora"
#: __init__.py:21
msgid "type"
msgstr ""
#: __init__.py:25
msgid "summary"
msgstr "sumário"
#: links.py:7 models.py:78
msgid "history"
msgstr "história"
#: links.py:8
msgid "details"
msgstr ""
#: models.py:18
msgid "namespace"
msgstr "namespace"
@@ -31,23 +46,23 @@ msgstr "namespace"
msgid "name"
msgstr "nome"
#: models.py:27 models.py:36
#: models.py:34 models.py:43
msgid "history type"
msgstr "tipo de história"
#: models.py:28
#: models.py:35
msgid "history types"
msgstr "tipos de história"
#: models.py:32
#: models.py:39
msgid "date time"
msgstr "hora, data"
#: models.py:37
#: models.py:44
msgid "dictionary"
msgstr "dicionário"
#: models.py:72
#: models.py:79
msgid "histories"
msgstr "histórias"
@@ -59,48 +74,49 @@ msgstr "História"
msgid "Access the history of an object"
msgstr ""
#: views.py:27
#: views.py:37
msgid "history events"
msgstr "eventos da história"
#: views.py:30 views.py:67
msgid "date and time"
msgstr "data e hora"
#: views.py:40
msgid "object link"
msgstr ""
#: views.py:34
msgid "object"
msgstr "objeto"
#: views.py:38 views.py:71
msgid "summary"
msgstr "sumário"
#: views.py:63
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr "eventos de história para: %s"
#: views.py:91
#: views.py:86
msgid "Date"
msgstr "Data"
#: views.py:92
#: views.py:87
msgid "Time"
msgstr "Tempo"
#: views.py:93
#: views.py:88
msgid "Object"
msgstr "Objeto"
#: views.py:94
#: views.py:89
msgid "Event type"
msgstr "Tipo de evento"
#: views.py:95
msgid "Event details"
msgstr "Detalhes do evento"
#: views.py:90
msgid "Additional details"
msgstr ""
#: views.py:99
#: views.py:90
msgid "None"
msgstr ""
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr "detalhes para: %s"
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr ""

View File

@@ -1,28 +1,43 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
#
# Translators:
# Sergey Glita <gsv70@mail.ru>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: Mayan EDMS\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-02-12 15:20-0400\n"
"PO-Revision-Date: 2012-02-02 18:19+0000\n"
"Report-Msgid-Bugs-To: http://github.com/rosarior/mayan/issues\n"
"POT-Creation-Date: 2012-06-17 18:09-0400\n"
"PO-Revision-Date: 2012-06-17 22:12+0000\n"
"Last-Translator: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/mayan-edms/team/"
"ru/)\n"
"Language: ru\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/mayan-edms/language/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
"Language: ru\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
#: __init__.py:10 models.py:71
#: __init__.py:17
msgid "date and time"
msgstr "дата и время"
#: __init__.py:21
msgid "type"
msgstr ""
#: __init__.py:25
msgid "summary"
msgstr "итого"
#: links.py:7 models.py:78
msgid "history"
msgstr "история"
#: links.py:8
msgid "details"
msgstr ""
#: models.py:18
msgid "namespace"
msgstr "пространство имен"
@@ -31,23 +46,23 @@ msgstr "пространство имен"
msgid "name"
msgstr "имя"
#: models.py:27 models.py:36
#: models.py:34 models.py:43
msgid "history type"
msgstr "тип истории"
#: models.py:28
#: models.py:35
msgid "history types"
msgstr "типы истории"
#: models.py:32
#: models.py:39
msgid "date time"
msgstr "дата и время"
#: models.py:37
#: models.py:44
msgid "dictionary"
msgstr "словарь"
#: models.py:72
#: models.py:79
msgid "histories"
msgstr "истории"
@@ -57,50 +72,51 @@ msgstr "История"
#: permissions.py:8
msgid "Access the history of an object"
msgstr ""
msgstr "История объекта"
#: views.py:27
#: views.py:37
msgid "history events"
msgstr "события"
#: views.py:30 views.py:67
msgid "date and time"
msgstr "дата и время"
#: views.py:40
msgid "object link"
msgstr ""
#: views.py:34
msgid "object"
msgstr "объект"
#: views.py:38 views.py:71
msgid "summary"
msgstr "итого"
#: views.py:63
#: views.py:68
#, python-format
msgid "history events for: %s"
msgstr "события для: %s"
#: views.py:91
#: views.py:86
msgid "Date"
msgstr "Дата"
#: views.py:92
#: views.py:87
msgid "Time"
msgstr "Время"
#: views.py:93
#: views.py:88
msgid "Object"
msgstr "Объект"
#: views.py:94
#: views.py:89
msgid "Event type"
msgstr "Тип события"
#: views.py:95
msgid "Event details"
msgstr "Подробности события"
#: views.py:90
msgid "Additional details"
msgstr ""
#: views.py:99
#: views.py:90
msgid "None"
msgstr ""
#: views.py:94
#, python-format
msgid "details for: %s"
msgstr "подробности: %s"
#: views.py:106
#, python-format
msgid "history events of type: %s"
msgstr ""

View File

@@ -19,7 +19,14 @@ class HistoryType(models.Model):
name = models.CharField(max_length=64, verbose_name=_(u'name'))
def __unicode__(self):
return u'%s - %s' % (self.namespace, self.name)
try:
return unicode(history_types_dict[self.namespace][self.name]['label'])
except KeyError:
return u'obsolete history type: %s - %s' % (self.namespace, self.name)
@models.permalink
def get_absolute_url(self):
return ('history_type_list', [self.pk])
class Meta:
ordering = ('namespace', 'name')

View File

@@ -4,4 +4,5 @@ urlpatterns = patterns('history.views',
url(r'^list/$', 'history_list', (), 'history_list'),
url(r'^list/for_object/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<object_id>\d+)/$', 'history_for_object', (), 'history_for_object'),
url(r'^(?P<object_id>\d+)/$', 'history_view', (), 'history_view'),
url(r'^type/(?P<history_type_pk>\d+)/list/$', 'history_type_list', (), 'history_type_list'),
)

View File

@@ -13,35 +13,40 @@ from permissions.models import Permission
from common.utils import encapsulate
from acls.models import AccessEntry
from .models import History
from .models import History, HistoryType
from .forms import HistoryDetailForm
from .permissions import PERMISSION_HISTORY_VIEW
from .widgets import history_entry_object_link, history_entry_summary
def history_list(request):
Permission.objects.check_permissions(request.user, [PERMISSION_HISTORY_VIEW])
def history_list(request, object_list=None, title=None, extra_context=None):
pre_object_list = object_list if not (object_list is None) else History.objects.all()
try:
Permission.objects.check_permissions(request.user, [PERMISSION_HISTORY_VIEW])
except PermissionDenied:
# If user doesn't have global permission, get a list of document
# for which he/she does hace access use it to filter the
# provided object_list
final_object_list = AccessEntry.objects.filter_objects_by_access(PERMISSION_HISTORY_VIEW, request.user, pre_object_list, related='content_object')
else:
final_object_list = pre_object_list
context = {
'object_list': History.objects.all(),
'title': _(u'history events'),
'object_list': final_object_list,
'title': title if title else _(u'history events'),
'extra_columns': [
{
'name': _(u'date and time'),
'attribute': 'datetime'
},
{
'name': _(u'object'),
'name': _(u'object link'),
'attribute': encapsulate(lambda x: history_entry_object_link(x))
},
{
'name': _(u'summary'),
'attribute': encapsulate(lambda x: history_entry_summary(x))
}
],
'hide_object': True,
}
if extra_context:
context.update(extra_context)
return render_to_response('generic_list.html', context,
context_instance=RequestContext(request))
@@ -62,16 +67,6 @@ def history_for_object(request, app_label, module_name, object_id):
'object_list': History.objects.filter(content_type=content_type, object_id=object_id),
'title': _(u'history events for: %s') % content_object,
'object': content_object,
'extra_columns': [
{
'name': _(u'date and time'),
'attribute': 'datetime'
},
{
'name': _(u'summary'),
'attribute': encapsulate(lambda x: history_entry_summary(x))
}
],
'hide_object': True,
}
@@ -88,11 +83,11 @@ def history_view(request, object_id):
AccessEntry.objects.check_access(PERMISSION_HISTORY_VIEW, request.user, history.content_object)
form = HistoryDetailForm(instance=history, extra_fields=[
{'label': _(u'Date'), 'field':lambda x: x.datetime.date()},
{'label': _(u'Time'), 'field':lambda x: unicode(x.datetime.time()).split('.')[0]},
{'label': _(u'Date'), 'field': lambda x: x.datetime.date()},
{'label': _(u'Time'), 'field': lambda x: unicode(x.datetime.time()).split('.')[0]},
{'label': _(u'Object'), 'field': 'content_object'},
{'label': _(u'Event type'), 'field': lambda x: x.get_label()},
{'label': _(u'Event details'), 'field': lambda x: x.get_processed_details()},
{'label': _(u'Additional details'), 'field': lambda x: x.get_processed_details() or _(u'None')},
])
return render_to_response('generic_detail.html', {
@@ -100,3 +95,13 @@ def history_view(request, object_id):
'form': form,
},
context_instance=RequestContext(request))
def history_type_list(request, history_type_pk):
history_type = get_object_or_404(HistoryType, pk=history_type_pk)
return history_list(
request,
object_list=History.objects.filter(history_type=history_type),
title=_(u'history events of type: %s') % history_type,
)

View File

@@ -14,3 +14,11 @@ def history_entry_summary(entry):
'url': entry.get_absolute_url(),
'label': unicode(entry.get_processed_summary())
})
def history_entry_type_link(entry):
return mark_safe(u'<a href="%(url)s">%(label)s</a>' % {
'url': entry.history_type.get_absolute_url(),
'label': unicode(entry.history_type)
}
)