Ver código fonte

Format code with Prettier

Sage Abdullah 2 anos atrás
pai
commit
dfa2c511b1

+ 14 - 14
.gitpod.yml

@@ -1,22 +1,22 @@
 image:
   file: .gitpod.dockerfile
 ports:
-- port: 8080
-  onOpen: open-preview
+  - port: 8080
+    onOpen: open-preview
 tasks:
-- init: |
-    cp bakerydemo/settings/local.py.example bakerydemo/settings/local.py
-    echo "DJANGO_SETTINGS_MODULE=bakerydemo.settings.local" > .env
-    python -m pip install -r requirements.txt
-    python manage.py makemigrations
-    python manage.py migrate
-    python manage.py load_initial_data
-    echo "CSRF_TRUSTED_ORIGINS = ['https://*.gitpod.io']" >> bakerydemo/settings/local.py
-  command: |
-    python manage.py runserver 0.0.0.0:8080
+  - init: |
+      cp bakerydemo/settings/local.py.example bakerydemo/settings/local.py
+      echo "DJANGO_SETTINGS_MODULE=bakerydemo.settings.local" > .env
+      python -m pip install -r requirements.txt
+      python manage.py makemigrations
+      python manage.py migrate
+      python manage.py load_initial_data
+      echo "CSRF_TRUSTED_ORIGINS = ['https://*.gitpod.io']" >> bakerydemo/settings/local.py
+    command: |
+      python manage.py runserver 0.0.0.0:8080
 github:
-    prebuilds:
-        pullRequestsFromForks: true
+  prebuilds:
+    pullRequestsFromForks: true
 vscode:
   extensions:
     - ms-python.python

+ 1 - 3
app.json

@@ -11,7 +11,5 @@
   "scripts": {
     "postdeploy": "django-admin migrate && django-admin load_initial_data && echo 'from wagtail.images.models import Rendition; Rendition.objects.all().delete()' | django-admin shell"
   },
-  "addons": [
-    "heroku-postgresql:hobby-dev"
-  ]
+  "addons": ["heroku-postgresql:hobby-dev"]
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 1376 - 3395
bakerydemo/base/fixtures/bakerydemo.json


+ 24 - 14
bakerydemo/static/css/font-open-sans.css

@@ -1,10 +1,11 @@
 /* open-sans-300 - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
 @font-face {
-    font-family: 'Open Sans';
-    font-style: normal;
-    font-display: swap;
-    font-weight: 300;
-    src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-300.woff2') format('woff2');
+  font-family: 'Open Sans';
+  font-style: normal;
+  font-display: swap;
+  font-weight: 300;
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-300.woff2')
+    format('woff2');
 }
 
 /* open-sans-300italic - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -13,7 +14,8 @@
   font-style: italic;
   font-display: swap;
   font-weight: 300;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-300italic.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-300italic.woff2')
+    format('woff2');
 }
 
 /* open-sans-regular - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -22,7 +24,8 @@
   font-style: normal;
   font-display: swap;
   font-weight: 400;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-regular.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-regular.woff2')
+    format('woff2');
 }
 
 /* open-sans-italic - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -31,7 +34,8 @@
   font-style: italic;
   font-display: swap;
   font-weight: 400;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-italic.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-italic.woff2')
+    format('woff2');
 }
 
 /* open-sans-600 - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -40,7 +44,8 @@
   font-style: normal;
   font-display: swap;
   font-weight: 600;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-600.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-600.woff2')
+    format('woff2');
 }
 
 /* open-sans-600italic - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -49,7 +54,8 @@
   font-style: italic;
   font-display: swap;
   font-weight: 600;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-600italic.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-600italic.woff2')
+    format('woff2');
 }
 
 /* open-sans-700 - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -58,7 +64,8 @@
   font-style: normal;
   font-display: swap;
   font-weight: 700;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-700.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-700.woff2')
+    format('woff2');
 }
 
 /* open-sans-700italic - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -67,7 +74,8 @@
   font-style: italic;
   font-display: swap;
   font-weight: 700;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-700italic.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-700italic.woff2')
+    format('woff2');
 }
 
 /* open-sans-800 - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -76,7 +84,8 @@
   font-style: normal;
   font-display: swap;
   font-weight: 800;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-800.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-800.woff2')
+    format('woff2');
 }
 
 /* open-sans-800italic - vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext */
@@ -85,5 +94,6 @@
   font-style: italic;
   font-display: swap;
   font-weight: 800;
-  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-800italic.woff2') format('woff2');
+  src: url('../fonts/open-sans-v17-vietnamese_greek_cyrillic-ext_cyrillic_latin_greek-ext_latin-ext-800italic.woff2')
+    format('woff2');
 }

+ 42 - 43
bakerydemo/static/css/main.css

@@ -18,7 +18,7 @@
 :root {
   --dark: #333333;
   --grey: #6e6e6e;
-  --border-grey: #E1DCD3;
+  --border-grey: #e1dcd3;
   --transparent-border: rgba(135, 116, 79, 0.25);
   --white: #ffffff;
   --cream: #f5f3e9;
@@ -27,8 +27,8 @@
   --dark-brown: #553801;
   --orange: #c55302;
   --dark-orange: #833701;
-  --font--primary: "Marcellus", serif;
-  --font--secondary: "Open Sans", sans-serif;
+  --font--primary: 'Marcellus', serif;
+  --font--secondary: 'Open Sans', sans-serif;
   --font-sm: 1rem;
   --font-md: 1.125rem;
 }
@@ -500,7 +500,7 @@ blockquote .attribute_name {
   border: none;
 }
 
-.navigation__mobile-toggle[aria-expanded="true"] {
+.navigation__mobile-toggle[aria-expanded='true'] {
   position: absolute;
   z-index: 15;
   top: 30px;
@@ -513,16 +513,18 @@ blockquote .attribute_name {
   }
 }
 
-.navigation__mobile-toggle[aria-expanded="true"] .navigation__toggle-icon-bar {
+.navigation__mobile-toggle[aria-expanded='true'] .navigation__toggle-icon-bar {
   opacity: 0;
 }
 
-.navigation__mobile-toggle[aria-expanded="true"] .navigation__toggle-icon-bar:first-of-type {
+.navigation__mobile-toggle[aria-expanded='true']
+  .navigation__toggle-icon-bar:first-of-type {
   transform: translateY(10px) rotate(45deg);
   opacity: 1;
 }
 
-.navigation__mobile-toggle[aria-expanded="true"] .navigation__toggle-icon-bar:last-child {
+.navigation__mobile-toggle[aria-expanded='true']
+  .navigation__toggle-icon-bar:last-child {
   transform: translateY(-10px) rotate(-45deg);
   opacity: 1;
 }
@@ -584,11 +586,11 @@ blockquote .attribute_name {
   }
 }
 
-.navigation__items>li {
+.navigation__items > li {
   padding: 10px 0;
 }
 
-.navigation__items>li>a {
+.navigation__items > li > a {
   color: var(--dark);
   font-family: var(--font--secondary);
   font-size: var(--font-md);
@@ -596,40 +598,38 @@ blockquote .attribute_name {
   padding: 10px 0;
 }
 
-
-
 @media (min-width: 1150px) {
   .navigation__items {
     display: block;
   }
 
-  .navigation__items>li {
+  .navigation__items > li {
     padding: 0 0 0 20px;
   }
 
-  .navigation__items>li>a {
+  .navigation__items > li > a {
     padding: 10px;
   }
 
-  .navigation__items>li:first-child {
+  .navigation__items > li:first-child {
     padding: 0 0 0 20px;
   }
 }
 
 /* N.B. We're overriding Bootstrap's default nav styles here,
    these rules set what the currently active nav tab looks like. */
-.navigation__items>li.active>a,
-.navigation__items>li.active>a:focus,
-.navigation__items>li.active>a:hover {
+.navigation__items > li.active > a,
+.navigation__items > li.active > a:focus,
+.navigation__items > li.active > a:hover {
   color: var(--dark);
   border-radius: 0;
   border: none;
   background-color: transparent;
 }
 
-.navigation__items>li:hover,
-.navigation__items>li>a:focus,
-.navigation__items>li>a:hover {
+.navigation__items > li:hover,
+.navigation__items > li > a:focus,
+.navigation__items > li > a:hover {
   text-decoration: underline;
 }
 
@@ -709,15 +709,14 @@ blockquote .attribute_name {
   border: transparent;
 }
 
-
-.dropdown-menu>li>a {
+.dropdown-menu > li > a {
   border-bottom: 1px solid var(--border-grey);
   color: var(--dark);
   font-family: var(--font--secondary);
   padding: 10px 20px;
 }
 
-.dropdown-menu>li>a:hover {
+.dropdown-menu > li > a:hover {
   text-decoration: underline;
 }
 
@@ -733,12 +732,12 @@ li.has-submenu a.allow-toggle {
 }
 
 .caret-custom:after {
-  content: "▼" !important;
+  content: '▼' !important;
 }
 
 /* Mobile menu styling */
 @media (max-width: 1150px) {
-  .nav-pills>.presentation {
+  .nav-pills > .presentation {
     float: none;
     width: 100%;
   }
@@ -801,7 +800,7 @@ footer {
   }
 }
 
-.container-narrow>hr {
+.container-narrow > hr {
   margin: 30px 0;
 }
 
@@ -823,7 +822,7 @@ footer {
   background-color: transparent;
 }
 
-.breadcrumb>li+li:before {
+.breadcrumb > li + li:before {
   display: none;
 }
 
@@ -973,7 +972,7 @@ footer {
   color: var(--white);
 }
 
-.blog-tags__pill:hover.blog-tags__pill--selected{
+.blog-tags__pill:hover.blog-tags__pill--selected {
   background-color: var(--dark-orange);
 }
 
@@ -1024,10 +1023,12 @@ footer {
 }
 
 .blog-list-item .text {
-  background: linear-gradient(to bottom,
-      rgba(0, 0, 0, 0) 0%,
-      rgba(0, 0, 0, 0.6) 23%,
-      rgba(0, 0, 0, 1) 50%);
+  background: linear-gradient(
+    to bottom,
+    rgba(0, 0, 0, 0) 0%,
+    rgba(0, 0, 0, 0.6) 23%,
+    rgba(0, 0, 0, 1) 50%
+  );
   margin-top: -150px;
   padding: 20px;
   position: relative;
@@ -1105,7 +1106,6 @@ footer {
   .blog__tag-introduction {
     margin-top: 100px;
   }
-
 }
 
 /* ---- Gallery Page ---- */
@@ -1248,7 +1248,7 @@ select {
   border: 1px solid var(--dark);
 }
 
-.form-page input[type="submit"]{
+.form-page input[type='submit'] {
   border: none;
   color: var(--white);
   background-color: var(--orange);
@@ -1260,12 +1260,12 @@ select {
   width: max-content;
 }
 
-.form-page input[type="submit"]:hover {
+.form-page input[type='submit']:hover {
   background-color: var(--dark);
 }
 
-.form-page li input[type="checkbox"],
-input[type="radio"] {
+.form-page li input[type='checkbox'],
+input[type='radio'] {
   display: inline-block;
   margin-right: 10px;
 }
@@ -1314,7 +1314,7 @@ input[type="radio"] {
   margin: -10px 0 10px 0;
 }
 
-@media (min-width: 766px){
+@media (min-width: 766px) {
   .form-page input,
   textarea,
   select {
@@ -1326,7 +1326,7 @@ input[type="radio"] {
   }
 
   .form-page__field {
-      margin-bottom: 50px;
+    margin-bottom: 50px;
   }
 }
 
@@ -1678,8 +1678,8 @@ input[type="radio"] {
   }
 }
 
-.row.no-gutters>[class^="col-"],
-.row.no-gutters>[class*=" col-"] {
+.row.no-gutters > [class^='col-'],
+.row.no-gutters > [class*=' col-'] {
   padding-right: 0;
   padding-left: 0;
 }
@@ -1749,7 +1749,7 @@ input[type="radio"] {
 }
 
 .picture-card__image:before {
-  content: "";
+  content: '';
   position: absolute;
   height: 200px;
   left: 0px;
@@ -1871,7 +1871,6 @@ input[type="radio"] {
     font-size: var(--font-sm);
     line-height: 1.5;
   }
-
 }
 
 /* #endregion */

+ 13 - 12
bakerydemo/static/js/main.js

@@ -1,23 +1,24 @@
 const navigation = document.querySelector('[data-navigation]');
 const mobileNavigation = navigation.querySelector('[data-mobile-navigation]');
 const body = document.querySelector('body');
-const mobileNavigationToggle = navigation.querySelector('[data-mobile-navigation-toggle]');
+const mobileNavigationToggle = navigation.querySelector(
+  '[data-mobile-navigation-toggle]',
+);
 
 function toggleMobileNavigation() {
-    if (mobileNavigation.hidden) {
-      body.classList.add('no-scroll');
-      mobileNavigation.hidden = false;
-      mobileNavigationToggle.setAttribute('aria-expanded', 'true');
-    } else {
-      body.classList.remove('no-scroll');
-      mobileNavigation.hidden = true;
-      mobileNavigationToggle.setAttribute('aria-expanded', 'false');
-    }
+  if (mobileNavigation.hidden) {
+    body.classList.add('no-scroll');
+    mobileNavigation.hidden = false;
+    mobileNavigationToggle.setAttribute('aria-expanded', 'true');
+  } else {
+    body.classList.remove('no-scroll');
+    mobileNavigation.hidden = true;
+    mobileNavigationToggle.setAttribute('aria-expanded', 'false');
+  }
 }
 
 document.addEventListener('DOMContentLoaded', () => {
   mobileNavigationToggle.addEventListener('click', () => {
     toggleMobileNavigation();
   });
-})
-
+});

+ 3 - 3
docker-compose.yml

@@ -9,12 +9,12 @@ services:
     restart: always
     image: postgres:14.1
     expose:
-      - "5432"
+      - '5432'
   redis:
     restart: always
     image: redis:6.2
     expose:
-      - "6379"
+      - '6379'
   app:
     environment:
       DJANGO_SECRET_KEY: changeme
@@ -29,7 +29,7 @@ services:
       - db:db
       - redis:redis
     ports:
-      - "8000:8000"
+      - '8000:8000'
     depends_on:
       - db
       - redis

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff