diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..9cb6ab4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: ⚠️ Bug +about: Report a problem or defect +--- + +## Description + + + +## Environment + +URL: + + + +## Steps to reproduce + +1. +2. +3. ... + +## Expected result + + +## Actual result + + diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000..66a5d1f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,12 @@ +--- +name: ✨ Feature +about: Request new functionality or modifications to existing functionality +--- + +## Description + +## Acceptance Criteria + + + + diff --git a/.github/ISSUE_TEMPLATE/task.md b/.github/ISSUE_TEMPLATE/task.md new file mode 100644 index 0000000..6ed1d24 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/task.md @@ -0,0 +1,8 @@ +--- +name: 👷 Task +about: Behind-the-scenes work (upgrades, technical debt cleanup, etc.) +--- + +## Description + +## Reason for task diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7b11d60..71f4717 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ Changelog ========= +3.5 (master) +------------ + +- Mobile view improvements. + 3.4 (2019-12-08) ---------------- diff --git a/Makefile b/Makefile index 40904b5..d6c32d4 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ css: ## Compile SCSS files .PHONY: css-watch css-watch: ## Compile JS files - npx sass --watch client/scss/dpaste.scss:build/dpaste.css + npx sass --watch client/scss/dpaste.scss:dpaste/static/dpaste.css .PHONY: js js: ## Compile JS files diff --git a/client/scss/components/_form.scss b/client/scss/components/_form.scss index 1a602cb..673e4a1 100644 --- a/client/scss/components/_form.scss +++ b/client/scss/components/_form.scss @@ -11,14 +11,63 @@ } .snippet-form { + box-sizing: border-box; background-color: $bgColor; + // Desktop Grid + @media only screen and (min-width: 700px) { + padding: 15px $boxPadding; + display: grid; + grid-template: "a b c d" "e e e e"; + grid-template-columns: 1fr 1fr 1fr 10fr; + align-items: center; + + .form-textarea { + height: 70vh; + display: flex; + flex-direction: column; + align-items: stretch; + border-top: 1px solid $borderColor; + margin-top: 15px; + padding-top: 15px; + } + .form-action { justify-self: end; } + } + + // Mobile Grid + @media only screen and (max-width: 699px) { + padding: 10px; + display: grid; + justify-content: space-between; + grid-template: "a b" "c c" "e e" "d d"; + align-items: center; + .form-expire select { margin-right: 0; } + .form-action { justify-self: start; } + + p { padding: 4px 0; } + } + + // ⬇ Layout + .form-lexer { grid-area: a;} + .form-expire { grid-area: b; } + .form-rtl { grid-area: c; white-space: nowrap; } + .form-action { grid-area: d; } + .form-textarea { grid-area: e; } + + .form-action { + .btn { + width: auto; + padding: 6px 20px; + } + } + + // ⬇ Form Element Appearance label { display: none; font-size: 13px; } - .options-rtl label { + .form-rtl label { display: inline; } @@ -58,38 +107,16 @@ } } - .options { - @include boxPadding(0, 0); + textarea { + padding: 20px; + @include codeTextArea; + box-sizing: border-box; + width: 100%; + height: 100%; + border: 1px solid $borderColor; - height: 60px; - display: flex; - align-items: center; - border-bottom: 1px solid $borderColor; - - .action { - margin-left: auto; - - .btn { - width: auto; - padding: 6px 20px; - } - } - } - - .content { - @include boxPadding(20px, 20px); - - textarea { - padding: 20px; - @include codeTextArea; - min-height: 390px; - box-sizing: border-box; - width: 100%; - border: 1px solid $borderColor; - - &:active, &:focus { - border-color: darken($selectBorderColor, 10%) - } + &:active, &:focus { + border-color: darken($selectBorderColor, 10%) } } } diff --git a/client/scss/components/_header.scss b/client/scss/components/_header.scss index d387699..c7cafce 100644 --- a/client/scss/components/_header.scss +++ b/client/scss/components/_header.scss @@ -73,7 +73,7 @@ ul#snippetOptions { display: flex; align-items: center; - + a:link, a:visited { color: $metaTextColor; text-decoration: underline; @@ -140,3 +140,9 @@ ul#snippetOptions { position: absolute; left: -9999px; } + +// Hide some options on mobile to make up space +@media only screen and (max-width: 700px) { + .option-type, .sep, .option-edit, .option-slim{ display: none; } + #copyHeadline { display: none; } +} diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..cdc1f3d --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,4 @@ +.highlight { background-color: #f8f8f8; } +.highlight pre { font-size: 1em; } +.sidebar .searchbox { border-top: 1px solid #eaecef;; } + diff --git a/docs/_static/logo.svg b/docs/_static/logo.svg deleted file mode 100644 index 29f1040..0000000 --- a/docs/_static/logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/conf.py b/docs/conf.py index e36d914..3def51e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,8 +19,10 @@ # -- Project information ----------------------------------------------------- +from datetime import datetime + project = 'dpaste' -copyright = '2018, Martin Mahner' +copyright = f'2013—{datetime.now().year}, Martin Mahner' author = 'Martin Mahner' # The short X.Y version @@ -69,7 +71,7 @@ language = None exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "tango" # -- Options for HTML output ------------------------------------------------- @@ -79,9 +81,17 @@ pygments_style = 'sphinx' # try: - import sphinx_rtd_theme - html_theme = "sphinx_rtd_theme" - html_theme_path = ["_themes", ] + html_theme = "press" + html_css_files = ["custom.css"] + html_sidebars = {'**': ['util/sidetoc.html', 'util/searchbox.html']} + html_theme_options = { + "external_links": [ + ("🐞 File an issue", "https://github.com/bartTC/dpaste/issues"), + ("Github", "https://github.com/bartTC/dpaste"), + ("Docker Hub", "https://hub.docker.com/r/barttc/dpaste"), + ("dpaste.org", "https://dpaste.org") + ] + } except ImportError: html_theme = 'alabaster' diff --git a/docs/rtd-requirements.txt b/docs/rtd-requirements.txt index 4df3b68..e445b09 100644 --- a/docs/rtd-requirements.txt +++ b/docs/rtd-requirements.txt @@ -1 +1,2 @@ sphinxcontrib-httpdomain +sphinx_press_theme diff --git a/dpaste/apps.py b/dpaste/apps.py index 61dcfeb..98ef963 100644 --- a/dpaste/apps.py +++ b/dpaste/apps.py @@ -76,10 +76,10 @@ class dpasteAppConfig(AppConfig): # ) EXPIRE_CHOICES = ( ("onetime", _("One-Time snippet")), - (3600, _("In one hour")), - (3600 * 24 * 7, _("In one week")), - (3600 * 24 * 30, _("In one month")), - ("never", _("Never")), + (3600, _("Expire in one hour")), + (3600 * 24 * 7, _("Expire in one week")), + (3600 * 24 * 30, _("Expire in one month")), + ("never", _("Never Expire")), ) # Default value for ``EXPIRE_CHOICES`` diff --git a/dpaste/templates/dpaste/details.html b/dpaste/templates/dpaste/details.html index d0fe094..af29616 100644 --- a/dpaste/templates/dpaste/details.html +++ b/dpaste/templates/dpaste/details.html @@ -7,19 +7,20 @@ {% block body_type %}{%endblock %} {% block headline %} - {{ request.build_absolute_uri }} - - - - - - - +
+ {{ request.build_absolute_uri }} + + + + + + +
{% endblock %} {% block options %}