diff --git a/securedrop/sass/source.sass b/securedrop/sass/source.sass index d3a0ee331c..c2c4b25b5f 100644 --- a/securedrop/sass/source.sass +++ b/securedrop/sass/source.sass @@ -34,37 +34,33 @@ text-align: center width: 80% -@media only screen and (max-width: 880px) +@media only screen #codename-hint - width: 100% + summary + cursor: pointer -#codename-hint-visible - .visible-codename - margin: auto - padding: auto - height: auto - overflow: visible + &:after + content: "Show" + display: block + float: right - .hidden-codename - margin: 0 - padding: 0 - height: 0 - overflow: hidden + text-decoration: none + color: $color_securedrop_blue + border-bottom: 1px solid rgba(0, 117, 247, 0.4) - &:target + &:hover, &:active + &:after + color: $color_grimace_blue + border-bottom: 1px solid rgba(42, 49, 157, 1) - .visible-codename - margin: 0 - padding: 0 - height: 0 - overflow: hidden - border: 0 + &[open] + summary + &:after + content: "Hide" - .hidden-codename - margin: auto - padding: auto - height: auto - overflow: visible +@media only screen and (max-width: 880px) + #codename-hint + width: 100% input.codename-box width: 100% @@ -72,6 +68,7 @@ input.codename-box font-weight: bold .codename + background-color: transparent font-family: monospace letter-spacing: 0.15em font-weight: normal @@ -160,6 +157,7 @@ p#codename font-size: 10px font-weight: bold padding: 5px + margin: 0 a.delete float: right @@ -217,7 +215,7 @@ p#codename margin: 0 2% padding: 5px 15px - output#no-replies + #no-replies display: block font-weight: bold text-align: center diff --git a/securedrop/source_app/forms.py b/securedrop/source_app/forms.py index 6fb47b6329..90701dc035 100644 --- a/securedrop/source_app/forms.py +++ b/securedrop/source_app/forms.py @@ -11,31 +11,21 @@ class LoginForm(FlaskForm): - codename = PasswordField( - "codename", - validators=[ - InputRequired(message=gettext("This field is required.")), - Length( - 1, - PassphraseGenerator.MAX_PASSPHRASE_LENGTH, - message=gettext( - "Field must be between 1 and " - "{max_codename_len} characters long.".format( - max_codename_len=PassphraseGenerator.MAX_PASSPHRASE_LENGTH - ) - ), - ), - # Make sure to allow dashes since some words in the wordlist have them - Regexp(r"[\sA-Za-z0-9-]+$", message=gettext("Invalid input.")), - ], - ) + codename = PasswordField('codename', validators=[ + InputRequired(message=gettext('This field is required.')), + Length(1, PassphraseGenerator.MAX_PASSPHRASE_LENGTH, + message=gettext( + 'Field must be between 1 and ' + '{max_codename_len} characters long.'.format( + max_codename_len=PassphraseGenerator.MAX_PASSPHRASE_LENGTH))), + # Make sure to allow dashes since some words in the wordlist have them + Regexp(r'[\sA-Za-z0-9-]+$', message=gettext('Invalid input.')) + ]) class SubmissionForm(FlaskForm): - msg = TextAreaField("msg", - render_kw={"aria-label": gettext("Write a message."), - "placeholder": gettext("Write a message."), - }) + msg = TextAreaField("msg", render_kw={"placeholder": gettext("Write a message."), + "aria-label": gettext("Write a message.")}) fh = FileField("fh", render_kw={"aria-label": gettext("Select a file to upload.")}) def validate_msg(self, field: wtforms.Field) -> None: diff --git a/securedrop/source_templates/base.html b/securedrop/source_templates/base.html index f309e4514d..bfb75f8115 100644 --- a/securedrop/source_templates/base.html +++ b/securedrop/source_templates/base.html @@ -37,7 +37,7 @@

{{ gettext("We're sorry, our SecureDrop is currently offline.") }}

{% if 'logged_in' in session %} {% endif %} diff --git a/securedrop/source_templates/first_submission_flashed_message.html b/securedrop/source_templates/first_submission_flashed_message.html index 53926883cd..629e47db72 100644 --- a/securedrop/source_templates/first_submission_flashed_message.html +++ b/securedrop/source_templates/first_submission_flashed_message.html @@ -1,7 +1,7 @@

{{ gettext('Success!') }}

{{ gettext('Thank you for sending this information to us. Please check back later for replies.') }} - + {{ gettext('Forgot your codename?') }}

diff --git a/securedrop/source_templates/flashed.html b/securedrop/source_templates/flashed.html index deeabfe20b..2ff82ac231 100644 --- a/securedrop/source_templates/flashed.html +++ b/securedrop/source_templates/flashed.html @@ -4,7 +4,7 @@