Skip to content
This repository was archived by the owner on Apr 7, 2019. It is now read-only.

Commit 3720eda

Browse files
committed
Merge pull request #4 from EvanLovely/feature/show-unique-twig-features
show unique twig features
2 parents 39d2b83 + 3e753ff commit 3720eda

File tree

13 files changed

+143
-119
lines changed

13 files changed

+143
-119
lines changed

dist/_macros/forms.twig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% macro input(name, type, classes, label, placeholder, value, size, required) %}
2+
{% set show_label = label|default(true) %}
3+
<div class="field-container {{ classes }}">
4+
{% if show_label %}
5+
<label class="{{ classes }}">{{ label|default(name|title) }}{% if required %}<abbr title="Required">*</abbr>{% endif %}
6+
{% endif %}
7+
<input type="{{ type|default('text') }}" name="{{ name }}" placeholder="{{ placeholder|default(name|title) }}" value="{{ value|e }}" size="{{ size|default(20) }}"{% if required %} required{% endif %} />
8+
{% if show_label %}</label>{% endif %}
9+
</div>
10+
{% endmacro %}
11+
12+
{% macro textarea(label, placeholder, rows, classes) %}
13+
{% set show_label = label|default(true) %}
14+
<div class="field-container {{ classes }}">
15+
{% if show_label %}
16+
<label class="{{ classes }}">{{ label|default(name|title) }}{% if required %}<abbr title="Required">*</abbr>{% endif %}
17+
{% endif %}
18+
<textarea placeholder="{{ placeholder|default(name|title) }}" rows="{{ rows|default(8) }}"{% if required %} required{% endif %}></textarea>
19+
{% if show_label %}</label>{% endif %}
20+
</div>
21+
{% endmacro %}
Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,13 @@
1+
{% import "forms.twig" as forms %}
12
<fieldset>
2-
<div class="field-container">
3-
<label for="text">Text Input <abbr title="Required">*</abbr></label>
4-
<input id="text" type="text" placeholder="Text Input">
5-
</div>
6-
<div class="field-container">
7-
<label for="password">Password</label>
8-
<input id="password" type="password" placeholder="Type your Password">
9-
</div>
10-
<div class="field-container">
11-
<label for="webaddress">Web Address</label>
12-
<input id="webaddress" type="url" placeholder="http://yoursite.com">
13-
</div>
14-
<div class="field-container">
15-
<label for="emailaddress">Email Address</label>
16-
<input id="emailaddress" type="email" placeholder="[email protected]">
17-
</div>
18-
<div class="field-container">
19-
<label for="search">Search</label>
20-
<input id="search" type="search" placeholder="Enter Search Term">
21-
</div>
22-
<div class="field-container">
23-
<label for="text">Number Input <abbr title="Required">*</abbr></label>
24-
<input id="text" type="number" placeholder="Enter a Number" pattern="[0-9]*">
25-
</div>
26-
<div class="field-container">
27-
<label for="textarea">Textarea</label>
28-
<textarea id="textarea" rows="8" cols="48" placeholder="Enter your message here"></textarea>
29-
</div>
30-
<div class="field-container">
31-
<label class="error">Error Input</label>
32-
<input class="is-error" type="text" placeholder="Text Input">
33-
</div>
34-
<div class="field-container">
35-
<label class="valid">Valid</label>
36-
<input class="is-valid" type="text" placeholder="Text Input">
37-
</div>
38-
</fieldset>
3+
{{ forms.input('Text Input') }}
4+
{{ forms.input('Password', 'password') }}
5+
{{ forms.input('Web Address', 'url') }}
6+
{{ forms.input('Email', 'email') }}
7+
{{ forms.input('Search', 'search') }}
8+
{{ forms.input('Number', 'number') }}
9+
{{ forms.input('Number', 'number') }}
10+
{{ forms.textarea('Textarea', 'Enter your message here') }}
11+
{{ forms.input('Error Input', 'text', 'error') }}
12+
{{ forms.input('Valid Input', 'text', 'valid') }}
13+
</fieldset>

dist/_patterns/03-templates/00-homepage.twig

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="page" id="page">
2+
{% include "organisms-header" %}
3+
<div role="main">
4+
{% block hero %}{% endblock %}
5+
{% block title %}{% endblock %}
6+
{% block content %}{% endblock %}
7+
</div><!--End role=main-->
8+
{% include "organisms-footer" %}
9+
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "templates-site" %}
2+
{% block content %}
3+
<div class="l-one-col">
4+
<div class="l-main">
5+
{% block main %}
6+
<p>Content Placeholder</p>
7+
{% endblock %}
8+
</div>
9+
</div>
10+
{% endblock %}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends "templates-site" %}
2+
{% block content %}
3+
<div class="l-two-col">
4+
<div class="l-main">
5+
{% block main %}
6+
<p>Content Placeholder</p>
7+
{% endblock %}
8+
</div>
9+
<div class="l-sidebar">
10+
{% block sidebar %}
11+
<h3>Sidebar</h3>
12+
{% endblock %}
13+
</div>
14+
</div>
15+
{% endblock %}

dist/_patterns/03-templates/01-blog.twig

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% extends "templates-page-2col" %}
2+
{% block hero %}
3+
{% if emergency %}
4+
{% include "molecules-alert" with emergency %}
5+
{% endif %}
6+
{% if hero %}
7+
{% include "molecules-block-hero" %}
8+
{% endif %}
9+
10+
<div class="g g-3up">
11+
{% for tout in touts %}
12+
<div class="gi">
13+
{% include "molecules-block-inset" %}
14+
</div>
15+
{% endfor %}
16+
</div><!--end 3up-->
17+
18+
<hr/>
19+
{% endblock %}
20+
21+
{% block main %}
22+
<section class="section latest-posts">
23+
<h2 class="section-title">Latest Posts</h2>
24+
<ul class="post-list">
25+
{% for post in latest_posts %}
26+
<li>{% include "molecules-media-block" %}</li>
27+
{% endfor %}
28+
</ul>
29+
<a href="#" class="text-btn">View more posts</a>
30+
</section>
31+
{% endblock %}
32+
33+
{% block sidebar %}
34+
{% include "organisms-recent-tweets" %}
35+
{% endblock %}

dist/_patterns/03-templates/02-article.twig

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "templates-site" %}
2+
{% block title %}<h1 class="section-title">Our Outdoor Blog</h1>{% endblock %}
3+
4+
{% block main %}
5+
{% include "organisms-latest-posts" %}
6+
{% include "molecules-pagination" %}
7+
{% endblock %}
8+
9+
{% block sidebar %}
10+
{% include "organisms-recent-tweets" %}
11+
{% endblock %}

0 commit comments

Comments
 (0)