UI: Implement toggle-bars to My conference filters #103981

Merged
Márton Lente merged 5 commits from ui/my-conference-toggles into main 2024-10-29 15:20:31 +01:00
14 changed files with 131 additions and 69 deletions
Showing only changes of commit 0954626f45 - Show all commits

@ -1 +1 @@
Subproject commit 0cdfbd54f695493a549f87162a6a43f29b7f053f Subproject commit c6cc2d73f86e46e8710ba98e60f7d35eb7590fae

View File

@ -72,14 +72,17 @@ class Location(models.Model):
rgb = tuple(int(h[i : i + 2], 16) for i in (0, 2, 4)) rgb = tuple(int(h[i : i + 2], 16) for i in (0, 2, 4))
return rgb return rgb
# TODO: improve colour contrast further
def color_to_hsv(self): def color_to_hsv(self):
rgb = self.color_to_rgb(self.color) rgb = self.color_to_rgb(self.color)
# Turn colors into 255 range # Turn colors into 255 range
rgb = [c / 255.0 for c in rgb] rgb = [c / 255.0 for c in rgb]
# Turn RGB to HSV # Turn RGB to HSV
hsv = colorsys.rgb_to_hsv(*rgb) hsv = colorsys.rgb_to_hsv(*rgb)
# Turn colors in to CSS HSV representation (360, 100, 100) # Shift hue to improve colour contrast
return hsv[0] * 360, hsv[1] * 100, hsv[2] * 100 hue_shift = 120
hue = (hsv[0] * 360 + hue_shift) % 360
return hue, hsv[1] * 100, hsv[2] * 100
def __str__(self): def __str__(self):
return self.name return self.name

View File

@ -80,7 +80,8 @@
color: white color: white
display: flex display: flex
justify-content: center justify-content: center
+padding(2) +padding(2, y)
+padding(3, x)
.btn-row .btn-row
flex: 1 flex: 1
@ -88,3 +89,9 @@
.btn-accent .btn-accent
box-shadow: none box-shadow: none
.edition-logo-header
svg, img
fill: var(--color-text-tertiary)
height: auto
max-width: var(--spacer-6)

View File

@ -157,18 +157,19 @@ $col-time-width: 8%
&.toggle &.toggle
i i
border-radius: var(--spacer) background-color: transparent
background-color: currentColor // TODO: improve border-color contrast in theme light
border: var(--border-width) solid var(--border-color)
color: currentColor color: currentColor
height: var(--spacer) height: var(--spacer-4)
+margin(1, right) +margin(1, right)
position: relative position: relative
transition: background-color ease-in-out var(--transition-speed), box-shadow ease-in-out var(--transition-speed) transition: background-color ease-in-out var(--transition-speed), box-shadow ease-in-out var(--transition-speed)
width: var(--spacer) width: var(--spacer-4)
&:before &:before
font-weight: bold font-weight: bold
left: calc(var(--spacer-1) * -1) left: calc(var(--spacer-1) * -.5)
opacity: 0 opacity: 0
transform: scale(0) transform: scale(0)
position: relative position: relative
@ -177,8 +178,6 @@ $col-time-width: 8%
input:checked input:checked
&~label i &~label i
background-color: transparent
&:before &:before
opacity: 1 opacity: 1
transform: scale(.85) transform: scale(.85)
@ -248,6 +247,7 @@ $col-time-width: 8%
+media-lg +media-lg
display: none display: none
// TODO: cleanup either CSS or JS for sticky positioning of schedule day toggles. Currently both are used, JS handling the display
body.is-scrolled body.is-scrolled
.schedule-day-toggles .schedule-day-toggles
box-shadow: 0 var(--spacer) calc(var(--spacer) * 2) rgba(black, .1) box-shadow: 0 var(--spacer) calc(var(--spacer) * 2) rgba(black, .1)
@ -298,11 +298,11 @@ body.is-scrolled
display: flex display: flex
flex-direction: column flex-direction: column
flex-wrap: nowrap flex-wrap: nowrap
overflow: hidden
@include media-breakpoint-up(lg) @include media-breakpoint-up(lg)
flex-wrap: wrap flex-wrap: wrap
flex-direction: row flex-direction: row
overflow: hidden // Prevents position sticky on children on small screens
.flex-row-break-lg .flex-row-break-lg
@include media-breakpoint-up(lg) @include media-breakpoint-up(lg)
@ -392,7 +392,11 @@ body.is-scrolled
@include media-breakpoint-up(lg) @include media-breakpoint-up(lg)
display: none display: none
background-color: var(--color-bg)
+padding(2, y) +padding(2, y)
position: sticky
top: 0
z-index: calc(var(--zindex-fixed) + 1)
/* Vertical schedule scrolls to this during conference days. */ /* Vertical schedule scrolls to this during conference days. */
.time-line-break .time-line-break
@ -559,7 +563,6 @@ body.is-scrolled
/* Ongoing events.. */ /* Ongoing events.. */
&.happening-now &.happening-now
background-color: var(--box-bg-color-hover) !important
box-shadow: 0 var(--spacer-2) var(--spacer) var(--color-accent-bg-hover) // --box-shadow-lg with color-accent-bg-hover box-shadow: 0 var(--spacer-2) var(--spacer) var(--color-accent-bg-hover) // --box-shadow-lg with color-accent-bg-hover
/* Red indicator on top-left. */ /* Red indicator on top-left. */
@ -692,9 +695,7 @@ body.is-scrolled
border-radius: 50% border-radius: 50%
display: none display: none
height: 1.2rem height: 1.2rem
position: absolute margin-left: .2rem
right: var(--spacer-2)
top: var(--spacer-2)
visibility: hidden visibility: hidden
width: 1.2rem width: 1.2rem

View File

@ -15,32 +15,6 @@ footer
img(src="{% static 'images/BCON_logo.svg'%}", alt="{{ edition.title }}") img(src="{% static 'images/BCON_logo.svg'%}", alt="{{ edition.title }}")
{% endif %} {% endif %}
| {% if main_menu_editions|length >= 2 or edition not in main_menu_editions and main_menu_editions|length >= 1 %}
li
button.btn.dropdown-toggle.py-0(
aria-expanded='false',
aria-haspopup='true',
class="js-dropdown-toggle",
data-toggle-menu-id="nav-edition-menu",
id="nav-edition-dropdown")
| Editions
.dropdown-menu.dropdown-menu-left.dropdown-menu-bottom(
aria-labelledby='nav-edition-dropdown',
class="js-dropdown-menu",
id="nav-edition-menu")
| {% for menu_edition in main_menu_editions %}
a.dropdown-item(
class="{% if menu_edition == edition %}active{% endif %}",
href="{% url 'homepage' edition_path=menu_edition.path %}")
{{ menu_edition.title }}
| {% endfor %}
| {% endif %}
li
a(href="/code-of-conduct/") Code of Conduct
li
a(href="/hosting-official-bcon/") Hosting an Official BCON
ul ul
| {% if edition and edition.flatpage_call_for_participation_published %} | {% if edition and edition.flatpage_call_for_participation_published %}
li li
@ -85,7 +59,38 @@ footer
target="_blank", target="_blank",
title="Follow @BlenderConf on Twitter") title="Follow @BlenderConf on Twitter")
| #[i.i-twitter] | #[i.i-twitter]
hr
.container
.justify-content-center.navbar-footer
| {% if main_menu_editions|length >= 2 or edition not in main_menu_editions and main_menu_editions|length >= 1 %}
{# TODO: check media queries breakpoints #}
ul.mb-2.mb-lg-0
li
button.btn.dropdown-toggle.py-0(
aria-expanded='false',
aria-haspopup='true',
class="js-dropdown-toggle",
data-toggle-menu-id="nav-edition-menu",
id="nav-edition-dropdown")
| Editions
.dropdown-menu.dropdown-menu-left.dropdown-menu-bottom(
aria-labelledby='nav-edition-dropdown',
class="js-dropdown-menu",
id="nav-edition-menu")
| {% for menu_edition in main_menu_editions %}
a.dropdown-item(
class="{% if menu_edition == edition %}active{% endif %}",
href="{% url 'homepage' edition_path=menu_edition.path %}")
{{ menu_edition.title }}
| {% endfor %}
| {% endif %}
ul
li.fs-sm
a(href="/code-of-conduct/") Code of Conduct
li.fs-sm
a(href="/hosting-official-bcon/") Hosting an Official BCON
#hop(title='Be awesome in space') #hop(title='Be awesome in space')
svg(xmlns='http://www.w3.org/2000/svg', viewbox='0 0 448 512') svg(xmlns='http://www.w3.org/2000/svg', viewbox='0 0 448 512')

View File

@ -7,7 +7,7 @@ nav.nav-global(role='navigation')
a.nav-global-logo( a.nav-global-logo(
href="{% if edition and edition.path %}{% url 'homepage' edition_path=edition.path %}{% else %}/{% endif %}", href="{% if edition and edition.path %}{% url 'homepage' edition_path=edition.path %}{% else %}/{% endif %}",
class="{% if request.path == '/' %}is-active{% endif %}") class="{% if request.path == '/' %}is-active{% endif %}")
| {% include "conference_main/_navbar_logo.pug" %} | {% include "conference_main/_navbar_logo.pug" with show_date=True %}
button.nav-global-logo.js-dropdown-toggle(data-toggle-menu-id='nav-global-nav-links') button.nav-global-logo.js-dropdown-toggle(data-toggle-menu-id='nav-global-nav-links')
{% if edition.logo_small %} {% if edition.logo_small %}

View File

@ -11,6 +11,7 @@
img(src="{% static 'images/BCON_logo.svg'%}", alt="{{ edition.title }}") img(src="{% static 'images/BCON_logo.svg'%}", alt="{{ edition.title }}")
{% endif %} {% endif %}
{% if show_date %}
.navbar-dates .navbar-dates
{% if edition.date_start %} {% if edition.date_start %}
span {{ edition.date_start | date:'F d' }}{% if edition.date_start != edition.date_end %}-{{ edition.date_end | date:'d' }}{% endif %}, {{ edition.date_end | date:'Y' }} span {{ edition.date_start | date:'F d' }}{% if edition.date_start != edition.date_end %}-{{ edition.date_end | date:'d' }}{% endif %}, {{ edition.date_end | date:'Y' }}
@ -19,3 +20,4 @@
{% if edition.location %} {% if edition.location %}
span {{ edition.location }} span {{ edition.location }}
{% endif %} {% endif %}
{% endif %}

View File

@ -31,11 +31,11 @@ li.dropdown
a.dropdown-item.is-admin(href="{% url 'admin:tickets_ticket_changelist' %}") a.dropdown-item.is-admin(href="{% url 'admin:tickets_ticket_changelist' %}")
i.i-ticket i.i-ticket
| Tickets | Tickets
li li
a.dropdown-item.is-admin(href="{% url 'admin:conference_main_event_changelist' %}{% if edition %}?edition__id__exact={{ edition.id }}{% endif %}") a.dropdown-item.is-admin(href="{% url 'admin:conference_main_event_changelist' %}{% if edition %}?edition__id__exact={{ edition.id }}{% endif %}")
i.i-layers i.i-layers
| Presentations | Presentations
| {% if edition and not edition.is_archived and edition.festival_voting_open %} | {% if edition and not edition.is_archived and edition.festival_voting_open %}
li li
a.dropdown-item.is-admin(href="{% url 'admin:conference_main_festivalentry_changelist' %}") a.dropdown-item.is-admin(href="{% url 'admin:conference_main_festivalentry_changelist' %}")
@ -43,6 +43,15 @@ li.dropdown
| Festival Entries | Festival Entries
| {% endif %} | {% endif %}
| {% with album=edition.get_open_album %}
| {% if album %}
li
a.dropdown-item.is-admin(href="{% url 'admin:conference_main_photo_changelist' %}{% if edition %}?edition__id__exact={{ edition.id }}{% endif %}")
i.i-camera
| Photos
| {% endif %}
| {% endwith %}
li.dropdown-divider li.dropdown-divider
| {% endif %} | {% endif %}
@ -51,7 +60,6 @@ li.dropdown
a.dropdown-item(href="{% url 'presentation_submit' edition_path=edition.path %}") a.dropdown-item(href="{% url 'presentation_submit' edition_path=edition.path %}")
i.i-upload i.i-upload
| Submit Presentation | Submit Presentation
li.dropdown-divider
| {% endif %} | {% endif %}
| {% if edition and not edition.is_archived and edition.festival_submissions_open %} | {% if edition and not edition.is_archived and edition.festival_submissions_open %}
@ -59,9 +67,10 @@ li.dropdown
a.dropdown-item(href="{% url 'festival_entry_submit' edition_path=edition.path %}") a.dropdown-item(href="{% url 'festival_entry_submit' edition_path=edition.path %}")
i.i-upload i.i-upload
| Submit Festival Entry | Submit Festival Entry
li.dropdown-divider
| {% endif %} | {% endif %}
li.dropdown-divider
li li
a.dropdown-item(href="{% url 'profile_update' %}") a.dropdown-item(href="{% url 'profile_update' %}")
i.i-user i.i-user

View File

@ -0,0 +1,27 @@
ul.bg-primary.pagination.py-2
| {% if is_paginated and page_obj.number > 1 %}
li.page-item.page-first
a(href="?page=1") First
| {% endif %}
| {% if is_paginated and page_obj.has_previous %}
li.page-item.page-prev
a(href="?page={{ page_obj.previous_page_number }}")
i.i-chevron-left
| Previous
| {% endif %}
li.page-item.page-current
a(href="#") Page {{ page_obj.number }} of {{ paginator.num_pages }}
| {% if is_paginated and page_obj.has_next %}
li.page-item.page-next
a(href="?page={{ page_obj.next_page_number }}")
| Next
i.i-chevron-right
| {% endif %}
| {% if is_paginated and page_obj.number < paginator.num_pages %}
li.page-item.page-last
a(href="?page={{ paginator.num_pages }}") Last
| {% endif %}

View File

@ -16,7 +16,7 @@
strong {{ location.name|upper }} strong {{ location.name|upper }}
.board-date {{ date|date:"l jS" }} .board-date {{ date|date:"l jS" }}
.board-logo {% include "conference_main/_navbar_logo.pug" %} .board-logo {% include "conference_main/_navbar_logo.pug" with show_date=True %}
| {% for event in events %} | {% for event in events %}
li( li(

View File

@ -3,17 +3,19 @@
| {% block content %} | {% block content %}
.album-container-fullscreen .album-container-fullscreen
| {% if user.is_anonymous and album.is_upload_open %}
header header
a.edition-logo-header.me-4(href="/")
| {% include "conference_main/_navbar_logo.pug" %}
| {% if user.is_anonymous and album.is_upload_open %}
a(href="{% url 'oauth:login' %}").d-block.p-3.text-decoration-underline a(href="{% url 'oauth:login' %}").d-block.p-3.text-decoration-underline
| Log in to upload photos | Log in to upload photos
| {% endif %} | {% endif %}
| {% if can_upload_photos or request.user.is_staff %} | {% if can_upload_photos or request.user.is_staff %}
header
.btn-row .btn-row
| {% if can_upload_photos %} | {% if can_upload_photos %}
a.btn.btn-accent.px-5(href="{{ album.get_upload_url }}") a.btn.btn-accent(href="{{ album.get_upload_url }}")
i.i-upload i.i-upload
span Upload Photos span Upload Photos
| {% endif %} | {% endif %}
@ -22,16 +24,18 @@
.whoosh-container .whoosh-container
a.whoosh(href="{% url 'admin:conference_main_album_change' album.pk %}") a.whoosh(href="{% url 'admin:conference_main_album_change' album.pk %}")
i.i-edit i.i-edit
a.whoosh(href="{% url 'admin:conference_main_photo_changelist' %}?albums__id__exact={{ album.pk }}&edition__id__exact={{ edition.pk }}")
i.i-camera
| {% endif %} | {% endif %}
| {% endif %} | {% endif %}
| {% if album.license %}
span.mx-3.text-muted(title="All photos are {{ album.license }}") {{ album.license }}
| {% endif %}
| {% include "conference_main/components/album-pagination.pug" %}
.photo-list .photo-list
| {% if is_paginated and page_obj.has_previous %}
a.photo-list-page-nav(href="?page={{ page_obj.previous_page_number }}")
i.i-arrow-left
span Previous
| {% endif %}
| {% for photo in photos %} | {% for photo in photos %}
a.photo-list-item(href="{{ photo.file.url }}") a.photo-list-item(href="{{ photo.file.url }}")
img(src="{{ photo.thumbnail_m_url }}") img(src="{{ photo.thumbnail_m_url }}")
@ -44,9 +48,5 @@
| {% endif %} | {% endif %}
| {% endfor %} | {% endfor %}
| {% if is_paginated and page_obj.has_next %} | {% include "conference_main/components/album-pagination.pug" %}
a.photo-list-page-nav(href="?page={{ page_obj.next_page_number }}")
span Next
i.i-arrow-right
| {% endif %}
| {% endblock content %} | {% endblock content %}

View File

@ -1,6 +1,14 @@
| {% extends "conference_main/base.pug" %} | {% extends "conference_main/base.pug" %}
| {% load thumbnail %} | {% load thumbnail %}
| {% block header %}
| {% block jumbotron %}
| {% with title="Photos" subtitle="Albums with impressions and portraits<br> from the Blender Conference "|add:edition.path|add:"." %}
| {% include "conference_main/components/hero.pug" with title=title subtitle=subtitle|safe show_gradient=True show_overlay=True %}
| {% endwith %}
| {% endblock jumbotron %}
| {% endblock header %}
| {% block content %} | {% block content %}
.container.py-4 .container.py-4
.box .box

View File

@ -96,10 +96,10 @@
| {{ event.duration_minutes }} m | {{ event.duration_minutes }} m
| {% endif %} | {% endif %}
li.divider
li.remarks li.remarks
li.divider
| {% include "conference_main/components/event_buttons.pug" with without_login_button=True is_schedule=True %} | {% include "conference_main/components/event_buttons.pug" with without_login_button=True is_schedule=True %}
.event-name .event-name

View File

@ -199,9 +199,6 @@
.event-details-info .event-details-info
.event-header .event-header
ul.event-description ul.event-description
| {# Indicator for ongoing events. #}
li.remarks
| {% if event.location.slug %} | {% if event.location.slug %}
li.event-location( li.event-location(
style="color: hsl(var(--location-hue-{{ event.location.slug }}), 80%, var(--schedule-container-location-color-l));") style="color: hsl(var(--location-hue-{{ event.location.slug }}), 80%, var(--schedule-container-location-color-l));")
@ -218,6 +215,9 @@
| {{ event.duration_minutes }} m | {{ event.duration_minutes }} m
| {% endif %} | {% endif %}
| {# Indicator for ongoing events. #}
li.remarks
li.divider li.divider
| {% include "conference_main/components/event_buttons.pug" with without_login_button=True is_schedule=True %} | {% include "conference_main/components/event_buttons.pug" with without_login_button=True is_schedule=True %}