Skip to content

Commit

Permalink
[#9] Datasets Page style implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dedenbangkit committed Jan 9, 2025
1 parent 042d9fa commit fd6aa02
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 73 deletions.
44 changes: 42 additions & 2 deletions src/ckanext-agra-theme/ckanext/agra_theme/public/base/css/agra.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,38 @@ a.tag:hover {
color: #fff;
background-color: #919191;
}
span.label.label-count {
margin-left: 5px;
background-color: #ffffd6;
color: #00565a;
}
.row.dataset-list {
min-height: 120px;
border-bottom: 1px solid #e5e5e5;
margin: 0px;
}
.row.dataset-list .dataset-info,
.row.dataset-list .dataset-description {
min-height: 120px;
padding: 0px;
}
.row.dataset-list .dataset-info .dataset-resources {
position: absolute;
bottom: 10px;
}
.row.dataset-list h2 {
font-weight: 600;
}
span.recent-views,
span.private-views {
font-weight: 400;
color: #00565a;
}
span.private-views {
color: #e0051e;
}
.masthead {
background: none;
background: rgba(0, 0, 0, 0.2);
}
.masthead a,
.masthead .nav > li > a:focus,
Expand All @@ -26,14 +56,15 @@ a.tag:hover {
.masthead .nav > .active > a:hover,
.masthead .nav > .active > a:focus {
font-family: Poppins, sans-serif;
font-weight: 300;
font-weight: 400;
color: #fff;
}
/* Home Page */
#home > div[role="main"] > .main.hero {
display: flex;
justify-content: center;
align-items: center;
min-height: calc(100vh - 72px);
}
#home > div[role="main"] > .main.hero h1,
#home > div[role="main"] > .main.hero h1 small {
Expand All @@ -43,6 +74,9 @@ a.tag:hover {
margin-bottom: 0;
}

#home > div[role="main"] .main.content {
background: #fff;
}
#home > div[role="main"] > .main.hero h1 small {
color: #e5e71e;
}
Expand All @@ -55,4 +89,10 @@ a.tag:hover {
}
.homepage .module-search {
background: none;
padding: 40px;
}

#home > div[role="main"] .main.content h1 {
text-align: center;
color: #08743f;
}
20 changes: 14 additions & 6 deletions src/ckanext-agra-theme/ckanext/agra_theme/public/base/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -9094,7 +9094,7 @@ td.diff_header {
border: none;
background: none;
font-size: 18px;
background-color: #fff;
background-color: transparent;
font-size: 14px;
padding: 10px 20px;
}
Expand Down Expand Up @@ -9736,10 +9736,13 @@ h4 small {
margin-right: 3px;
}
.wrapper {
border: 1px solid #f6f6f6;
position: relative;
border-radius: 4px;
border-radius: 0px;
min-height: 300px;
background-color: #fff;
box-shadow: none;
-webkit-box-shadow: none;
}
.wrapper:before,
.wrapper:after {
Expand All @@ -9758,6 +9761,9 @@ h4 small {
clear: both;
}
@media (min-width: 768px) {
.main {
background: #f8f8f8;
}
.wrapper:before {
content: "";
display: block;
Expand Down Expand Up @@ -10055,6 +10061,7 @@ h4 small {
border-radius: 3px 3px 0 0;
background-color: #08743f;
border-bottom: none;
padding: 40px 20px 5px;
}
.homepage .module-search .module-content .heading {
margin-top: 0;
Expand All @@ -10063,7 +10070,7 @@ h4 small {
line-height: 40px;
}
.homepage .module-search .tags {
padding: 5px 10px 10px 10px;
padding: 5px 20px 20px 20px;
background-color: #08743f;
border-radius: 0 0 3px 3px;
}
Expand Down Expand Up @@ -10094,7 +10101,7 @@ h4 small {
color: #fff;
font-size: 14px;
line-height: 1.42857143;
padding: 2px 8px;
padding: 2px 8px 0px 0px;
}
.homepage .group-list {
margin: 0;
Expand Down Expand Up @@ -11268,7 +11275,7 @@ iframe {
}
.facet-category .facet-title,
.facet-category .facet-items {
padding: 5px 10px;
padding: 20px;
}
.facet-category .group-hierarchy label,
.facet-category .facet-items label {
Expand All @@ -11280,7 +11287,8 @@ iframe {
content: "";
}
.facet-category .facet-title {
background: #f6f6f6;
background: #ddd;
font-weight: 600;
}
.facet-category .group-hierarchy {
list-style: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,23 @@
</div>
</div>
</div>
<div class="main content">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Find Dataset</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Highlights</h1>
</div>
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -79,41 +79,13 @@
{% for item in search_facets[facet]['items'] %}
<label>
<input type="checkbox" name="{{ facet }}" value="{{ item['name'] }}" {% if item['active'] %}checked{% endif %}>
{{ item['display_name'] }} [{{ item['count'] }}]
{{ item['display_name'] }} <span class="label label-count">{{ item['count'] }}</span>
</label>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
<!-- Example for Hierarchical Groups -->
{% if search_facets.get('groups') %}
<div class="facet-category">
<div class="facet-title">{{ facet_titles.get('groups', 'Groups') }}</div>
<ul class="group-hierarchy">
{% for group in search_facets['groups']['items'] %}
<li>
<label>
<input type="checkbox" name="groups" value="{{ group['id'] }}" {% if group['active'] %}checked{% endif %}>
{{ group['display_name'] }}
</label>
{% if group.get('children') %}
<ul>
{% for child in group['children'] %}
<li>
<label>
<input type="checkbox" name="groups" value="{{ child['id'] }}" {% if child['active'] %}checked{% endif %}>
{{ child['display_name'] }}
</label>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<a class="close no-text hide-filters"><i class="fa fa-times-circle"></i><span class="text">close</span></a>
</div>
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@
{% set truncate_title = truncate_title or 80 %}
{% set title = package.title or package.name %}
{% set notes = h.markdown_extract(package.notes, extract_length=truncate) %}
{% set package_with_tracking = h.get_action('package_show', ({'id': package.id, 'include_tracking': True})) %}

{% block package_item %}

<li class="{{ item_class or "dataset-item" }}">
{% block content %}
<div class="dataset-content">
{% block heading %}

<div class="row dataset-list">
<div class="col-md-6 dataset-info">
<h2 class="dataset-heading">
{% block heading_private %}
{% if package.private %}
<span class="dataset-private label label-inverse">
<i class="fa fa-lock"></i>
{{ _('Private') }}
</span>
{% endif %}
{% endblock %}
{% block heading_title %}
{{ h.link_to(h.truncate(title, truncate_title), h.url_for('%s.read' % package.type, id=package.name)) }}
{% endblock %}
Expand All @@ -43,42 +36,52 @@ <h2 class="dataset-heading">
{% elif package.get('state', '').startswith('deleted') %}
<span class="label label-danger">{{ _('Deleted') }}</span>
{% endif %}
{{ h.popular('views', package.tracking_summary.recent, min=1) if package.tracking_summary }}
{{ h.popular('views', package_with_tracking.tracking_summary.recent, min=5) if package_with_tracking.tracking_summary }}
{% endblock %}
</h2>
<div class="tracking-info">
{% set package_with_tracking = h.get_action('package_show', ({'id': package.id, 'include_tracking': True})) %}
Total Views: {{package_with_tracking.tracking_summary.total if package_with_tracking.tracking_summary else 'no tracking'}}
</div>
{% endblock %}
{% block banner %}
{% if banner %}
<span class="banner">{{ _('Popular') }}</span>
{% endif %}
{% endblock %}
<div class="tracking-info">
<span class="recent-views"><i class="fa fa-line-chart"></i> {{package_with_tracking.tracking_summary.total if package_with_tracking.tracking_summary else 'no tracking'}} Recent Views</span>
</div>
{% block heading_private %}
{% if package.private %}
<div class="private-info">
<span class="private-views"> <i class="fa fa-lock"></i> {{ _('Private') }} </span>
</div>
{% endif %}
{% endblock %}
{% block banner %}
{% if banner %}
<span class="banner">{{ _('Popular') }}</span>
{% endif %}
{% endblock %}
{% block resources %}
{% if package.resources and not hide_resources %}
{% block resources_outer %}
<ul class="dataset-resources list-unstyled">
{% block resources_inner %}
{% for resource in h.dict_list_reduce(package.resources, 'format') %}
<li>
<a href="{{ h.url_for(package.type ~ '.read', id=package.name) }}" class="label label-default" data-format="{{ resource.lower() }}">{{ resource }}</a>
</li>
{% endfor %}
{% endblock %}
</ul>
{% endblock %}
{% endif %}
{% endblock %}
</div>
<div class="col-md-6 dataset-description">
{% block notes %}
{% if notes %}
<div>{{ notes|urlize }}</div>
{% else %}
<p class="empty">{{ _("This dataset has no description") }}</p>
{% endif %}
{% endblock %}
</div>
</div>
</div>
{% block resources %}
{% if package.resources and not hide_resources %}
{% block resources_outer %}
<ul class="dataset-resources list-unstyled">
{% block resources_inner %}
{% for resource in h.dict_list_reduce(package.resources, 'format') %}
<li>
<a href="{{ h.url_for(package.type ~ '.read', id=package.name) }}" class="label label-default" data-format="{{ resource.lower() }}">{{ resource }}</a>
</li>
{% endfor %}
{% endblock %}
</ul>
{% endblock %}
{% endif %}
{% endblock %}
{% endblock %}
</li>
{% endblock %}

0 comments on commit fd6aa02

Please sign in to comment.