From 5d7240fa624bd1c1c8a676ac97dce564f6801ec9 Mon Sep 17 00:00:00 2001 From: anishTP <119032387+anishTP@users.noreply.github.com> Date: Fri, 31 May 2024 18:05:05 +0530 Subject: [PATCH] Project page header (#2030) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Moved the register-block to the project header section on desktop * Added spacing between the registerblock and project title and moved the registerblock to a separate card when the current_page is !=project * Improve responsiveness of register block for project subpages and improve styling on calendar widget * Changed the register button to full width inside the card when rendered in project sub-pages * Comparison with true is not required * Template fixes * Improved styling on the buttons in the register block for edge cases when the project has no banner image * Avoid the ambiguous term "project" * Removed the member label from project-details__box in the project header * Include bio field in account edit form (#2049) * Use client-hint headers to identify browser and platform (#2050) * Consistent formatting between apps and login sessions list (#2051) * Follow button UI fixes (#2047) * Style fixes and fix for follow button on homepage * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix follow button UI issues * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Style fixes for follow button on proposal card --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix ajax followers page (#2054) * Upgrade dependencies; fix type hint (#2055) * [pre-commit.ci] pre-commit autoupdate (#2053) updates: - [github.com/pypa/pip-audit: v2.7.2 → v2.7.3](https://github.com/pypa/pip-audit/compare/v2.7.2...v2.7.3) - [github.com/astral-sh/ruff-pre-commit: v0.4.2 → v0.4.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.2...v0.4.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix copy url function to pick clicked share button url (#2056) * Cleanup macros * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove shoelace * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added length validator * Add title length validators * Do cheaper test first * Spacing fixes * Correct view name * Fix project header for sm screens * Fix preview of markdown fields --------- Co-authored-by: Kiran Jonnalagadda Co-authored-by: Vidya Ramakrishnan Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amogh M Aradhya --- devserver.py | 2 +- funnel/assets/sass/components/_card.scss | 12 ++ .../assets/sass/components/_ticket-modal.scss | 2 +- funnel/assets/sass/pages/project.scss | 41 +++-- funnel/forms/auth_client.py | 2 +- funnel/forms/project.py | 5 +- funnel/forms/session.py | 5 +- funnel/forms/update.py | 5 +- funnel/forms/venue.py | 10 +- funnel/templates/macros.html.jinja2 | 8 +- .../past_projects_section.html.jinja2 | 2 +- funnel/templates/profile_layout.html.jinja2 | 2 +- funnel/templates/project.html.jinja2 | 47 +++--- funnel/templates/project_layout.html.jinja2 | 150 ++++++++---------- 14 files changed, 161 insertions(+), 132 deletions(-) diff --git a/devserver.py b/devserver.py index 73c7d7b28..2d0da118d 100755 --- a/devserver.py +++ b/devserver.py @@ -58,7 +58,7 @@ def rq_background_worker(*args: Any, **kwargs: Any) -> Any: # Only start RQ worker within the reloader environment background_rq = BackgroundWorker( rq_background_worker, - mock_transports=bool(getbool(os.environ.get('MOCK_TRANSPORTS', False))), + mock_transports=bool(getbool(os.environ.get('MOCK_TRANSPORTS', True))), ) background_rq.start() diff --git a/funnel/assets/sass/components/_card.scss b/funnel/assets/sass/components/_card.scss index af13926af..9f8c7ebef 100644 --- a/funnel/assets/sass/components/_card.scss +++ b/funnel/assets/sass/components/_card.scss @@ -126,6 +126,7 @@ margin: 0; width: 100%; display: none; + font-weight: 600; justify-content: space-between; .calendar__month__counting { @@ -187,6 +188,10 @@ } } + .calendar__weekdays__dates__date--flex { + width: auto !important; + } + .calendar__weekdays__dates__date--today { .calendar__weekdays__dates__date__day { color: $mui-text-dark; @@ -222,6 +227,9 @@ z-index: 1; border: 1px solid $mui-primary-color-lighter; } + .calendar__weekdays__dates__date--flex:after { + margin: 0 -8px !important; + } .calendar__weekdays__dates__date--active:before { content: ''; border-left: 5px solid transparent; @@ -297,6 +305,10 @@ .calendar__weekdays__dates--latest { display: flex; } + + .calendar__weekdays__dates--justify { + justify-content: space-between; + } } } } diff --git a/funnel/assets/sass/components/_ticket-modal.scss b/funnel/assets/sass/components/_ticket-modal.scss index c3253e56f..70330ba69 100644 --- a/funnel/assets/sass/components/_ticket-modal.scss +++ b/funnel/assets/sass/components/_ticket-modal.scss @@ -70,7 +70,7 @@ .price-btn { min-width: 150px; font-size: inherit; - padding: 0; + padding: 0 8px; display: flex; flex-direction: column; align-items: center; diff --git a/funnel/assets/sass/pages/project.scss b/funnel/assets/sass/pages/project.scss index f563c189c..e7e8b7569 100644 --- a/funnel/assets/sass/pages/project.scss +++ b/funnel/assets/sass/pages/project.scss @@ -63,11 +63,13 @@ display: none; } .register-block__content__txt { - font-size: 9px; + font-size: 12px; line-height: 16px; + letter-spacing: -0.07rem; width: 100%; display: block; font-style: italic; + font-weight: 600; margin-bottom: $mui-grid-padding * 0.25; } .register-block__btn { @@ -92,6 +94,9 @@ &:hover { border-color: $mui-text-danger; } + .register-block__btn__member-txt { + font-size: 12px; + } } .register-block__btn.mui--is-disabled:hover { border-color: inherit; @@ -101,8 +106,12 @@ width: calc(50% - $mui-grid-padding/2); align-self: flex-end; } + .register-block__btn--full-width { + width: 100% !important; + margin-top: $mui-grid-padding; + } .register-block__content:only-child { - width: 100%; + width: 100% !important; align-self: flex-end; } } @@ -111,7 +120,7 @@ .register-block { .register-block__content { .register-block__content__txt { - font-size: 10px; + font-size: 12px; } } } @@ -152,18 +161,20 @@ @media (min-width: 768px) { .project-footer { + padding: 16px 0 0 !important; .register-block { display: block; .register-block__content { - width: 100%; + width: calc(50% - $mui-grid-padding/2); margin-right: 0; margin-bottom: $mui-grid-padding; .register-block__content__rsvp-txt { font-size: 12px; } .register-block__content__txt { - font-size: 14px; - line-height: 21px; + font-size: 12px; + line-height: 16px; + letter-spacing: -0.01rem; margin-bottom: $mui-grid-padding * 0.5; } .register-block__btn { @@ -179,6 +190,11 @@ } } } + .flex-content { + display: flex; + flex-direction: row; + justify-content: space-between; + } } } @@ -370,6 +386,7 @@ .calendar__weekdays .calendar__weekdays__dates--latest { display: flex; margin-bottom: $mui-grid-padding * 0.5; + font-weight: 600; } .calendar__weekdays .calendar__weekdays__dates:last-child { @@ -391,6 +408,9 @@ } } } + .project-banner__right--flex-direction { + flex-direction: column; + } } .project-banner__left, @@ -433,13 +453,13 @@ } .project-banner__left { width: 67%; - margin: 0 $mui-grid-padding 0 0; + margin: 0 $mui-grid-padding * 2 0 0; .embed-video-wrapper--shaped { border-radius: 16px; } } .project-banner__right { - width: 33%; + width: auto; } } .project-banner.project-banner--inner { @@ -447,7 +467,7 @@ width: 25%; } .project-banner__right--smaller { - width: 75%; + width: auto; } } } @@ -557,10 +577,9 @@ } .project-section__map { - height: 400px; + height: 300px; width: 100%; z-index: 0; - margin: 0 0 $mui-grid-padding; position: relative; outline: none; } diff --git a/funnel/forms/auth_client.py b/funnel/forms/auth_client.py index 82110f021..7b4dab649 100644 --- a/funnel/forms/auth_client.py +++ b/funnel/forms/auth_client.py @@ -33,7 +33,7 @@ class AuthClientForm(forms.Form): title = forms.StringField( __("Application title"), - validators=[forms.validators.DataRequired()], + validators=[forms.validators.DataRequired(), forms.validators.Length(max=250)], filters=[forms.filters.strip()], description=__("The name of your application"), ) diff --git a/funnel/forms/project.py b/funnel/forms/project.py index 88aacf9f3..e2f812d1e 100644 --- a/funnel/forms/project.py +++ b/funnel/forms/project.py @@ -52,7 +52,10 @@ class ProjectForm(forms.Form): title = forms.StringField( __("Title"), - validators=[forms.validators.DataRequired()], + validators=[ + forms.validators.DataRequired(), + forms.validators.Length(max=Project.__title_length__), + ], filters=[forms.filters.strip()], ) tagline = forms.StringField( diff --git a/funnel/forms/session.py b/funnel/forms/session.py index 2bec70d1e..f8796ce87 100644 --- a/funnel/forms/session.py +++ b/funnel/forms/session.py @@ -17,7 +17,10 @@ class SessionForm(forms.Form): title = forms.StringField( __("Title"), - validators=[forms.validators.DataRequired()], + validators=[ + forms.validators.DataRequired(), + forms.validators.Length(max=Session.__title_length__), + ], filters=[forms.filters.strip()], ) venue_room_id = forms.SelectField( diff --git a/funnel/forms/update.py b/funnel/forms/update.py index 6a299eaba..53b11613b 100644 --- a/funnel/forms/update.py +++ b/funnel/forms/update.py @@ -15,7 +15,10 @@ class UpdateForm(forms.Form): title = forms.StringField( __("Title"), - validators=[forms.validators.DataRequired()], + validators=[ + forms.validators.DataRequired(), + forms.validators.Length(max=Update.__title_length__), + ], filters=[forms.filters.strip()], ) body = forms.MarkdownField( diff --git a/funnel/forms/venue.py b/funnel/forms/venue.py index 8df27ce76..59efc719a 100644 --- a/funnel/forms/venue.py +++ b/funnel/forms/venue.py @@ -25,7 +25,10 @@ class VenueForm(forms.Form): title = forms.StringField( __("Name"), description=__("Name of the venue"), - validators=[forms.validators.DataRequired(), forms.validators.Length(max=250)], + validators=[ + forms.validators.DataRequired(), + forms.validators.Length(max=Venue.__title_length__), + ], filters=[forms.filters.strip()], ) description = forms.MarkdownField( @@ -88,7 +91,10 @@ class VenueRoomForm(forms.Form): title = forms.StringField( __("Name"), description=__("Name of the room"), - validators=[forms.validators.DataRequired(), forms.validators.Length(max=250)], + validators=[ + forms.validators.DataRequired(), + forms.validators.Length(max=VenueRoom.__title_length__), + ], filters=[forms.filters.strip()], ) description = forms.MarkdownField( diff --git a/funnel/templates/macros.html.jinja2 b/funnel/templates/macros.html.jinja2 index f9b19abce..4e8745af6 100644 --- a/funnel/templates/macros.html.jinja2 +++ b/funnel/templates/macros.html.jinja2 @@ -25,7 +25,7 @@ {%- endmacro %} -{% macro calendarwidget(calendar, compact=true) %} +{% macro calendarwidget(calendar, compact=true, flex=false) %}