moj_template 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3de0fb0e0b4679ff3f6ebdcfce39183a30ff04f
4
- data.tar.gz: bff8b12aeb6be0362f0cc563dab0ada704bcc04e
3
+ metadata.gz: 78f0361af02fae0c4e29a030b91c4a25269a4dd2
4
+ data.tar.gz: 92f3e5e7005d455094c35bcb0ee43e77546be888
5
5
  SHA512:
6
- metadata.gz: dd01625715e62f4317a842315f3bf1fbb33ef6892888ed186dd72abb2654aee8573c27b9a7455bf33d44c131f2c99f04a2adb96edd0531d87a715fbb2e60d39e
7
- data.tar.gz: ef94cf284947214798351d0082b57c7d7a3a726314dbe7970d4ae4e05267497a435d8063b7859fc2d37a135715ba9d8bf493b679bd6b97940b921272c56fb962
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).to_s.upcase}" %></a><% end %>
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>
@@ -1,3 +1,3 @@
1
1
  module MojTemplate
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.0"
3
3
  end
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.3
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-18 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails