Saved: 2018-07-02 17:11
Torey Heinz
committed Jul 02, 2018
commit 7192b09f11161ef8b9de54d846bd221ca57aa116
Showing 12
changed files with
102 additions
and 41 deletions
app/content_types/featured_slides.yml
+61
-0
| @@ | @@ -0,0 +1,61 @@ |
| + | # Human readable name of this type |
| + | name: Featured Slides |
| + | |
| + | # Lowercase, underscored handle used to access this type |
| + | slug: featured_slides |
| + | |
| + | # Explanatory text displayed in the back-office |
| + | description: Home Page Slides |
| + | |
| + | # Slug of field used to identify entries by default, such as the title |
| + | label_field_name: title |
| + | |
| + | # Valid values: manually, created_at, updated_at, or the slug of any field |
| + | order_by: manually |
| + | |
| + | # Valid values: asc (ascending) and desc (descending). Set to asc by default. |
| + | # order_direction: asc |
| + | |
| + | # Specify a field slug to group entries by that field in the back-office. |
| + | # group_by: <your field> |
| + | |
| + | # Activate public 'create' API (e.g for a contact form) |
| + | # public_submission_enabled: false |
| + | |
| + | # Array of emails to be notified of new entries made with the public API |
| + | # public_submission_accounts: ['john@example.com'] |
| + | |
| + | # Control the display of the content type in the back-office. |
| + | # display_settings: |
| + | # seo: false # display the SEO tab for the content entries |
| + | # advanced: false # display the Advanced tab for the content entries |
| + | # position: 1 # position in the sidebar menu |
| + | # hidden: false # hidden for authors? |
| + | |
| + | # By default, the back-office displays the _label property (see label_field_name) of the content entry. This can be modified by writing your own Liquid template below: |
| + | # entry_template: '<a href="{{ link }}">{{ entry._label }}</a>' # The default template |
| + | |
| + | # A list describing each field |
| + | fields: |
| + | - title: # The lowercase, underscored name of the field |
| + | label: Title # Human readable name of the field |
| + | type: string |
| + | required: true |
| + | hint: Short Title |
| + | localized: false |
| + | # text_formatting: html # html (uses rich text editor), markdown or text (uses plain text editor) |
| + | |
| + | - intro: # The lowercase, underscored name of the field |
| + | label: Intro # Human readable name of the field |
| + | type: text |
| + | required: true |
| + | hint: Short Intro |
| + | localized: false |
| + | text_formatting: html # html (uses rich text editor), markdown or text (uses plain text editor) |
| + | |
| + | - image: # The lowercase, underscored name of the field |
| + | label: Image # Human readable name of the field |
| + | type: file |
| + | required: false |
| + | hint: Image should be at least 600x300px |
| + | localized: false |
app/views/pages/index.liquid
+11
-37
| @@ | @@ -50,42 +50,16 @@ editable_elements: |
| </div> | |
| <div class="large-6 column"> | |
| <ul class="slides text-center"> | |
| - | <li class="slide" style="background: url('{{ 'slides/slide-1.jpg' | theme_image_url | resize: '600x300#' }}') top center no-repeat;"> |
| - | <div class="content"> |
| - | <p class="lead">Stocked Items</p> |
| - | <p>Hand wheels - Nest caps - Wing nuts - Spike Grids</p> |
| - | </div> |
| - | </li> |
| - | <li class="slide" style="background: url('{{ 'slides/slide-2.jpg' | theme_image_url | resize: '600x300#' }}') top center no-repeat;"> |
| - | <div class="content"> |
| - | <p class="lead">Conversions</p> |
| - | <p>Castings are simpler and more effective than fabrications.</p> |
| - | </div> |
| - | </li> |
| - | <li class="slide" style="background: url('{{ 'slides/slide-3.jpg' | theme_image_url | resize: '600x300#' }}') top center no-repeat;"> |
| - | <div class="content"> |
| - | <p class="lead">Cast Threads</p> |
| - | <p>Malleable iron with cast internal NPT and ACME threads.</p> |
| - | </div> |
| - | </li> |
| - | <li class="slide" style="background: url('{{ 'slides/slide-4.jpg' | theme_image_url | resize: '600x300#' }}') top center no-repeat;"> |
| - | <div class="content"> |
| - | <p class="lead">Large Castings</p> |
| - | <p>Small to large. Ferrous and Non Ferrous. Sand, permanent mold, investment cast.</p> |
| - | </div> |
| - | </li> |
| - | <li class="slide" style="background: url('{{ 'slides/slide-5.jpg' | theme_image_url | resize: '600x300#' }}') top center no-repeat;"> |
| - | <div class="content"> |
| - | <p class="lead">Machined Components</p> |
| - | <p>We can provide raw or machined castings.</p> |
| - | </div> |
| - | </li> |
| - | <li class="slide" style="background: url('{{ 'slides/slide-6.jpg' | theme_image_url | resize: '600x300#' }}') top center no-repeat;"> |
| - | <div class="content"> |
| - | <p class="lead">Inventory Program</p> |
| - | <p>Your deliveries will be coordinated, using stocking or consignment programs.</p> |
| - | </div> |
| - | </li> |
| + | {% editable_model featured_slides %} |
| + | {% for slide in contents.featured_slides %} |
| + | <li class="slide" style="background: url('{{ slide.image.url | resize: '600x300#' }}') top center no-repeat;"> |
| + | <div class="content"> |
| + | <p class="lead">{{ slide.title }}</p> |
| + | <p>{{ slide.intro }}</p> |
| + | </div> |
| + | </li> |
| + | {% endfor %} |
| + | {% endeditable_model %} |
| </ul> | |
| </div> | |
| </div> | |
| @@ | @@ -94,7 +68,7 @@ editable_elements: |
| <div class="row wide small-up-2 large-up-4 text-center gutter-small"> | |
| <h3 class="">In Stock Items</h3> | |
| {% editable_model products %} | |
| - | {% for product in contents.products %} |
| + | {% for product in contents.products limit: 4 %} |
| <div class="column"> | |
| <div class="card clickable" data-url="{% path_to product %}"> | |
| <img src="{{ product.image.url | resize: '200x200#' }}"> | |
app/views/pages/layouts/application.liquid
+2
-2
| @@ | @@ -61,13 +61,13 @@ is_layout: true |
| <!-- End Top Bar --> | |
| <div class="row expanded text-center banner"> | |
| {% comment %}<img class="banner-image" src="{{ 'banner-1.jpg' | theme_image_url }}">{% endcomment %} | |
| - | <p class="lead">A Single Source for <br>ALL of Your Casting Needs</p> |
| + | <p class="lead">Your Single Source for Castings<br> and Machined Components.</p> |
| </div> | |
| <div class="row expanded"> | |
| {% block main %} | |
| <div class="row"> | |
| <div class="column content page"> | |
| - | <h1>{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1> |
| + | <h1 class="text-center">{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1> |
| {% editable_text content %}Lorem ipsum{% endeditable_text %} | |
| </div> | |
| </div> | |
data/featured_slides.yml
+23
-0
| @@ | @@ -0,0 +1,23 @@ |
| + | - Stocked Items: |
| + | intro: "Hand wheels - Nest caps - Wing nuts - Spike Grids" |
| + | image: "/samples/slides/slide-1.jpg" |
| + | |
| + | - Conversions: |
| + | intro: "Castings are simpler and more effective than fabrications." |
| + | image: "/samples/slides/slide-2.jpg" |
| + | |
| + | - Cast Threads: |
| + | intro: "Malleable iron with cast internal NPT and ACME threads." |
| + | image: "/samples/slides/slide-3.jpg" |
| + | |
| + | - Large Castings: |
| + | intro: "Small to large. Ferrous and Non Ferrous. Sand, permanent mold, investment cast." |
| + | image: "/samples/slides/slide-4.jpg" |
| + | |
| + | - Machined Components: |
| + | intro: "We can provide raw or machined castings." |
| + | image: "/samples/slides/slide-5.jpg" |
| + | |
| + | - Inventory Program: |
| + | intro: "our deliveries will be coordinated, using stocking or consignment programs." |
| + | image: "/samples/slides/slide-6.jpg" |
log/server.log
+3
-0
| @@ | @@ -73,3 +73,6 @@ I, [2017-11-20T16:21:14.812438 #41267] INFO -- : Listening on 0.0.0.0:3000, CTR |
| I, [2018-07-02T16:37:49.675491 #63281] INFO -- : Thin web server (v1.6.4 codename Gob Bluth) | |
| I, [2018-07-02T16:37:49.675645 #63281] INFO -- : Maximum connections set to 1024 | |
| I, [2018-07-02T16:37:49.675736 #63281] INFO -- : Listening on 0.0.0.0:3000, CTRL+C to stop | |
| + | I, [2018-07-02T16:43:14.801021 #63452] INFO -- : Thin web server (v1.6.4 codename Gob Bluth) |
| + | I, [2018-07-02T16:43:14.801263 #63452] INFO -- : Maximum connections set to 1024 |
| + | I, [2018-07-02T16:43:14.801309 #63452] INFO -- : Listening on 0.0.0.0:3000, CTRL+C to stop |
public/samples/slides/slide-1.jpg
+0
-0
public/samples/slides/slide-2.jpg
+0
-0
public/samples/slides/slide-3.jpg
+0
-0
public/samples/slides/slide-4.jpg
+0
-0
public/samples/slides/slide-5.jpg
+0
-0
public/samples/slides/slide-6.jpg
+0
-0
public/stylesheets/app.scss
+2
-2
| @@ | @@ -61,10 +61,10 @@ html { |
| .content.page { | |
| margin: rem-calc(10); | |
| box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); | |
| - | font-size: 1.4rem; |
| + | // font-size: 1.4rem; |
| @include breakpoint(small only) { | |
| - | font-size: 1.2rem; |
| + | // font-size: 1.2rem; |
| } | |
| } | |