Skip to content

Commit

Permalink
Merge branch 'feature-2375-demo-theme' of github.com:okfn/ckan into f…
Browse files Browse the repository at this point in the history
…eature-2375-demo-theme
  • Loading branch information
tobes committed Jun 12, 2012
2 parents 360c077 + 90d411e commit 415e8eb
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 4 deletions.
Binary file modified ckan/public/base/images/sprite-ckan-icons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ckan/public/base/less/ckan.less
Expand Up @@ -12,6 +12,7 @@
@import "layout.less";
@import "masthead.less";
@import "footer.less";
@import "profile.less";
@import "disqus.less";

body {
Expand Down
34 changes: 30 additions & 4 deletions ckan/public/base/less/disqus.less
@@ -1,11 +1,37 @@
.disqus-trackback .field {
padding: 4px;
.simple-input label,
.simple-input button {
display: none;
}

.disqus-trackback .field input {
.simple-input .field {
position: relative;
padding: 10px 6px;
margin: 0;
}

.simple-input .field-bordered {
border-bottom: 1px dotted #ccc;
}

.simple-input .field input {
.box-sizing(border-box);
width: 100%;
height: auto;
margin: 0;
padding: 8px 5px;
padding: 7px 5px;
}

.simple-input .field .btn-search {
.ckan-icon;
.ckan-icon-search;
position: absolute;
display: block;
height: 17px;
width: 17px;
top: 50%;
right: 15px;
margin-top: -8px;
background-color: transparent;
border: none;
text-indent: -999em;
}
1 change: 1 addition & 0 deletions ckan/public/base/less/icons.less
Expand Up @@ -59,6 +59,7 @@
.ckan-icon-circle-cross { .ckan-icon-background-position(0, "medium") }
.ckan-icon-circle-add { .ckan-icon-background-position(1, "medium") }
.ckan-icon-flame { .ckan-icon-background-position(2, "medium") }
.ckan-icon-search { .ckan-icon-background-position(3, "medium") }

// LARGE

Expand Down
17 changes: 17 additions & 0 deletions ckan/public/base/less/mixins.less
Expand Up @@ -77,3 +77,20 @@
padding-right: @gutter-small-x;
position: relative;
}

.listing li {
text-align: right;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-bottom: 5px;
}

.listing .key,
.listing .value {
}

.listing .key {
clear: right;
font-weight: bold;
}
60 changes: 60 additions & 0 deletions ckan/public/base/less/profile.less
@@ -0,0 +1,60 @@
.profile-info {
.clearfix();
.border-radius(3px 3px 0 0);
border-bottom: 1px solid #ddd;
#gradient > .vertical(#fff, #f3f3f3);
}

.module > .profile-info {
position: relative;
padding-top: 25px;
padding-bottom: 25px;
}

.profile-info .media {
.makeColumn(5);
display: table; // Lets us align the text to the bottom.
margin-left: 0;
}

.profile-info .image {
max-height: initial;
}

.profile-info .description {
display: table-cell;
vertical-align: bottom;
}

.profile-info .heading {
font-size: 18px;
}

.profile-info .description :last-child {
margin-bottom: 0;
}

.profile-info .listing {
.makeColumn(3);
float: right;
font-size: 12px;
}

.profile-info .listing {
.makeColumn(3);
float: right;
}

.profile-info .nav-tabs {
position: absolute;
right: 0;
bottom: -1px;
}

.profile > .content {
padding-bottom: 20px;
}

.js #activity {
display: none;
}
3 changes: 3 additions & 0 deletions ckan/templates/base.html
Expand Up @@ -6,6 +6,9 @@

{# Allows custom attributes to be added to the <head> tag #}
{% block headtag %}<head>{% endblock -%}
{# Append a .js class to the html element #}
<script>document.getElementsByTagName('html')[0].className += ' js';</script>

{#
Add custom meta tags to the page. Call super() to get the default tags
such as charset, viewport and generator.
Expand Down
86 changes: 86 additions & 0 deletions ckan/templates/user/read.html
@@ -0,0 +1,86 @@
{% extends "page.html" %}

{% set user = c.user_dict %}

{% block title %}{{ user.display_name }} - {{ super() }}{% endblock %}

{% block breadcrumb %}
<ol class="breadcrumb">
<li>{{ h.nav_link(_('User'), controller='user', action='index') }}</li>
{% with title = _('Your Profile') if c.is_myself else user.display_name %}
<li class="current">{{ h.nav_link(title, controller='user', action='read', id=user.name) }}</li>
{% endwith %}
</ol>
{% endblock %}

{% block actions %}
<ul class="actions">
<li>{{ h.nav_link(_('Edit'), controller='user', action='edit', id=user.name, class_='btn', icon='star') }}</li>
</ul>
{% endblock %}

{% block primary_content %}
<article class="module profile">
<div class="content profile-info">
<header class="media">
<span class="image">{{ h.linked_gravatar(user.email_hash, 150) }}</span>
<div class="description">
<h1 class="heading">{{ user.fullname or _('No full name provided') }}</h1>
{% if user.about_formatted %}
{{ user.about_formatted }}
{% else %}
<p class="empty">
{% if c.is_myself %}
{% trans %}You have not provided a biography.{% endtrans %}
{% else %}
{% trans %}This user has no biography.{% endtrans %}
{% endif %}
</p>
{% endif %}
</div>
</header>
<ul class="listing unstyled">
<li>
<b class="key">{{ _('Username') }}:</b>
<span class="value">{{ user.name }}</span>
</li>
{% if c.is_myself %}
<li>
<b class="key">{{ _('Email') }}:</b>
<span class="value">{{ user.email }}</span>
</li>
{% endif %}
<li>
<b class="key">{{ _('Member Since') }}:</b>
<span class="value">{{ h.render_datetime(user.created) }}</span>
</li>
{% if c.is_myself %}
<li>
<b class="key">{{ _('API Key') }}:</b>
<span class="value">{{ user.apikey }}</span>
</li>
{% endif %}
<li>
<b class="key">{{ _('Datasets') }}::</b>
<span class="value">{{ user.number_administered_packages }}</span>
<b class="key" class="inline">{{ _('Edits') }}:</b>
<span class="value">{{ user.number_of_edits }}</span>
</li>
</ul>
<ul class="nav nav-tabs">
<li class="active"><a href="#datasets">{{ _('Datasets') }}</a></li>
<li><a href="#activity">{{ _('Activity Stream') }}</a></li>
</ul>
</div>
<div id="packages" class="content clearfix">
{% snippet 'snippets/package_list.html', packages=user.datasets %}
</div>
<div id="activity" class="content">
{{ c.user_activity_stream | safe }}
</div>
</article>
{% endblock %}

{% block secondary_content %}
{% snippet 'user/snippets/user_search.html' %}
{% endblock %}
11 changes: 11 additions & 0 deletions ckan/templates/user/snippets/user_search.html
@@ -0,0 +1,11 @@
<section class="module simple-input">
<h2 class="heading">{{ _('Users') }}</h2>
<form class="field field-bordered" action="" method="get">
<label for="field-user-search">{{ _('Search Users') }}</label>
<input id="field-user-search" class="field" name="q" placeholder="{{ _('Search') }}" />
<button class="btn-search" type="submit">{{ _('Search') }}</button>
</form>
<ul class="nav nav-simple">
<li>{{ h.nav_link(_('All Users'), controller='user', action='index') }}</li>
</ul>
</section>

0 comments on commit 415e8eb

Please sign in to comment.