diff --git a/warehouse/static/sass/base/_forms.scss b/warehouse/static/sass/base/_forms.scss index ef0d1fb075b1..5a542619f0dc 100644 --- a/warehouse/static/sass/base/_forms.scss +++ b/warehouse/static/sass/base/_forms.scss @@ -48,6 +48,10 @@ } } +select { + height: 40px; +} + input[type="checkbox"] { &:focus, &:hover, diff --git a/warehouse/static/sass/blocks/_button.scss b/warehouse/static/sass/blocks/_button.scss index a0d3859a3784..e8bbbc8d7383 100644 --- a/warehouse/static/sass/blocks/_button.scss +++ b/warehouse/static/sass/blocks/_button.scss @@ -13,6 +13,7 @@ - primary: Makes button bright blue. - danger: Makes button red. - warning: Makes button brown. + - link: styles button like a link (removes all padding, border, etc.) - disabled: Styles for when the button cannot be clicked. - switch-to-desktop: Switch to desktop button found in site footer. - switch-to-mobile: Switch to mobile button found in site header. @@ -126,6 +127,20 @@ } } + &--link { + padding: 0; + background-color: transparent; + border: 0; + color: $text-color; + display: inline-block; + + &:focus, + &:hover, + &:active { + color: $primary-color; + } + } + &[disabled], &--disabled { cursor: not-allowed; diff --git a/warehouse/static/sass/blocks/_filter-wheels.scss b/warehouse/static/sass/blocks/_filter-wheels.scss new file mode 100644 index 000000000000..c5eff61cff01 --- /dev/null +++ b/warehouse/static/sass/blocks/_filter-wheels.scss @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/* + Search and filter wheels + +
When a field is not editable, you can use me instead
Some help text here
+ + + Modifiers: + - flex-width: makes fields inside the group flexible width (instead of 350px wide) */ .form-group { @@ -20,7 +24,7 @@ &__label { display: block; - font-weight: bold; + font-weight: 600; } &__label:not(:first-child) { @@ -109,6 +113,38 @@ } } + &--flex-width { + max-width: unset; + :where( + input:not([type]), + select, + textarea, + [type="color"], + [type="date"], + [type="datetime"], + [type="datetime-local"], + [type="email"], + [type="month"], + [type="month"], + [type="number"], + [type="password"], + [type="search"], + [type="tel"], + [type="text"], + [type="time"], + [type="url"], + [type="week"] + ).form-group__field, + select.form-group__field { + width: 100%; + max-width: 100%; + } + + select.form-group__field { + padding-right: $spacing-unit; + } + } + // Specific cases for input validation using `pattern` attribute /* stylelint-disable-next-line selector-id-pattern -- Form sets name */ diff --git a/warehouse/static/sass/blocks/_table.scss b/warehouse/static/sass/blocks/_table.scss index de5e4947ceb7..2143ff269c70 100644 --- a/warehouse/static/sass/blocks/_table.scss +++ b/warehouse/static/sass/blocks/_table.scss @@ -30,8 +30,9 @@ Modifiers: - downloads: specific styles for downloads table on project detail page + - files: specific styles for files table on project detail page - releases: specific styles for releases table on manage project page - - files: specific styles for files table on releases tab + - manage-files: specific styles for files table on the releases tab - history: specific styles for project journals - hashes: specific styles for the hashes table on an individual file - collaborators: specific styles for managing a project's collaborators @@ -58,6 +59,7 @@ tbody tr td:last-child { display: block; width: 100%; + max-width: 100%; text-align: left; border-bottom: 0; padding: 2px 0; @@ -175,6 +177,19 @@ } } + &--files { + margin-bottom: $half-spacing-unit; + + td.file-name { + word-wrap: break-word; + max-width: 250px; + } + + @media only screen and (max-width: $desktop) { + @include mobile-friendly-table; + } + } + &--releases { word-wrap: break-word; margin-bottom: $spacing-unit; @@ -185,7 +200,7 @@ } } - &--files, + &--manage-files, &--history { margin-top: $half-spacing-unit; diff --git a/warehouse/static/sass/warehouse.scss b/warehouse/static/sass/warehouse.scss index 32119d746687..f0d9433f38fc 100644 --- a/warehouse/static/sass/warehouse.scss +++ b/warehouse/static/sass/warehouse.scss @@ -95,6 +95,7 @@ @import "blocks/project-description"; /*rtl:end:ignore*/ @import "blocks/files"; +@import "blocks/filter-wheels"; @import "blocks/radio-toggle-form"; @import "blocks/release"; @import "blocks/release-timeline"; diff --git a/warehouse/templates/manage/project/release.html b/warehouse/templates/manage/project/release.html index 6f3277ed9997..ec37bfbf1c0e 100644 --- a/warehouse/templates/manage/project/release.html +++ b/warehouse/templates/manage/project/release.html @@ -32,7 +32,7 @@{% trans %}File{% endtrans %} | +{% trans %}Uploaded{% endtrans %} | +{% trans %}Size{% endtrans %} | +{% trans %}Type{% endtrans %} | +{% trans %}Details{% endtrans %} | + {% for file in files %} -
---|---|---|---|---|
+ {% trans %}File{% endtrans %} + {{ file.filename }} - ({{ file.size|filesizeformat() if file.size else 0|filesizeformat() }} + | ++ {% trans %}Uploaded{% endtrans %} + {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %} + | ++ {% trans %}Size{% endtrans %} + {{ file.size|filesizeformat() if file.size else 0|filesizeformat() }} + | ++ {% trans %}Type{% endtrans %} + {% trans %}Source{% endtrans %} + | ++ {% trans %}View details{% endtrans %} {%- trans -%}view details{%- endtrans -%}) - + data-project-tabs-target="tab" + data-action="project-tabs#onTabClick"> + {% trans %}Details{% endtrans %} + + | +
{% trans %}File{% endtrans %} | +{% trans %}Interpreter{% endtrans %} | +{% trans %}ABI{% endtrans %} | +{% trans %}Platform{% endtrans %} | +{% trans %}Details{% endtrans %} | + + {% for file in files %} +
---|---|---|---|---|
+ {% trans %}File{% endtrans %}
+
+ {{ file.filename }}
+ + + {{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}. + {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}. + + |
+
+ {% trans %}Interpreter{% endtrans %}
+ {% for key, value in file.wheel_filters.items() %}
+ {% if key == 'interpreters' %}
+ {% for interpreter in value %}
+ {{ interpreter }} + {% endfor %} + {% endif %} + {% endfor %} + |
+
+ {% trans %}ABI{% endtrans %}
+ {% for key, value in file.wheel_filters.items() %}
+ {% if key == 'abis' %}
+ {% for abi in value %}
+ {{ abi }} + {% endfor %} + {% endif %} + {% endfor %} + |
+
+ {% trans %}Platform{% endtrans %}
+ {% for key, value in file.wheel_filters.items() %}
+ {% if key == 'platforms' %}
+ {% for platform in value %}
+ {{ platform }} + {% endfor %} + {% endif %} + {% endfor %} + |
+ + {% trans %}View details{% endtrans %} + + {% trans %}Details{% endtrans %} + + | - +
- {% trans href='https://packaging.python.org/tutorials/installing-packages/', title=gettext('External link') %}Download the file for your platform. If you're not sure which to choose, learn more about installing packages.{% endtrans %} + {% trans href='https://packaging.python.org/en/latest/discussions/package-formats/#package-formats', title=gettext('External link') %}For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.{% endtrans %}
- {% trans %}Filter files by name, interpreter, ABI, and platform.{% endtrans %} -
-- {% trans href='https://packaging.python.org/en/latest/specifications/binary-distribution-format/', title=gettext('External link') %}If you're not sure about the file name format, learn more about wheel file names.{% endtrans %} -
+ {% if bdist_count > 3 %} -- {% trans %}Copy a direct link to the current filters {% endtrans %} - -
-