{{ gettext("We're sorry, our SecureDrop is currently offline.") }}
{{ gettext("Please try again later. Check our website for more information.") }}
- {% else %} +- {% endif %} + {% endif %} - {% endif %} + {% block body %}{% endblock %} +
diff --git a/securedrop/sass/modules/_aside.sass b/securedrop/sass/modules/_aside.sass index 27d6bdc1b6..26ff8a1068 100644 --- a/securedrop/sass/modules/_aside.sass +++ b/securedrop/sass/modules/_aside.sass @@ -1,9 +1,9 @@ =aside - aside + .aside background-color: #fffbe6 color: #82572d border-radius: 10px - padding: 10px + padding: 10px + 2*8px // cf. hr.no-line margin: 10px text-align: left font-size: medium diff --git a/securedrop/sass/modules/_center-text-align.sass b/securedrop/sass/modules/_center-text-align.sass index 2c4d4c6061..be0dfec1bf 100644 --- a/securedrop/sass/modules/_center-text-align.sass +++ b/securedrop/sass/modules/_center-text-align.sass @@ -1,5 +1,6 @@ =center-text-align .center + clear: both text-align: center .highlight diff --git a/securedrop/sass/modules/_code.sass b/securedrop/sass/modules/_code.sass index 0af9547de1..3111726901 100644 --- a/securedrop/sass/modules/_code.sass +++ b/securedrop/sass/modules/_code.sass @@ -1,9 +1,21 @@ =code + .code, .code-reminder + background: + image: url(/static/i/font-awesome/lock-black.png) + origin: content-box + repeat: no-repeat + size: 20px 23px + .code - background: rgba(0, 0, 0, 0.05) + background: + color: rgba(0, 0, 0, 0.05) box-sizing: border-box -moz-box-sizing: border-box padding: 10px 15px border-bottom: 2px solid $color_warning_red font-size: large text-align: center + + .code-reminder + background: + size: 17px 20px \ No newline at end of file diff --git a/securedrop/sass/modules/_flash.sass b/securedrop/sass/modules/_flash.sass index 49dfa914d2..a4c2c8b25f 100644 --- a/securedrop/sass/modules/_flash.sass +++ b/securedrop/sass/modules/_flash.sass @@ -1,4 +1,10 @@ =flash + #flashed + margin-top: 0 + + ul + padding: 0 + .flash display: flex flex-flow: row nowrap @@ -9,6 +15,10 @@ text-align: left font-size: medium + background-position-y: center + background-position-x: 10px + background-repeat: no-repeat + &:dir(rtl) text-align: right @@ -18,22 +28,36 @@ &.success border: 1px solid #E1F1E5 background-color: #E6FFEB + background-image: url(/static/i/success_checkmark.png) + background-repeat: no-repeat + background-size: 74px 64px + padding-left: 10px + 74px strong color: #299549 + h2 + color: #299549 + font-size: medium + &.notification border: 1px solid #8ed9f6 background-color: #e3f7fc + background-image: url(/static/i/font-awesome/info-circle-black.png) + background-size: 20px 16px font-size: medium font-weight: normal + padding-left: 10px + 20px i color: #4f7685 - &.error + &.error, &.banner-warning border: 1px solid $color_error_border background-color: $color_error_background + background-image: url(/static/i/font-awesome/exclamation-triangle-black.png) + background-size: 20px 17px + padding-left: 10px + 20px i color: #D62727 @@ -52,6 +76,9 @@ padding-left: 20px padding-right: 8px background-color: #FDFDFD + background-image: url(/static/i/bang-stop.png) + background-size: 22px 22px + padding-left: 10px + 22px color: #383838 align-items: center diff --git a/securedrop/sass/modules/_footer.sass b/securedrop/sass/modules/_footer.sass index d25859746c..08ce20e31d 100644 --- a/securedrop/sass/modules/_footer.sass +++ b/securedrop/sass/modules/_footer.sass @@ -7,10 +7,29 @@ font-size: .8em line-height: 1 + // Avoid squeezing the separator into the content layout in mobile view + margin-top: 2.5em + border-top: solid 1px $color_grimace_grey + + footer p + margin-top: 0 + footer #footer-powered-by color: #373737 margin-bottom: 0.5em + &:before + content: "" + + display: inline-block + height: 23px + width: 20px + vertical-align: middle + + background: + image: url(/static/i/logo-footer.png) + size: 20px 23px + footer #footer-advisory color: #3b3b3b line-height: 1.25 diff --git a/securedrop/sass/modules/_form-validation-error.sass b/securedrop/sass/modules/_form-validation-error.sass index b34bceb40f..6507f351c3 100644 --- a/securedrop/sass/modules/_form-validation-error.sass +++ b/securedrop/sass/modules/_form-validation-error.sass @@ -1,4 +1,5 @@ =form-validation-error - span.form-validation-error + .form-validation-error color: red font-size: small + list-style: none diff --git a/securedrop/sass/modules/_header.sass b/securedrop/sass/modules/_header.sass index c286edee11..4d43fb76b9 100644 --- a/securedrop/sass/modules/_header.sass +++ b/securedrop/sass/modules/_header.sass @@ -1,5 +1,5 @@ =header - #header + header float: left &:dir(rtl) @@ -12,3 +12,7 @@ text-align: center color: #666666 letter-spacing: normal + + h1 + margin: 0 + text-align: center \ No newline at end of file diff --git a/securedrop/sass/modules/_headline.sass b/securedrop/sass/modules/_headline.sass index 385433dbcb..1582889487 100644 --- a/securedrop/sass/modules/_headline.sass +++ b/securedrop/sass/modules/_headline.sass @@ -6,6 +6,7 @@ h1 text-align: left font-size: 30px + padding-top: 10px + 2*8px // cf. hr.no-line &:dir(rtl) text-align: right diff --git a/securedrop/sass/modules/_hr-horizontal-rule-line.sass b/securedrop/sass/modules/_hr-horizontal-rule-line.sass index 176f7ca6a6..9bfe94bec5 100644 --- a/securedrop/sass/modules/_hr-horizontal-rule-line.sass +++ b/securedrop/sass/modules/_hr-horizontal-rule-line.sass @@ -5,16 +5,6 @@ border-bottom: none border-color: #c3c3c3 - &.footer-separator - // Avoid squeezing the separator into the content layout in mobile view - clear: both - width: 100% - margin-top: 2.5em - margin-bottom: 0 - height: 1px - border: none - background: $color_grimace_grey - &.no-line clear: both border: none diff --git a/securedrop/sass/modules/_locales.sass b/securedrop/sass/modules/_locales.sass new file mode 100644 index 0000000000..d1cc356f59 --- /dev/null +++ b/securedrop/sass/modules/_locales.sass @@ -0,0 +1,28 @@ +#locale-menu-trigger + &:before + content: "" + + display: inline-block + height: 18px + width: 18px + + margin-right: 1ch + + background: + image: url(/static/i/languages_globe.png) + size: 18px 18px + + &:after + content: "" + + display: inline + height: 18px + width: 12px + + margin-left: auto + + background: + image: url(/static/i/languages_arrow.png) + position: center + repeat: no-repeat + size: contain \ No newline at end of file diff --git a/securedrop/sass/modules/_menu.sass b/securedrop/sass/modules/_menu.sass index 279613c671..b7a591d0b2 100644 --- a/securedrop/sass/modules/_menu.sass +++ b/securedrop/sass/modules/_menu.sass @@ -77,7 +77,7 @@ &:hover, &:focus, &:active background-color: #e8e8e8 -.menu__item a span +.menu__item a text-transform: capitalize .menu__checkbox:checked ~ .menu__items diff --git a/securedrop/sass/modules/_panel.sass b/securedrop/sass/modules/_panel.sass index 0f9486f249..37a03b97e9 100644 --- a/securedrop/sass/modules/_panel.sass +++ b/securedrop/sass/modules/_panel.sass @@ -1,8 +1,13 @@ =panel - .panel - max-width: 800px - width: 100% - margin: 0 auto - padding: 16px 30px - border: 1px solid #e1e1e1 - float: right + body:not(#source-index) + main + max-width: 800px + width: 100% + margin: 0 auto + padding: 16px 30px + border: 1px solid #e1e1e1 + float: right + + section, article, .section-spacing + display: flow-root + margin-top: 10px + 2*8px // cf. hr.no-line \ No newline at end of file diff --git a/securedrop/sass/modules/_snippet.sass b/securedrop/sass/modules/_snippet.sass index fef1e030b0..a3c9d29e18 100644 --- a/securedrop/sass/modules/_snippet.sass +++ b/securedrop/sass/modules/_snippet.sass @@ -22,6 +22,22 @@ min-width: 100% max-width: 100% + span.fh:before + content: "" + + display: block + width: 100% + height: 56px + margin: + top: 5px + bottom: 10px + + background: + image: url(/static/i/arrow-upload-large.png) + position: center + repeat: no-repeat + size: 56px 56px + .message display: inline-block vertical-align: top diff --git a/securedrop/sass/modules/_warning.sass b/securedrop/sass/modules/_warning.sass index c830705f58..f5019a7b4c 100644 --- a/securedrop/sass/modules/_warning.sass +++ b/securedrop/sass/modules/_warning.sass @@ -15,3 +15,20 @@ .close cursor: pointer + + p + margin: 0 + + &:before + content: "" + + display: inline-block + height: 12px + width: 12px + vertical-align: middle + + margin-right: 1ch + + background: + image: url(/static/i/font-awesome/white/exclamation-circle.svg) + size: 12px 12px \ No newline at end of file diff --git a/securedrop/sass/source.sass b/securedrop/sass/source.sass index b5906f15db..c2c4b25b5f 100644 --- a/securedrop/sass/source.sass +++ b/securedrop/sass/source.sass @@ -2,6 +2,7 @@ @import source_index @import modules/visually-hidden @import modules/menu +@import modules/locales @import modules/flash +base_rules @@ -24,45 +25,42 @@ display: block #codename-hint - background: rgba(0, 0, 0, 0.05) + background: + color: rgba(0, 0, 0, 0.05) box-sizing: border-box -moz-box-sizing: border-box - margin-top: 5px + margin-top: 5px !important padding: 5px 10px 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% @@ -70,6 +68,7 @@ input.codename-box font-weight: bold .codename + background-color: transparent font-family: monospace letter-spacing: 0.15em font-weight: normal @@ -105,17 +104,23 @@ p#codename width: 80% .hidden-prompt + display: block + border: none margin: 0 padding: 0 height: 0 overflow: hidden text-align: center + visibility: hidden + width: 80% + position: static &:target margin: auto padding: auto height: auto overflow: visible + visibility: visible .danger display: inline-block @@ -152,17 +157,38 @@ p#codename font-size: 10px font-weight: bold padding: 5px + margin: 0 a.delete float: right padding: 5px background-color: inherit color: $color_urgent_coral - font-size: 14px + font-size: 0 clear: right text-decoration: none border: 0 + span + font-size: 0 + + &:after + content: "" + display: inline-block + background: + image: url(/static/i/trash-x-out.png) + position: center + repeat: no-repeat + size: contain + opacity: 0.9 + height: 16px + width: 20px + + &:hover, &:active + &:after + background: + image: url(/static/i/trash-x-solid.png) + &:hover color: #FA6E6E @@ -174,6 +200,7 @@ p#codename font-size: 14px background: white border: 1px solid $color_grey_dark + padding: 0 p * @@ -188,12 +215,17 @@ p#codename margin: 0 2% padding: 5px 15px -h4#no-replies - text-align: center - color: $color_grey_medium - background: $color_grey_xlight - padding: 40px - margin: 0.5em 0 + #no-replies + display: block + font-weight: bold + text-align: center + color: $color_grey_medium + background: $color_grey_xlight + padding: 40px + margin: 0.5em 0 + + &:before, &:after + content: " — " p.explanation text-align: left @@ -221,7 +253,7 @@ p#max-file-size font-style: italic margin-bottom: 0 -div.bubble +.bubble width: 415px position: absolute background-color: #ffffff @@ -241,3 +273,52 @@ div.bubble image-rendering: crisp-edges margin-bottom: 10px margin-top: 5px + +#regenerate-submit + span + font-size: 0 + + &:after + content: "" + display: inline-block + background: + image: url(/static/i/font-awesome/refresh-white.png) + position: center + repeat: no-repeat + size: contain + opacity: 0.9 + height: 20px + width: 20px + +#cancel + &:before + content: "" + display: inline-block + background: + image: url(/static/i/x_icon-button_blue.png) + origin: content-box + position: center + repeat: no-repeat + size: contain + width: 9px + height: 11px + + &:hover, &:active + &:before + background: + image: url(/static/i/x_icon-grimace_blue.png) + +.back-arrow + display: inline-block + + &:before + content: "" + + display: inline-block + width: 9px + height: 14px + margin-right: 1ch + + background: + image: url(/static/icons/chevron-left.png) + size: contain \ No newline at end of file diff --git a/securedrop/source_app/forms.py b/securedrop/source_app/forms.py index 75bd70bc35..90701dc035 100644 --- a/securedrop/source_app/forms.py +++ b/securedrop/source_app/forms.py @@ -24,8 +24,9 @@ class LoginForm(FlaskForm): class SubmissionForm(FlaskForm): - msg = TextAreaField("msg", render_kw={"placeholder": gettext("Write a message.")}) - fh = FileField("fh") + 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: if len(field.data) > Submission.MAX_MESSAGE_LEN: diff --git a/securedrop/source_app/main.py b/securedrop/source_app/main.py index cbd1a27769..8739869905 100644 --- a/securedrop/source_app/main.py +++ b/securedrop/source_app/main.py @@ -158,7 +158,7 @@ def submit() -> werkzeug.Response: for field, errors in form.errors.items(): for error in errors: flash(error, "error") - return redirect(url_for('main.lookup')) + return redirect(f"{url_for('main.lookup')}#flashed") msg = request.form['msg'] fh = None @@ -173,7 +173,7 @@ def submit() -> werkzeug.Response: "error") else: flash(gettext("You must enter a message."), "error") - return redirect(url_for('main.lookup')) + return redirect(f"{url_for('main.lookup')}#flashed") fnames = [] journalist_filename = g.source.journalist_filename @@ -236,7 +236,7 @@ def submit() -> werkzeug.Response: normalize_timestamps(g.filesystem_id) - return redirect(url_for('main.lookup')) + return redirect(f"{url_for('main.lookup')}#flashed") @view.route('/delete', methods=('POST',)) @login_required diff --git a/securedrop/source_templates/banner_warning_flashed.html b/securedrop/source_templates/banner_warning_flashed.html index 163a37577c..01350b2953 100644 --- a/securedrop/source_templates/banner_warning_flashed.html +++ b/securedrop/source_templates/banner_warning_flashed.html @@ -1,7 +1,8 @@ {# these are flash messages that appear at the top and are really scary, like if you're using tor2web #} {% with messages = get_flashed_messages(with_categories=True, category_filter=["banner-warning"]) %} - {% for category, message in messages %} -
- {{ message }}
- {% endfor %} -{% endwith %} +{% for category, message in messages %} ++ {{ message }} +
+{% endfor %} +{% endwith %} \ No newline at end of file diff --git a/securedrop/source_templates/base.html b/securedrop/source_templates/base.html index 5e60143155..921c00bdf8 100644 --- a/securedrop/source_templates/base.html +++ b/securedrop/source_templates/base.html @@ -1,55 +1,60 @@ - - - - {% if g.organization_name == "SecureDrop" %} -{{ gettext("Please try again later. Check our website for more information.") }}
- {% else %} +