Project Images

Torey Heinz committed Feb 12, 2018
commit 0e59912c8d9b5d1ca80291ddbb9d1c543eccb212
Showing 15 changed files with 118 additions and 86 deletions
app/content_types/project_images.yml +17 -11
@@ @@ -37,12 +37,11 @@ order_by: manually
# 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: Explanatory text displayed in the back office
- localized: false
+ - project:
+ label: Project
+ type: belongs_to
+ class_name: projects
+ inverse_of: images
- file: # The lowercase, underscored name of the field
label: File # Human readable name of the field
@@ @@ -51,9 +50,16 @@ fields:
hint: Explanatory text displayed in the back office
localized: false
- - project:
- label: Project
- type: belongs_to
+ - category:
+ label: Category
+ type: select
required: true
- class_name: projects
- ui_enabled: true
+ select_options: ['Before', 'After']
+
+ - title: # The lowercase, underscored name of the field
+ label: Title # Human readable name of the field
+ type: string
+ hint: Explanatory text displayed in the back office
+ localized: false
+
+
app/content_types/projects.yml +6 -5
@@ @@ -58,15 +58,16 @@ fields:
hint: Explanatory text displayed in the back office
localized: false
# text_formatting: html # html (uses rich text editor), markdown or text (uses plain text editor)
+
- images:
- label: images
+ label: Images
type: has_many
class_name: project_images
inverse_of: project
- ui_enabled: true
- - offerings:
- label: offerings
+ - services:
+ label: Services
type: many_to_many
- class_name: offerings
+ class_name: services
inverse_of: projects
+
app/views/pages/index.liquid +14 -35
@@ @@ -10,42 +10,21 @@ is_layout: false
{% block 'main' %}
<div class="callout small">
<div class="row">
- <div class="columns large-4">
- <div class="card">
- <div class="card-divider">
- This is a header
+ {% with_scope featured: true %}
+ {% for service in contents.services %}
+ <div class="columns large-4">
+ <div class="card">
+ <div class="card-divider">
+ <a href="{% path_to service %}">{{ service.title }}</a>
+ </div>
+ <img src="http://via.placeholder.com/450x150">
+ <div class="card-section">
+ {{ service.brief }}
+ </div>
+ </div>
</div>
- <img src="assets/img/generic/rectangle-1.jpg">
- <div class="card-section">
- <h4>This is a card.</h4>
- <p>It has an easy to override visual style, and is appropriately subdued.</p>
- </div>
- </div>
- </div>
- <div class="columns large-4">
- <div class="card">
- <div class="card-divider">
- This is a header
- </div>
- <img src="assets/img/generic/rectangle-1.jpg">
- <div class="card-section">
- <h4>This is a card.</h4>
- <p>It has an easy to override visual style, and is appropriately subdued.</p>
- </div>
- </div>
- </div>
- <div class="columns large-4">
- <div class="card">
- <div class="card-divider">
- This is a header
- </div>
- <img src="assets/img/generic/rectangle-1.jpg">
- <div class="card-section">
- <h4>This is a card.</h4>
- <p>It has an easy to override visual style, and is appropriately subdued.</p>
- </div>
- </div>
- </div>
+ {% endfor %}
+ {% endwith_scope %}
</div>
</div>
{% endblock %}
app/views/pages/projects/content_type_template.liquid +40 -0
@@ @@ -0,0 +1,40 @@
+ ---
+ title: Project Template Page
+ content_type: projects
+ is_layout: true
+ ---
+ {% extends 'layouts/application' %}
+ {% block main %}
+ <h1>{{ project.title }}</h1>
+ {{ project.description }}
+ <ul>
+ {% for service in project.services %}
+ <li><a href="{% path_to service %}">{{ service.title }}</a></li>
+ {% endfor %}
+ </ul>
+
+
+ {% assign categories = 'Before,After' | split: ','] %}
+ <div class="row">
+ {% for category in categories %}
+ <div class="columns large-6">
+ <p><strong>{{ category }} Pics:</strong></p>
+ <div class="row small-up-2">
+ {% with_scope category: category %}
+ {% for image in project.images %}
+ <div class="column column-block">
+ <div class="card">
+ <div class="card-divider">
+ {{ image.title }}
+ </div>
+ <img src="{{ image.file.url }}">
+ </div>
+ </div>
+ {% endfor %}
+ {% endwith_scope %}
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ {% endblock %}
+
data/project_images.yml +16 -9
@@ @@ -1,12 +1,19 @@
- - "Sample 1":
- # file: /samples/project_images/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project Image 1":
+ project: project-1
+ category: Before
+ file: /samples/000_0018.jpg
- - "Sample 2":
- # file: /samples/project_images/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project Image 2":
+ project: project-1
+ category: Before
+ file: /samples/000_0019.jpg
- - "Sample 3":
- # file: /samples/project_images/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
-
- - "Sample 4":
- # file: /samples/project_images/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project Image 3":
+ project: project-1
+ category: After
+ file: /samples/000_0026.jpg
+ - "Project Image 4":
+ project: project-1
+ category: After
+ file: /samples/000_0028.jpg
data/projects.yml +8 -8
@@ @@ -1,16 +1,16 @@
- - "Sample 1":
- # featured_image: /samples/projects/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project 1":
+ featured_image: /samples/000_0030.jpg
description: "Ex in est est qui quaerat doloremque et. Sint architecto eveniet qui est ut quis eos. Nihil praesentium iste. Nobis reiciendis dolores. Error cumque culpa optio qui."
- - "Sample 2":
- # featured_image: /samples/projects/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project 2":
+ featured_image: /samples/000_0034.jpg
description: "Voluptates quas ullam. Autem quam ex iste vel. Enim molestias autem expedita."
- - "Sample 3":
- # featured_image: /samples/projects/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project 3":
+ featured_image: /samples/000_0039.jpg
description: "Quia maxime ut magni. Maiores illo autem et sequi. Tempore magni consequuntur aut sunt doloribus dolorem perspiciatis."
- - "Sample 4":
- # featured_image: /samples/projects/yourfile.txt # Path to a file in the public/samples folder or to a remote and external file.
+ - "Project 4":
+ featured_image: /samples/000_0045.jpg
description: "Tenetur corporis quos dolorem qui reprehenderit. Alias velit facilis molestias ut eius sit. Quaerat ab minus iste. Voluptate sed iste possimus. Adipisci illo eum."
notes.txt +17 -18
@@ @@ -1,7 +1,7 @@
- wagon generate content_type offering_types title:string featured_image:file description:text offerings:has_many
- wagon generate content_type offerings title:string featured_image:file description:text offering_type:belongs_to projects:many_to_many
- wagon generate content_type projects title:string featured_image:file description:text offerings:many_to_many project_images:has_many
- wagon generate content_type project_images title:string file:file project:belongs_to
+ be wagon generate content_type offering_types title:string featured_image:file description:text
+ be wagon generate content_type offerings title:string featured_image:file description:text
+ be wagon generate content_type projects title:string featured_image:file description:text
+ be wagon generate content_type project_images title:string file:file
OfferingTypes:
@@ @@ -17,10 +17,6 @@ Offerings:
belongs_to:offering-type
many_to_many:projects
- Features:
- - Bonded Windows
- - Custom Frame Bending
- - Track
Projects:
title:string
@@ @@ -36,17 +32,20 @@ ProjectImages:
DATA:
- OfferingTypes:
- - Boat Flooring
- - InteriorCarpet
- - Sea Deck
- - Infinity
- - Boat Enclosures
-
- - Commercial Sewing
- - Boat Tops
+ Services:
- Boat Covers
- Boat Dodgers
- - Upholstery
+ - Boat Enclosures
+ - Boat Tops
+ - Commercial Sewing
- Headliners
+ - Infinity Deck Flooring
+ - Interior Carpet Floring
- Repairs and Restitching
+ - Sea Deck Flooring
+ - Upholstery
+
+ Features:
+ - Bonded Windows
+ - Custom Frame Bending
+ - Track
public/samples/000_0018.jpg +0 -0
public/samples/000_0019.jpg +0 -0
public/samples/000_0026.jpg +0 -0
public/samples/000_0028.jpg +0 -0
public/samples/000_0030.jpg +0 -0
public/samples/000_0034.jpg +0 -0
public/samples/000_0039.jpg +0 -0
public/samples/000_0045.jpg +0 -0