Skip to content

Commit

Permalink
Change the Originator column to contain data from the custodian field
Browse files Browse the repository at this point in the history
This closes issue #12.
  • Loading branch information
Homme Zwaagstra committed Jan 22, 2014
1 parent 7f3f475 commit 0b15709
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions python/medin/dws.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def to_list(field):
'topic-category': i.TopicCategory,
'lineage': i.Lineage,
'public-access': i.LimitationsPublicAccess,
'originator': i.DataOriginator,
'custodian': i.DataCustodian,
'format': i.OriginalFormatName,
'online-resource': i.ResourceLocator,
'parameters': to_list(i.Parameters)}
Expand Down Expand Up @@ -305,7 +305,7 @@ class OrderAnalyser(object):
_field_map = {'updated': 'DatasetMetadataUpdateDate',
'title': 'DiscoveryTitle',
'online-resource': 'ResourceLocator',
'originator': 'DataCenter'}
'custodian': 'DataCenter'}

def __init__(self, field, ascending):
try:
Expand Down
6 changes: 3 additions & 3 deletions python/medin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get_query(environ, from_referrer=False):
else:
qsl = ''

fields = ('updated', 'originator', 'title', 'online-resource')
fields = ('updated', 'custodian', 'title', 'online-resource')
return Query(qsl, get_areas(environ), fields, get_vocab(environ), get_db(environ))

def get_areas(environ):
Expand Down Expand Up @@ -755,7 +755,7 @@ def __call__(self, environ, start_response):
'Authors',
'URL',
'Abstract',
'Originator',
'Custodian',
'Resource type',
'Topic category',
'Lineage',
Expand All @@ -775,7 +775,7 @@ def __call__(self, environ, start_response):
'; '.join(result['authors']),
url,
result['abstract'],
result['originator'],
result['custodian'],
result['resource-type'],
result['topic-category'],
result['lineage'],
Expand Down
2 changes: 1 addition & 1 deletion templates/atom/catalogue/base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<entry>
<title>${result['title'] | x}</title>
<author>
<name>${result['originator'] | x}</name>
<name>${result['custodian'] | x}</name>
</author>
<updated>${isoformat(result['updated'])}</updated>
<link href="${script_root}/${self.attr.template}/catalogue/${result['id'] | x}"/>
Expand Down
2 changes: 1 addition & 1 deletion templates/common/feeds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if bboxes:
</%def>

<%def name="content(entry)">
&lt;strong&gt;Originator:&lt;/strong&gt; ${entry['originator'] | x}&lt;br/&gt;
&lt;strong&gt;Custodian:&lt;/strong&gt; ${entry['custodian'] | x}&lt;br/&gt;
&lt;strong&gt;Last updated:&lt;/strong&gt; ${dateformat(entry['updated']) | x}
&lt;p&gt;${entry['abstract'] | x}&lt;/p&gt;
</%def>
4 changes: 2 additions & 2 deletions templates/full/catalogue.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ <h4 class="box"><a href="javascript:toggle_fieldset('geographic-coverage')" titl
<thead>
<tr>
<th colspan="2">${sort_links('Title', 'title')}</th>
<th>${sort_links('Originator', 'originator')}</th>
<th>${sort_links('Custodian', 'custodian')}</th>
<th>${sort_links('Metadata update date', 'updated')}</th>
<th>${sort_links('Online resource', 'online-resource')}</th>
</tr>
Expand All @@ -351,7 +351,7 @@ <h4 class="box"><a href="javascript:toggle_fieldset('geographic-coverage')" titl
%endif
<td>${start_index+i}.</td>
<td><a href="${script_root}/full/catalogue/${res['id'] | x}" title="${res['title'] | x}">${res['title'] | x}</a></td>
<td>${res['originator'] | x}</td>
<td>${res['custodian'] | x}</td>
<td>${res['updated'].strftime("%a %d %b %Y")}</td>
<td>
% if res['online-resource']:
Expand Down
4 changes: 2 additions & 2 deletions templates/light/catalogue.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h3>Related searches</h3>
%endif
">
<strong>${start_index+i}.</strong> <a href="${script_root}/light/catalogue/${res['id'] | x}" title="${res['title'] | x}">${res['title'] | x}</a>
<div title="Originator">${res['originator'] | x}</div>
<div title="Custodian">${res['custodian'] | x}</div>
<div title="Metadata update date"><em>${res['updated'].strftime("%a %d %b %Y")}</em></div>
</div>
% endfor
Expand All @@ -201,7 +201,7 @@ <h3>Related searches</h3>
<input type="hidden" name="${k}" value="${v | h}"/>
% endfor
<select name="s">
% for cid, name in (('updated', 'Metadata update date'), ('title', 'Title'), ('originator', 'Originator')):
% for cid, name in (('updated', 'Metadata update date'), ('title', 'Title'), ('custodian', 'Custodian')):
% for i, order in enumerate(('desc', 'asc')):
<% value = '%s,%d' % (cid, i) %>\
<option value="${value}"\
Expand Down

0 comments on commit 0b15709

Please sign in to comment.