Skip to content

Commit

Permalink
[#1396,user/read][s]: list datasets using new datasets attribute in u…
Browse files Browse the repository at this point in the history
…ser dict.

* Plus a little bit of css niceness.
* tests: remove delicate test based on old layout (thought about replacing but doubtful of value and will be equally delicate).
  • Loading branch information
rufuspollock committed Feb 2, 2012
1 parent 0f803f9 commit df686b4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
13 changes: 10 additions & 3 deletions ckan/public/css/style.css
Expand Up @@ -4,7 +4,7 @@
body.no-sidebar #sidebar { display: none; }
body.no-sidebar #content {
border-right: 0;
width: 950px;
width: 960px;
}

.header.outer {
Expand Down Expand Up @@ -679,7 +679,7 @@ ul.userlist .badge {
body.user.read #sidebar { display: none; }
body.user.read #content {
border-right: 0;
width: 950px;
width: 960px;
}

.user.read .page_heading {
Expand All @@ -699,6 +699,13 @@ body.user.read #content {
color: #999;
}

.user.read .rule {
clear: both;
margin-bottom: 15px;
padding-top: 20px;
border-bottom: 1px solid #ddd;
}

.vcard dt {
width: 115px;
float: left;
Expand Down Expand Up @@ -1308,7 +1315,7 @@ body.package.read #sidebar li.widget-container {
body.package.resource_read #sidebar { display: none; }
body.package.resource_read #content {
border-right: 0;
width: 950px;
width: 960px;
}

.resource_read .notes {
Expand Down
30 changes: 14 additions & 16 deletions ckan/templates/user/read.html
Expand Up @@ -15,18 +15,8 @@
</py:if>
</py:def>

<py:match path="primarysidebar">
<li class="widget-container widget_text" py:if="not c.hide_welcome_message">
<h3>Activity</h3>
<ul>
<li><strong>Number of edits:</strong> ${c.user_dict['number_of_edits']}</li>
<li><strong>Number of datasets administered:</strong> ${c.user_dict['number_administered_packages']}</li>
</ul>
</li>
</py:match>

<div py:match="content">
<div class="row">
<div py:match="content" py:strip="">
<div class="row summary">
<div class="span-12">
<dl class="vcard">
<dt>Name</dt>
Expand Down Expand Up @@ -66,11 +56,19 @@ <h3>Activity</h3>
</ul>
</div>
</div>
<div class="clear"></div>
<div class="rule"></div>

<div class="changes">
<h3>Recent changes</h3>
${revision_list_from_dict(c.user_dict['activity'])}
<div class="row listing">
<div class="datasets span-12">
<h2>Datasets</h2>
${package_list_from_dict(c.user_dict['datasets'])}
</div>
<div class="changes span-12">
<h2>Public Activity</h2>
<py:if test="c.user_dict['activity']">
${revision_list_from_dict(c.user_dict['activity'])}
</py:if>
</div>
</div>
</div>

Expand Down
3 changes: 0 additions & 3 deletions ckan/tests/functional/test_user.py
Expand Up @@ -56,9 +56,6 @@ def test_user_read(self):
'target="_blank"',
'rel="nofollow"')
assert 'Edit Profile' not in main_res, main_res
assert 'Number of edits:</strong> 3' in res, res
assert 'Number of datasets administered:</strong> 1' in res, res
assert 'Revision History' in res, res

def test_user_read_without_id(self):
offset = '/user/'
Expand Down

0 comments on commit df686b4

Please sign in to comment.