Skip to content

Commit

Permalink
iA tweaks on follower lists as well as package pages
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Oct 11, 2012
1 parent 3001398 commit 719cae6
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 103 deletions.
1 change: 1 addition & 0 deletions ckan/public/base/less/ckan.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import "profile.less";
@import "disqus.less";
@import "activity.less";
@import "follower-list.less";

body {
// Using the masthead/footer gradient prevents the color from changing
Expand Down
10 changes: 10 additions & 0 deletions ckan/public/base/less/follower-list.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.follower-list {
li {
margin: 0 0 15px 0;
}
.gravatar {
vertical-align: -4px;
margin-right: 3px;
.border-radius(100px);
}
}
23 changes: 0 additions & 23 deletions ckan/public/base/less/profile.less
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
.profile {
header {
position: relative;
border-bottom: 1px solid @moduleHeadingBorderColor;
height: 30px;
.border-radius(3px 3px 0 0);
#gradient > .vertical(@moduleHeadingBackgroundColorStart, @moduleHeadingBackgroundColorEnd);
.nav-tabs {
position: absolute;
left: 20px;
bottom: -1px;
margin-bottom: 0;
i {
margin-right: 10px;
font-size: 14px;
}
a:hover {
background-color: @moduleBackgroundColor;
}
}
}
.tab-heading {
display: none;
}
.empty,
.dataset-list {
margin-bottom: 20px;
Expand Down
25 changes: 25 additions & 0 deletions ckan/public/base/less/toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,28 @@
.toolbar .btn-inverse {
.btn-inverse;
}

.hide-heading {
display: none;
}

.page-header {
position: relative;
border-bottom: 1px solid @moduleHeadingBorderColor;
height: 30px;
.border-radius(3px 3px 0 0);
#gradient > .vertical(@moduleHeadingBackgroundColorStart, @moduleHeadingBackgroundColorEnd);
.nav-tabs {
position: absolute;
left: 20px;
bottom: -1px;
margin-bottom: 0;
i {
margin-right: 10px;
font-size: 14px;
}
a:hover {
background-color: @moduleBackgroundColor;
}
}
}
20 changes: 5 additions & 15 deletions ckan/templates/package/followers.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@

{% block subtitle %}{{ _('Followers') }} - {{ c.pkg_dict.title or c.pkg_dict.name }}{% endblock %}

{% block primary_content %}
<article class="module">
<div class="module-content">
<h1 class="page-heading">{{ _('Followers') }}</h1>
{% if c.followers %}
<ul class="unstyled userlist">
{% for follower in c.followers %}
<li>{{ h.linked_user(follower['name'], maxlength=20) }}</li>
{% endfor %}
</ul>
{% else %}
<p class="empty">{{ _('No followers') }}</p>
{% endif %}
</div>
</article>
{% block package_content %}
<section class="module-content">
<h1 class="hide-heading">{{ _('Followers') }}</h1>
{% snippet "user/snippets/followers.html", followers=c.followers %}
</section>
{% endblock %}
72 changes: 48 additions & 24 deletions ckan/templates/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
{% endblock %}

{% block actions_content %}
<li>{% link_for _('Related'), controller='related', action='list', id=pkg.name, class_='btn', icon='picture' %}</li>
{# NOTE: Not implemented in stage 1 #}
{# <li>{% link_for _('History'), controller='package', action='history', id=pkg.name, class_='btn', icon='undo' %}</li> #}
{% if h.check_access('package_update', {'id':pkg.id }) %}
<li>{% link_for _('Edit'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %}</li>
{% endif %}
<li>{% link_for _('Followers'), controller='package', action='followers', id=pkg.name, class_='btn', icon='group' %}</li>
<li>{{ h.follow_button('dataset', pkg.id) }}</li>
{% endblock %}

{% block primary_content %}

{% block package_revision_info %}
{% if c.pkg_revision_id %}
<div class="module info">
Expand All @@ -40,37 +39,61 @@
{% endblock %}

<article class="module prose">
{% block package_description %}
<section class="module-content">
<h1>{{ pkg.title or pkg.name }}
{% if pkg.state.startswith('draft') %}
[{{ _('Draft') }}]
{% endif %}
</h1>
{% if c.pkg_notes_formatted %}
<div class="notes embedded-content">
{{ c.pkg_notes_formatted }}
</div>
{% endif %}
<span class="insert-comment-thread"></span>
</section>
{% endblock %}

{% block package_resources %}
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% block package_header %}
<header class="module-content page-header">
<ul class="nav nav-tabs">
<li{% if c.action == 'read' %} class="active"{% endif %}>
{% link_for _('Dataset'), controller='package', action='read', id=pkg.name, icon='sitemap' %}
</li>
<li{% if c.action == 'followers' %} class="active"{% endif %}>
{% link_for _('Followers'), controller='package', action='followers', id=pkg.name, icon='group' %}
</li>
<li{% if c.action == 'related' %} class="active"{% endif %}>
{% link_for _('Related'), controller='related', action='list', id=pkg.name, icon='picture' %}
</li>
</ul>
</header>
{% endblock %}

{% block package_tags %}
{% snippet "package/snippets/tags.html", tags=pkg.tags %}
{% endblock %}
{% block package_content %}

{% block package_description %}
<section class="module-content">
<h1>{{ pkg.title or pkg.name }}
{% if pkg.state.startswith('draft') %}
[{{ _('Draft') }}]
{% endif %}
</h1>
{% if c.pkg_notes_formatted %}
<div class="notes embedded-content">
{{ c.pkg_notes_formatted }}
</div>
{% endif %}
<span class="insert-comment-thread"></span>
</section>
{% endblock %}

{% block package_resources %}
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% endblock %}

{% block package_tags %}
{% snippet "package/snippets/tags.html", tags=pkg.tags %}
{% endblock %}

{% block package_additional_info %}
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %}
{% endblock %}

{% block package_additional_info %}
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %}
{% endblock %}
</article>
{% endblock %}

{% block secondary_content %}

{% block secondary_help_content %}{% endblock %}

{% block package_groups %}
{% for group in pkg.groups %}
{% snippet "snippets/group.html", group=group, truncate=70 %}
Expand All @@ -88,4 +111,5 @@ <h1>{{ pkg.title or pkg.name }}
{% block package_license %}
{% snippet "snippets/license.html", pkg_dict=pkg %}
{% endblock %}

{% endblock %}
35 changes: 11 additions & 24 deletions ckan/templates/package/related_list.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
{% extends "page.html" %}
{% extends "package/read.html" %}

{% set pkg = c.pkg %}

{% block breadcrumb_content %}
<li>{% link_for _('Datasets'), controller='package', action='search', highlight_actions = 'new index' %}</li>
<li>{% link_for h.truncate(h.dataset_display_name(pkg), 30), controller='package', action='read', id=c.pkg.name %}</li>
<li class="active"><a href="">{{ _('Related') }}</a></li>
{% block package_content %}
<section class="module-content">
<h2 class="hide-heading">{{ _('Related Media for {dataset}').format(dataset=h.dataset_display_name(c.pkg)) }}</h2>
{% if c.pkg.related %}
{% snippet "related/snippets/related_list.html", related_items=c.pkg.related, pkg_id=c.pkg.name %}
{% else %}
<p class="empty">No related items</p>
{% endif %}
</section>
{% endblock %}

{% block actions_content %}
{% snippet 'package/snippets/back_to_package_action.html', pkg=pkg %}
<li>{% link_for _('Add Item'), controller='related', action='new', id=pkg.name, class_='btn', icon='plus' %}</li>
{% endblock %}

{% block primary_content %}
<div class="module">
<div class="module-content">
<h1 class="page-heading">{{ _('Related Media for {dataset}').format(dataset=h.dataset_display_name(c.pkg)) }}</h1>
{% if c.pkg.related %}
{% snippet "related/snippets/related_list.html", related_items=c.pkg.related, pkg_id=c.pkg.name %}
{% else %}
<p class="empty">No related items</p>
{% endif %}
</div>
</div>
{% endblock %}

{% block secondary_content %}
{% block secondary_help_content %}
<div class="module module-narrow module-shallow">
<h2 class="module-heading"><i class="icon-large icon-info-sign"></i> {{ _('What is Related Media?') }}</h2>
<div class="module-content">
Expand Down
8 changes: 4 additions & 4 deletions ckan/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
{% snippet 'package/snippets/back_to_package_action.html', pkg=pkg %}

{% if h.check_access('package_update', {'id':pkg.id }) %}
<li>{% link_for _('Edit'), controller='package', action='resource_edit', id=pkg.name, resource_id=res.id, class_='btn', icon='wrench' %}</li>
<li>{% link_for _('Edit Resource'), controller='package', action='resource_edit', id=pkg.name, resource_id=res.id, class_='btn', icon='wrench' %}</li>
{% endif %}

{% if res.url %}
<li>
<a class="btn btn-primary resource-url-analytics resource-type-{{ res.resource_type }}" href="{{ res.url }}">
{% if res.resource_type in ('listing', 'service') %}
{{ _('View') }}
<i class="icon-eye-open"></i> {{ _('View') }}
{% elif res.resource_type == 'api' %}
{{ _('API Endpoint') }}
<i class="icon-key"></i> {{ _('API Endpoint') }}
{% else %}
<i class="icon-large icon-download"></i> {{ _('Download') }}
<i class="icon-download"></i> {{ _('Download') }}
{%endif %}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/user/activity_stream.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
{% endblock %}

{% block primary_content_inner %}
<h2 class="tab-heading">{{ _('Activity Stream') }}</h2>
<h2 class="hide-heading">{{ _('Activity Stream') }}</h2>
{{ c.user_activity_stream | safe }}
{% endblock %}
12 changes: 2 additions & 10 deletions ckan/templates/user/followers.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
{% block subtitle %}{{ _('Followers') }}{% endblock %}

{% block primary_content_inner %}
<h2 class="tab-heading">{{ _('Followers').format(name=c.user_dict.display_name) }}</h2>
{% if c.user_dict.num_followers == 0 %}
<p class="empty">{{ _('User doesn\'t have any followers.') }}</p>
{% else %}
<ul class="userlist unstyled">
{% for follower in c.followers %}
<li class="user">{{ h.linked_user(follower['name'], maxlength=20) }}</li>
{% endfor %}
</ul>
{% endif %}
<h2 class="hide-heading">{{ _('Followers').format(name=c.user_dict.display_name) }}</h2>
{% snippet "user/snippets/followers.html", followers=c.user_dict.num_followers %}
{% endblock %}
4 changes: 2 additions & 2 deletions ckan/templates/user/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

{% block primary_content %}
<article class="module profile">
<header class="module-content">
<header class="module-content page-header">
<ul class="nav nav-tabs">
<li{% if c.action == 'read' or c.action == 'me' %} class="active"{% endif %}>
{% link_for _('Datasets'), controller='user', action='read', id=user.name, icon='sitemap' %}
Expand All @@ -40,7 +40,7 @@
</header>
<section class="module-content">
{% block primary_content_inner %}
<h2 class="tab-heading">{{ _('Datasets') }}</h2>
<h2 class="hide-heading">{{ _('Datasets') }}</h2>
{% if user.datasets %}
{% snippet 'snippets/package_list.html', packages=user.datasets %}
{% else %}
Expand Down
13 changes: 13 additions & 0 deletions ckan/templates/user/snippets/followers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% if followers %}
<ul class="unstyled follower-list">
{% for follower in followers %}
<li>
<span data-module="user-context" data-module-id="{{ follower.id }}">
{{ h.linked_user(follower.name, maxlength=20) }}
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="empty">{{ _('No followers') }}</p>
{% endif %}

0 comments on commit 719cae6

Please sign in to comment.