moj_template 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +29 -0
- data/app/views/layouts/moj_template.html.erb +1 -1
- data/lib/moj_template/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78f0361af02fae0c4e29a030b91c4a25269a4dd2
|
4
|
+
data.tar.gz: 92f3e5e7005d455094c35bcb0ee43e77546be888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f976d41f29ba02afc9c35e8dc145e076e61fb79d6007a4c367bbea0cb5b9b8e739c355dff51f01da27d32fbad429553c6bd505be3fa9e1cc9631f146fea67287
|
7
|
+
data.tar.gz: 5bb7315527757205a83b2211626d6ab6a6f94982bbf150e31b2741d53a02bb05ede365c08bdede9b4a187da82116755a260c7e8d5b06c3b758207775b0732ea4
|
data/README.md
CHANGED
@@ -19,6 +19,7 @@ At present this generates 5 output formats:
|
|
19
19
|
3. a folder containing Mustache templates
|
20
20
|
4. a tarball containing Mustache Inheritance templates
|
21
21
|
5. a tarball
|
22
|
+
6. a django python package
|
22
23
|
|
23
24
|
### Gem version
|
24
25
|
|
@@ -53,6 +54,34 @@ In order for these files to work, you will need to set a number of variables in
|
|
53
54
|
# Google Analytics ID (Tracking ID for the service)
|
54
55
|
config.ga_id = ''
|
55
56
|
|
57
|
+
### Django version
|
58
|
+
|
59
|
+
To use the django package, add it to your app using:
|
60
|
+
|
61
|
+
pip install moj_template
|
62
|
+
|
63
|
+
Then extend your base template from the moj_template using:
|
64
|
+
|
65
|
+
{% extends 'moj_template/base.html' %}
|
66
|
+
|
67
|
+
#### Django Config
|
68
|
+
|
69
|
+
You will be required to set up some additional config to use the package. Add the following to your `TEMPLATE_CONTEXT_PROCESSORS`:
|
70
|
+
|
71
|
+
"{app_path}.apps.core.context_processors.globals"
|
72
|
+
|
73
|
+
Then include the following in a new file called `apps/core/context_processors.py`:
|
74
|
+
|
75
|
+
def globals(request):
|
76
|
+
return {
|
77
|
+
'app_title': '', # Application Title (Populates <title>)
|
78
|
+
'proposition_title': '', # Proposition Title (Populates proposition header)
|
79
|
+
'phase': '', # Current Phase (Sets the current phase and the colour of phase tags). Presumed values: alpha, beta, live
|
80
|
+
'product_type': '', # Product Type (Adds class to body based on service type). Presumed values: information, service
|
81
|
+
'feedback_url': '', # Feedback URL (URL for feedback link in phase banner)
|
82
|
+
'ga_id': '' # Google Analytics ID (Tracking ID for the service)
|
83
|
+
}
|
84
|
+
|
56
85
|
### Play version
|
57
86
|
|
58
87
|
To generate the tarball of Play Framework templates run `bundle exec rake build:play`. This will produce a tarball in the `pkg` directory.
|
@@ -92,7 +92,7 @@
|
|
92
92
|
</div>
|
93
93
|
<div class="service-header">
|
94
94
|
<a href="/" class="service-name"><%= "#{config_item(:proposition_title)}" %></a>
|
95
|
-
<% if config_item(:phase) != :live %><a href="https://www.gov.uk/service-manual/phases/<%= "#{config_item(:phase).to_s.downcase}" %>.html" class="service-phase <%= "#{config_item(:phase).to_s.downcase}" %>"><%= "#{config_item(:phase
|
95
|
+
<% if config_item(:phase) != :live %><a href="https://www.gov.uk/service-manual/phases/<%= "#{config_item(:phase).to_s.downcase}" %>.html" class="service-phase <%= "#{config_item(:phase).to_s.downcase}" %>"><%= "#{config_item(:phase.to_s.downcase)}" %></a><% end %>
|
96
96
|
</div>
|
97
97
|
<%= yield :inside_header %>
|
98
98
|
</div>
|
data/lib/moj_template/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moj_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dom Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|