Saved: 2017-11-20 02:30

Torey Heinz committed Nov 20, 2017
commit 81c8822ff32237fbc9ba7659d653a0a108093e8d
Showing 3 changed files with 112 additions and 1 deletions
app/content_types/customer_messages.yml +65 -0
@@ @@ -0,0 +1,65 @@
+ # Human readable name of this type
+ name: Customer messages
+
+ # Lowercase, underscored handle used to access this type
+ slug: customer_messages
+
+ # Explanatory text displayed in the back-office
+ description: A description of the content type for the editors
+
+ # Slug of field used to identify entries by default, such as the title
+ label_field_name: name
+
+ # Valid values: manually, created_at, updated_at, or the slug of any field
+ order_by: manually
+
+ public_submission_enabled: true
+
+ # 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:
+ - name: # The lowercase, underscored name of the field
+ label: Name # Human readable name of the field
+ type: string
+ required: true
+ localized: false
+
+ - phone: # The lowercase, underscored name of the field
+ label: Phone # Human readable name of the field
+ type: string
+ required: true
+ localized: false
+
+ - email: # The lowercase, underscored name of the field
+ label: Email # Human readable name of the field
+ type: string
+ required: true
+ localized: false
+
+ - message: # The lowercase, underscored name of the field
+ label: Message # Human readable name of the field
+ type: text
+ required: false
+ localized: false
+ # text_formatting: html # html (uses rich text editor), markdown or text (uses plain text editor)
app/views/pages/contact.liquid +43 -1
@@ @@ -10,4 +10,46 @@ editable_elements:
main/content: 'CONTACT INFO<br>Phone: (616) 956-6800<br>Fax: (616) 956-6899<br><br>1550
E. Beltline Ave. SE<br>Suite 360<br>Grand Rapids, MI 49506<br><br>Email: info@choicecastings.com'
---
- {% extends "layouts/application" %}
\ No newline at end of file
+ {% extends "layouts/application" %}
+ {% block main %}
+ <div class="row">
+ <div class="column content page">
+ <h1>{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1>
+ {% editable_text content %}Lorem ipsum{% endeditable_text %}
+ <hr>
+ <h2>Send us a Message</h2>
+ {% model_form 'customer_messages', success: '/', error: '/contact' %}
+
+ {% if customer_message.errors %}
+ <p>The following errors occured:</p>
+ <ul>
+ {% for error in customer_message.errors %}
+ <li>{{error[0] | capitalize}} - {{error[1]}}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
+ <p>
+ Name:<br>
+ <input type="text" name="content[name]" value="{{customer_message.name}}">
+ </p>
+
+ <p>
+ Phone:<br>
+ <input type="text" name="content[phone]" value="{{customer_message.phone}}">
+ </p>
+
+ <p>
+ Email:<br>
+ <input type="text" name="content[email]" value="{{customer_message.email}}">
+ </p>
+
+ <p>
+ Message:<br>
+ <textarea name="content[message]" >{{customer_message.message}}</textarea>
+ </p>
+ <input type="submit" class="button" value="Send Message">
+ {% endmodel_form %}
+ </div>
+ </div>
+ {% endblock %}
public/stylesheets/app.scss +4 -0
@@ @@ -227,3 +227,7 @@ footer {
}
}
}
+
+ textarea {
+ min-height: 200px;
+ }