Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/okfn/ckan
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed May 9, 2012
2 parents 20d06d6 + b2e896e commit f59be8a
Show file tree
Hide file tree
Showing 7 changed files with 580 additions and 18 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
18 changes: 9 additions & 9 deletions ckan/templates/home/index.html
Expand Up @@ -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
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 f59be8a

Please sign in to comment.