Move last active user logic to helper function
[ckanext-datagovau.git] / ckanext / datagovau / templates / package / read.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{% ckan_extends %}
 
{% block package_additional_info %}
<section class="additional-info" xmlns:dcat="http://www.w3.org/ns/dcat#"
         xmlns:dcam="http://purl.org/dc/dcam/"
         xmlns:aglsterms="http://www.agls.gov.au/agls/terms/"
         xmlns:agentterms="http://www.agls.gov.au/agls/agentterms/"
         xmlns:availterms="http://www.agls.gov.au/agls/availterms/"
         xmlns:adminterms="http://www.agls.gov.au/agls/adminterms/"
         xmlns:dct="http://purl.org/dc/terms/">
    <h3>{{ _('Additional Info') }}</h3>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
        <tr>
            <th scope="col">{{ _('Field') }}</th>
            <th scope="col">{{ _('Value') }}</th>
        </tr>
        </thead>
        <tbody>
 
 
        {# Add our custom field to the dataset read page. #}
        {% if pkg.get('metadata_created') %}
        <tr>
            <th scope="row" class="dataset-label">Date Published</th>
            <td class="dataset-details" property="dct:issued">{{ pkg.metadata_created.split("T")[0] }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('metadata_updated') %}
        <tr>
            <th scope="row" class="dataset-label">Date Updated</th>
            <td class="dataset-details" property="dct:updated">{{ pkg.metadata_updated.split("T")[0] }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('agency_program') %}
        <tr>
            <th scope="row" class="dataset-label">Agency Program</th>
            <td class="dataset-details"> {{ pkg.agency_program }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('Agency Program') %}
        <tr>
            <th scope="row" class="dataset-label">Agency Program</th>
            <td class="dataset-details"> {{ pkg.get('Agency Program') }}</td>
        </tr>
        {% endif %}
        {% if h.get_pkg_dict_extra(pkg,'DCTERMS.Source.URI') %}
        <tr>
            <th scope="row" class="dataset-label">{{ _('Source') }}</th>
            <td class="dataset-details" property="dct:source">{{ h.link_to(h.get_pkg_dict_extra(pkg,'DCTERMS.Source.URI'),
                h.get_pkg_dict_extra(pkg,'DCTERMS.Source.URI'), rel='dct:source', target='_blank') }}
            </td>
        </tr>
        {% endif %}
 
        {% if pkg.get('contact_point') %}
        <tr>
            <th scope="row" class="dataset-label">Contact Point</th>
            <td class="dataset-details" property="dcat:contactPoint"> {{ h.mail_to(email_address=pkg.contact_point,
                name=pkg.contact_point) }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('spatial_coverage') %}
 
        <tr>
            <th scope="row" class="dataset-label">Geospatial Coverage</th>
            <td class="dataset-details" property="dct:spatial"> {{ pkg.spatial_coverage }}</td>
        </tr>
        {% endif %}
        {% if h.get_pkg_dict_extra(pkg,'Geospatial Coverage') %}
 
        <tr>
            <th scope="row" class="dataset-label">Geospatial Coverage</th>
            <td class="dataset-details" property="dct:spatial"> {{ h.get_pkg_dict_extra(pkg,'Geospatial Coverage') }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('granularity') %}
 
        <tr>
            <th scope="row" class="dataset-label">Data Granularity</th>
            <td class="dataset-details"> {{ pkg.granularity }}</td>
        </tr>
        {% endif %}
        {% if h.get_pkg_dict_extra(pkg,'Granularity') %}
 
        <tr>
            <th scope="row" class="dataset-label">Data Granularity</th>
            <td class="dataset-details"> {{ h.get_pkg_dict_extra(pkg,'Granularity') }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('jurisdiction') %}
 
        <tr>
            <th scope="row" class="dataset-label">Government Jurisdiction</th>
            <td class="dataset-details" property="aglsterms:AglsJuri"> {{ pkg.jurisdiction }}</td>
        </tr>
        {% endif %}
        {% if h.get_pkg_dict_extra(pkg,'AGLSTERMS.Jurisdiction') %}
 
        <tr>
            <th scope="row" class="dataset-label">Government Jurisdiction</th>
            <td class="dataset-details" property="aglsterms:AglsJuri"> {{ h.get_pkg_dict_extra(pkg,'AGLSTERMS.Jurisdiction') }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('temporal_coverage') %}
 
        <tr>
            <th scope="row" class="dataset-label">Temporal Coverage</th>
            <td class="dataset-details" property="dct:temporal"> {{ pkg.temporal_coverage }}</td>
        </tr>
        {% endif %}
        {% if h.get_pkg_dict_extra(pkg,'Temporal Coverage') %}
 
        <tr>
            <th scope="row" class="dataset-label">Temporal Coverage</th>
            <td class="dataset-details" property="dct:temporal"> {{ h.get_pkg_dict_extra(pkg,'Temporal Coverage') }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('data_state') %}
 
        <tr>
            <th scope="row" class="dataset-label">Data State</th>
            <td class="dataset-details"> {{ pkg.data_state }}</td>
        </tr>
        {% endif %}
        {% if pkg.get('update_freq') %}
 
        <tr>
            <th scope="row" class="dataset-label">Update Frequency</th>
            <td class="dataset-details"> {{ pkg.update_freq }}</td>
        </tr>
        {% endif %}
        {% if h.get_pkg_dict_extra(pkg,'Update Frequency') %}
        <tr>
            <th scope="row" class="dataset-label">Update Frequency</th>
            <td class="dataset-details"> {{ h.get_pkg_dict_extra(pkg,'Update Frequency') }}</td>
        </tr>
        {% endif %}
 
{% set email =h.get_last_active_user(c.pkg_dict['id']).get('email','') %}
        <tr>
            <th scope="row" class="dataset-label">{{ _('Maintainer') }}</th>
            <td class="dataset-details" property="dc:contributor">{{
                  h.mail_to(email_address=(email or ' '), name=h.get_last_active_user(c.pkg_dict['id']).get("display_name",'')) }}
            </td>
        </tr>
        <tr>
            <th scope="row" class="dataset-label">Publisher/Agency</th>
            <td class="dataset-details" property="dc:publisher">{{ c.pkg_dict['organization']['title']}}
            </td>
        </tr>
        <tr>
            <th scope="row" class="dataset-label">Type</th>
            <td class="dataset-details" property="dc:type">Dataset</td>
        </tr>
        <tr>
            <th scope="row" class="dataset-label">Language</th>
            <td class="dataset-details" property="dc:language">English</td>
        </tr>
 
        </tbody>
    </table>
</section>
 
 
{% endblock %}