diff --git a/src/data/templates/view_citation_detail.html b/src/data/templates/view_citation_detail.html index 65440e25b..8dccf11a6 100644 --- a/src/data/templates/view_citation_detail.html +++ b/src/data/templates/view_citation_detail.html @@ -10,6 +10,11 @@ document.location.hash = ui.panel.id; } }); + $('#shared-tabs').tabs({ + 'select': function(event, ui){ + document.location.hash = ui.panel.id; + } + }); }); @@ -36,6 +41,7 @@
  • Media
  • Data
  • References
  • +
  • History
  • @@ -73,6 +79,9 @@
    {% citation_reference_table citation user action %}
    +
    + {% history_table citation user action %} +

    Note: Any changes in the shared citation information will be reflected @@ -82,13 +91,14 @@


    Shared source information

    -
    +
    @@ -130,6 +140,9 @@
    {% citation_reference_table source user action %}
    +
    + {% history_table source user action %} +

    Note: Any changes in the shared source information will be reflected diff --git a/src/data/templates/view_event_detail.html b/src/data/templates/view_event_detail.html index 7b83f1ff9..f7028de77 100644 --- a/src/data/templates/view_event_detail.html +++ b/src/data/templates/view_event_detail.html @@ -57,6 +57,7 @@

  • Media
  • Attributes
  • References
  • +
  • History
  • {% citation_table event user action "/citation/$act/event/%s" event.handle %} @@ -73,6 +74,9 @@
    {% event_reference_table event user action %}
    +
    + {% history_table event user action %} +
    {% if user.is_superuser %} diff --git a/src/data/templates/view_family_detail.html b/src/data/templates/view_family_detail.html index 838c3c910..400523f79 100644 --- a/src/data/templates/view_family_detail.html +++ b/src/data/templates/view_family_detail.html @@ -103,6 +103,7 @@
  • Notes
  • Media
  • LDS
  • +
  • History
  • @@ -126,6 +127,9 @@
    {% lds_table family user action "/lds/add/family/%s" family.handle %}
    +
    + {% history_table family user action %} +
    {% if user.is_superuser %} diff --git a/src/data/templates/view_media_detail.html b/src/data/templates/view_media_detail.html index 2e7eadfc1..4bc318222 100644 --- a/src/data/templates/view_media_detail.html +++ b/src/data/templates/view_media_detail.html @@ -61,6 +61,7 @@
  • Attributes
  • Notes
  • References
  • +
  • History
  • {% citation_table media user action "/citation/$act/media/%s" media.handle %} @@ -74,6 +75,9 @@
    {% media_reference_table media user action %}
    +
    + {% history_table media user action %} +
    {% if user.is_superuser %} diff --git a/src/data/templates/view_note_detail.html b/src/data/templates/view_note_detail.html index 254e4367a..171bfc334 100644 --- a/src/data/templates/view_note_detail.html +++ b/src/data/templates/view_note_detail.html @@ -75,10 +75,14 @@
    {% note_reference_table note user action %}
    +
    + {% history_table note user action %} +
    diff --git a/src/data/templates/view_person_detail.html b/src/data/templates/view_person_detail.html index aa70376f4..ab4eb11ca 100644 --- a/src/data/templates/view_person_detail.html +++ b/src/data/templates/view_person_detail.html @@ -94,6 +94,7 @@
  • Associations
  • LDS
  • References
  • +
  • History
  • @@ -130,6 +131,9 @@
    {% person_reference_table person user action %}
    +
    + {% history_table person user action %} +
    {% if logform %} diff --git a/src/data/templates/view_place_detail.html b/src/data/templates/view_place_detail.html index 00d0113ff..bfdae9abf 100644 --- a/src/data/templates/view_place_detail.html +++ b/src/data/templates/view_place_detail.html @@ -57,6 +57,7 @@
  • Media
  • Internet
  • References
  • +
  • History
  • @@ -79,6 +80,9 @@
    {% place_reference_table place user action %}
    +
    + {% history_table place user action %} +
    diff --git a/src/data/templates/view_repository_detail.html b/src/data/templates/view_repository_detail.html index 24801125c..75df7da3d 100644 --- a/src/data/templates/view_repository_detail.html +++ b/src/data/templates/view_repository_detail.html @@ -52,6 +52,7 @@
  • Internet
  • Notes
  • References
  • +
  • History
  • {% address_table repository user action "/address/add/repository/%s" repository.handle %} @@ -65,6 +66,9 @@
    {% repository_reference_table repository user action %}
    +
    + {% history_table repository user action %} +
    {% if user.is_superuser %} diff --git a/src/data/templates/view_source_detail.html b/src/data/templates/view_source_detail.html index e278de513..6e16ea33c 100644 --- a/src/data/templates/view_source_detail.html +++ b/src/data/templates/view_source_detail.html @@ -58,6 +58,7 @@
  • Data
  • Repositories
  • References
  • +
  • History
  • {% note_table source user action "/note/$act/source/%s" source.handle %} @@ -74,6 +75,9 @@
    {% source_reference_table source user action %}
    +
    + {% history_table source user action %} +
    {% if user.is_superuser %} diff --git a/src/webapp/utils.py b/src/webapp/utils.py index cc8940e4a..c2cbda0ca 100644 --- a/src/webapp/utils.py +++ b/src/webapp/utils.py @@ -80,6 +80,7 @@ util_tags = [ 'render_name', "get_person_from_handle", "event_table", + "history_table", "name_table", "surname_table", "citation_table", @@ -325,6 +326,31 @@ def event_table(obj, user, action, url, args): retval += nbsp("") # to keep tabs same height return retval +def history_table(obj, user, action): + retval = "" + table = Table("history_table") + table.columns( + _("Action"), + _("Comment"), + ) + if user.is_authenticated(): + obj_type = ContentType.objects.get_for_model(obj) + for entry in models.Log.objects.filter( + object_id=obj.id, + object_type=obj_type): + table.row( + "%s on %s by %s" % (entry.log_type, + entry.last_changed, + entry.last_changed_by), + entry.reason) + table.row( + "Latest on %s by %s" % (obj.last_changed, + obj.last_changed_by), + "Current status") + retval += table.get_html() + retval += nbsp("") # to keep tabs same height + return retval + def name_table(obj, user, action, url=None, *args): retval = "" table = Table("name_table")