Skip to content

Commit

Permalink
Merge branch 'master' into enhancement-2371-fanstatic
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 9, 2012
2 parents c4e64ce + c33113b commit 56bf3d3
Show file tree
Hide file tree
Showing 14 changed files with 588 additions and 26 deletions.
7 changes: 4 additions & 3 deletions ckan/controllers/package.py
Expand Up @@ -452,16 +452,17 @@ def edit(self, id, data=None, errors=None, error_summary=None):
'user': c.user or c.author, 'extras_as_string': True,
'save': 'save' in request.params,
'moderated': config.get('moderated'),
'for_edit': True,
'pending': True,}

if context['save'] and not data:
return self._save_edit(id, context)
try:
c.pkg_dict = get_action('package_show')(context, {'id':id})
context['for_edit'] = True
old_data = get_action('package_show')(context, {'id':id})
# old data is from the database and data is passed from the
# user if there is a validation error. Use users data if there.
data = data or old_data
# Merge all elements for the complete package dictionary
c.pkg_dict = dict(old_data.items() + data.items())
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound:
Expand Down
7 changes: 4 additions & 3 deletions ckan/lib/dictization/model_dictize.py
Expand Up @@ -98,9 +98,10 @@ def resource_dictize(res, context):
if extras:
resource.update(extras)
#tracking
model = context['model']
tracking = model.TrackingSummary.get_for_resource(res.url)
resource['tracking_summary'] = tracking
if not context.get('for_edit'):
model = context['model']
tracking = model.TrackingSummary.get_for_resource(res.url)
resource['tracking_summary'] = tracking
return resource

def related_dictize(rel, context):
Expand Down
8 changes: 5 additions & 3 deletions ckan/public/css/style.css
Expand Up @@ -422,8 +422,11 @@ body.index.home .front-page .action-box {
background: #FFF7C0;
}
body.index.home .front-page .action-box-inner {
margin: 0 20px 5px;
min-height: 15em;
padding: 0 20px 20px;
min-height: 13.4em;
}
body.index.home .front-page .action-box-inner :last-child {
margin-bottom: 0;
}
body.index.home .front-page .action-box-inner.collaborate {
background:url(../img/collaborate.png) no-repeat right top;
Expand Down Expand Up @@ -456,7 +459,6 @@ body.index.home .front-page .action-box-inner .create-button {
float: right;
font-weight: normal;
font-family: 'Ubuntu';
margin-top: 1.5em;
border-radius: 10px;
background-color: #B22;
border: 0px;
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/group/edit.html
Expand Up @@ -4,7 +4,7 @@

<py:def function="page_title">Edit: ${c.group.display_name}</py:def>
<py:def function="page_heading">Edit: ${c.group.display_name}</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>


<div py:match="content" class="group-edit-form">
Expand Down
20 changes: 10 additions & 10 deletions ckan/templates/home/index.html
Expand Up @@ -4,7 +4,7 @@
py:strip=""
>

<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<py:def function="page_title">Welcome</py:def>

Expand All @@ -15,24 +15,24 @@ <h1 class="page_heading">Welcome to ${g.site_title}!</h1>
<div class="row">
<div class="span4">
<div class="action-box">
<div class="action-box-inner find">
<div class="action-box-inner find clearfix">
<h1>Find data</h1>

<form action="${h.url_for(controller='package', action='search')}" method="GET">
<input name="q" value="" class="search-field" placeholder="${_('Find datasets')}" />
</form>
${g.site_title} contains <a href="${h.url_for(controller='package', action='search')}">${c.package_count} datasets</a> that you can
browse, learn about and download.
<p>${g.site_title} contains <a href="${h.url_for(controller='package', action='search')}">${c.package_count} datasets</a> that you can
browse, learn about and download.</p>
</div>
</div>
</div>
<div class="span4">
<div class="action-box">
<div class="action-box-inner share">
<div class="action-box-inner share clearfix">
<h1>Share data</h1>

Add your own datasets to share them with others and
to find other people interested in your data.
<p>Add your own datasets to share them with others and
to find other people interested in your data.</p>

<py:choose test="h.check_access('package_create')">
<a py:when="" href="${h.url_for(controller='package', action='new')}" class="create-button">Create a dataset &raquo;</a>
Expand All @@ -45,11 +45,11 @@ <h1>Share data</h1>
</div>
<div class="span4">
<div class="action-box">
<div class="action-box-inner collaborate">
<div class="action-box-inner collaborate clearfix">
<h1>Collaborate</h1>

Find out more about working with open data by exploring
these resources:
<p>Find out more about working with open data by exploring
these resources:</p>
<ul>
<li><a href="http://getthedata.org">GetTheData.org</a></li>
<li><a href="http://datapatterns.org">DataPatterns.org</a></li>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/edit.html
Expand Up @@ -5,7 +5,7 @@

<py:def function="page_title">${c.pkg.title or c.pkg.name} - Edit - Datasets</py:def>
<py:def function="page_heading">Edit: ${c.pkg.title or c.pkg.name}</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<py:def function="optional_head">
<script>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/editresources.html
Expand Up @@ -5,7 +5,7 @@

<py:def function="page_title">${c.pkg.title or c.pkg.name} - Edit Resources - Datasets</py:def>
<py:def function="page_heading">Edit Resources: ${c.pkg.title or c.pkg.name}</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<py:def function="optional_head">
<script>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/history.html
Expand Up @@ -5,7 +5,7 @@

<py:def function="page_title">${c.pkg_dict.get('title', c.pkg_dict['name'])} - Datasets - History</py:def>
<py:def function="page_heading">History: ${c.pkg.title or c.pkg.name}</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<div py:match="content" class="dataset">
<h3>Revisions</h3>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/new.html
Expand Up @@ -6,7 +6,7 @@
<py:def function="page_title">Add - Datasets</py:def>
<py:def function="page_heading">Add a Dataset</py:def>

<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<py:def function="optional_head">
<script>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/revision/diff.html
Expand Up @@ -3,7 +3,7 @@
py:strip="">

<py:def function="page_title">Differences - Revisions</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<div py:match="content">
<h2>Revision Differences -
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/revision/list.html
Expand Up @@ -4,7 +4,7 @@

<py:def function="page_title">Revision History</py:def>
<py:def function="page_heading">Revision History</py:def>
<py:def function="body_class">no-sidebar</py:def>
<py:def function="body_class">${h.literal('no-sidebar')}</py:def>

<div py:match="content">
<p>Track the most recent changes to the system, with most recent
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Expand Up @@ -101,6 +101,7 @@ Other material
:maxdepth: 2

contrib.rst
user-stories
CHANGELOG.rst

Indices and tables
Expand Down

0 comments on commit 56bf3d3

Please sign in to comment.