Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default text to browse page #3327

Merged
merged 4 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions warehouse/static/sass/blocks/_applied-filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

.applied-filters {
margin-top: 10px;
margin-bottom: 15px;
@include clearfix;

&__add-button {
Expand Down
2 changes: 1 addition & 1 deletion warehouse/static/sass/settings/_fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $code-font: "Source Code Pro", monospace;

$em-base: 17px;
$base-font-size: 17px;
$small-font-size: $base-font-size * 0.9;
$small-font-size: 14px;
$button-font-size: $base-font-size;
$input-font-size: $base-font-size * 1.1;

Expand Down
147 changes: 86 additions & 61 deletions warehouse/templates/search/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,81 +128,106 @@ <h2 class="no-top-padding">Filter Projects</h2>
</div>

<div class="left-layout__main">
{% if not term and not applied_filters %}
<div class="callout-block no-top-margin">
<p>Enter a search query above, or select a filter from the list of classifiers on the left.</p>
<p>You can combine searches and classifier filters. Examples:</p>
<ul class="no-bottom-margin">
<li>
<a href="{{ request.route_path('search', _query=[('c', 'Programming Language :: Python :: 3')]) }}">
Python 3 compatible projects
</a>
</li>
<li>
<a href="{{ request.route_path('search', _query=[('c', 'Framework :: Sphinx :: Extension'), ('c', 'Development Status :: 5 - Production/Stable')]) }}">
Sphinx extensions that have a stable/production status
</a>
</li>
<li>
<a href="{{ request.route_path('search', _query=[('q', 'graphics'), ('c', 'License :: OSI Approved')]) }}">
Projects related to "graphics" with OSI-approved licenses
</a>
</li>
</ul>
</div>
{% endif %}
<form action="{{ request.route_path('search') }}">
<section class="split-layout split-layout--table">
<div>
{% if term %}
<p>
<strong>{{ page.item_count|format_number }}</strong> projects match "<em>{{ term }}</em>".
{% if page.collection.best_guess and page.collection.best_guess.freq > page.item_count %}
{{ suggestion_link(page.collection.best_guess) }}
<section class="split-layout split-layout--table">
<div>
{% if term or applied_filters %}
<p>
<strong>{{ page.item_count|format_number }}{%if page.item_count == 10000 %}+{% endif %}</strong>
projects
{% if term %}for "<em>{{ term }}</em>"{% endif %}
{% if applied_filters %} with the selected classifier{% if applied_filters|length > 1 %}s{% endif %}{% endif %}

{% if page.collection.best_guess and page.collection.best_guess.freq > page.item_count %}
{{ suggestion_link(page.collection.best_guess) }}
{% endif %}
</p>
{% endif %}
</p>
{% else %}
<p>
<strong>{{ page.item_count|format_number }}{%if page.item_count == 10000 %}+{% endif %}</strong> projects.
</p>
{% endif %}
</div>
</div>
<div>
{% if term or applied_filters %}
<input id="search" type="hidden" name="q" value="{{ term }}">
<label for="order">Order by &nbsp;</label>
<select class="-js-form-submit-trigger" id="order" name="o">
{{ search_option("Relevance", "") }}
{{ search_option("Date Last Updated", "-created") }}
</select>
{% endif %}
</div>
</section>

<div class="applied-filters">
{% if applied_filters %}
{% for filter in applied_filters %}
<div class="filter-badge">
<input type="hidden" name="c" value="{{ filter }}">
<span class="filter-badge__icon">
<i class="fa fa-filter" aria-hidden="true"></i>
<span class="sr-only">Filter</span>
</section>

<div class="applied-filters">
{% if applied_filters %}
{% for filter in applied_filters %}
<div class="filter-badge">
<input type="hidden" name="c" value="{{ filter }}">
<span class="filter-badge__icon">
<i class="fa fa-filter" aria-hidden="true"></i>
<span class="sr-only">Filter</span>
</span>
<span class="filter-badge__description">{{ filter }}</span>
<a class="filter-badge__remove-button" href="#">
<i class="fa fa-close" aria-hidden="true"></i>
<span class="sr-only">Close</span>
</a>
</div>
{% endfor %}
{% endif %}
<span class="applied-filters__add-button">
<a class="-js-add-filter button button--small" href="#">Add Filter</a>
</span>
<span class="filter-badge__description">{{ filter }}</span>
<a class="filter-badge__remove-button" href="#">
<i class="fa fa-close" aria-hidden="true"></i>
<span class="sr-only">Close</span>
</a>
</div>
{% endfor %}
{% endif %}
<span class="applied-filters__add-button">
<a class="-js-add-filter button button--small" href="#">Add Filter</a>
</span>
</div>

<section>
<div class="package-list">
{% for item in page.items %}
{{ project_snippet(item) }}
{% else %}
<div class="callout-block">
<p>
{% if term %}
There were no results for '<em>{{ term }}</em>'.
{% elif applied_filters %}
{% trans count=applied_filters|length, filters=applied_filters|join(", ") %}
There were no results for '<em>{{ filters }}</em>' filter.
{% pluralize %}
There were no results for '<em>{{ filters }}</em>' filters.
{% endtrans %}
{% endif %}
{% if page.collection.best_guess %}
{{ suggestion_link(page.collection.best_guess) }}
{% endif %}
</p>
{% if term or applied_filters %}
<section>
<div class="package-list">
{% for item in page.items %}
{{ project_snippet(item) }}
{% else %}
<div class="callout-block">
<p>
{% if term %}
There were no results for '<em>{{ term }}</em>'.
{% elif applied_filters %}
{% trans count=applied_filters|length, filters=applied_filters|join(", ") %}
There were no results for '<em>{{ filters }}</em>' filter.
{% pluralize %}
There were no results for '<em>{{ filters }}</em>' filters.
{% endtrans %}
{% endif %}
{% if page.collection.best_guess %}
{{ suggestion_link(page.collection.best_guess) }}
{% endif %}
</p>
</div>
{% endfor %}
</div>
{% endfor %}
</div>

{{ pagination(page) }}
</section>

{{ pagination(page) }}
</section>
{% endif %}
</form>
</div>
</div>
Expand Down