publish_my_data 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -35,19 +35,34 @@ Also: see our [sample app](http://github.com/swirrl/sample_pmd) where we've alre
35
35
  gem 'rails', '3.2.15'
36
36
  gem 'publish_my_data'
37
37
 
38
+ 3. Bundle.
38
39
 
39
- 3. Configure PublishMyData (in `application.rb`, or `development|production|test.rb`)
40
+ $ bundle
41
+
42
+ Fetching gem metadata from https://rubygems.org/.........
43
+ Fetching gem metadata from https://rubygems.org/..
44
+ Resolving dependencies...
45
+ ...
46
+ Installing publish_my_data (1.2.0)
47
+ Your bundle is updated!
48
+
49
+ If you don't see `publish_my_data (1.2.0)` in the output you may need to run `bundle update publish_my_data`
50
+
51
+ 4. Add the following line to production.rb
40
52
 
41
53
  config.assets.precompile += %w(modernizr.js publish_my_data.js) # <-- required for production
42
54
 
55
+ 5. Configure PublishMyData (in development|production|test.rb`)
56
+
43
57
  PublishMyData.configure do |config|
44
58
  config.sparql_endpoint = 'http://localhost:3030/pmd/sparql'
45
59
  config.local_domain = 'pmd.dev' # the domain under which your linked data resources URIs are minted
46
60
  config.sparql_timeout_seconds = 30
47
61
  config.tripod_cache_store = nil # Tripod::CacheStores::MemcachedCacheStore.new('localhost:11211')
62
+ config.application_name = "Your Application Name"
48
63
  end
49
64
 
50
- 4. Mount it in your `routes.rb`
65
+ 6. Mount it in your `routes.rb`
51
66
 
52
67
  # Note that there is no default home page route for publish_my_data. You need to define your own. e.g.
53
68
 
@@ -59,34 +74,63 @@ Also: see our [sample app](http://github.com/swirrl/sample_pmd) where we've alre
59
74
 
60
75
  mount PublishMyData::Engine, at: "/"
61
76
 
77
+ 6. In order for PublishMyData provided-views to be able to use helpers defined by our app, add the following to your `application.rb`:
78
+
79
+ config.to_prepare do
80
+ # include only the ApplicationHelper module in the PMD engine
81
+ PublishMyData::ApplicationController.helper ApplicationHelper
82
+ # # include all helpers from your application into the PMD engine
83
+ # PublishMyData::ApplicationController.helper YourApp::Application.helpers
84
+ end
62
85
 
63
- 5. Delete all files from the `public` dir except the `robots.txt`.
86
+ 7. Delete all files from the `public` dir except the `robots.txt`.
64
87
 
65
- 6. Create an application layout under `layouts/publish_my_data` (i.e. called `application.html.haml` or `application.html.erb` etc).
88
+ 8. Create an application layout under `app/views/layouts/publish_my_data` (i.e. called `application.html.haml` or `application.html.erb` etc). NOTE that if you create `application.html.haml` you should remove the existing `application.html.erb` file.
66
89
  It should provide content for `:head` and `:global_header`, then render `pmd_layout`. e.g.
67
90
 
68
91
  - content_for :head do
69
- %title
70
- My page title
92
+ %head
93
+ %title
94
+ = appname
95
+ = yield :page_title
96
+
97
+ = yield :page_description
98
+
99
+ = javascript_include_tag :modernizr
100
+ = javascript_include_tag :publish_my_data
101
+ = stylesheet_link_tag :application
71
102
 
72
103
  - content_for :global_header do
73
104
  My header here
74
105
 
75
106
  = render template: 'layouts/publish_my_data/pmd_layout'
76
107
 
77
- 7. Add the helpers in your app's `ApplicationController`, and derive from the engines application controller
108
+ 9. Add the helpers in your app's `ApplicationController`, and derive from the PublishMyData engines application controller
78
109
 
79
110
  class ApplicationController < PublishMyData::ApplicationController
111
+ protect_from_forgery
80
112
  helper PublishMyData::Engine.helpers
81
113
  helper :all
82
114
  end
83
115
 
84
- 8. In `assets/stylesheets/application.scss`:
116
+ 10. Remove `assets/stylesheets/application.css` and create a new file called `assets/stylesheets/application.scss` which contains the following lines:
85
117
 
86
118
  $pmdconfig_colour_link: #da0;
87
119
  /* [...optional style configuration...] */
88
120
  @import "publish_my_data.scss";
89
121
 
122
+ 11. You can configure the navigation in your application by overriding the `views/publish_my_data/stripes/_subnav.html.haml` partial to pass in different `:menu` locals
123
+
124
+ %nav.pmd_nav_sub
125
+ = row do
126
+ = render partial:'publish_my_data/shared/subnav_box', locals:{menu:standard_menu_catalogue}
127
+ = render partial:'publish_my_data/shared/subnav_box', locals:{menu:standard_menu_tools}
128
+ = render partial:'publish_my_data/shared/subnav_box', locals:{menu:alternative_menu_docs} # <-- # e.g. this line changed:
129
+ = render partial:'publish_my_data/shared/subnav_box', locals:{menu:standard_menu_pmd}
130
+
131
+ If you define a new helper method to provide the locals (e.g. in our case `alternative_menu_docs`), it can build upon, and adapt the data stucture provided by the existing helpers in `publish_my_data/subnavigation_helper.rb`.
132
+
133
+
90
134
  ##Licence
91
135
 
92
136
  Source code is licensed under the MIT-LICENSE included in this distribution.
@@ -95,17 +139,17 @@ Source code is licensed under the MIT-LICENSE included in this distribution.
95
139
 
96
140
  If you create a website powered by PublishMyData, we'd really appreciate it if you [let us know](mailto:hello@swirrl.com), and also credit us on your website (e.g. with a link in the footer to [the github repo](http://github.com/swirrl/publish_my_data) or [our website](http://www.swirrl.com/publishmydata)). The default footer supplied by the engine does this for you.
97
141
 
98
- ### Licence Exceptions
142
+ ###Licence Exceptions
99
143
 
100
144
  The Swirrl logo, which is the mark of Swirrl IT Limited and is copyright ©2013-4 Swirrl IT Limited, is licensed for use with no modification or adaptation permitted. It may be reproduced for purposes of attribution, but not in any way that suggests that Swirrl endorses you or your use.
101
145
 
102
- ## Contributing
146
+ ##Contributing
103
147
 
104
148
  If you want to issue a patch, bug fix or feature, please just issue a pull request (with tests where appropriate). Before accepting your first pull request, we ask you to send us an email agreeing to assigning to Swirrl the copyright for all project contributions. We will release any contibutions under the MIT license.
105
149
 
106
- ### Style Guidelines
150
+ ###Style Guidelines
107
151
 
108
- #### Ruby
152
+ ####Ruby
109
153
 
110
154
  We roughly try to follow [Github's Ruby Style Guide](https://github.com/styleguide/ruby).
111
155
 
@@ -1,5 +1,5 @@
1
1
  - title = resources_list_table_title
2
- - set_page_title title
2
+ - set_page_title strip_tags(title)
3
3
  - rdf_type_label = PublishMyData::RdfType.find(@type_filter).label rescue nil
4
4
  - highlight_in_menu "catalogue"
5
5
  - page_kind 'page of resources'
@@ -37,12 +37,11 @@
37
37
  Raw data for this resource (.ttl)
38
38
  %i.icon-popup
39
39
  - types_for_example_resource(dataset, resource).each do |type|
40
+ View
40
41
  = link_to list_resources_path(dataset: dataset, type_uri: type) do
41
- - if type.label
42
- View all
43
- = pluralize dataset.type_count(type.uri), type.label
44
- - else
45
- View all
46
- = dataset.type_count(type.uri)
47
- resources of type
48
- = type.uri
42
+ all
43
+ = dataset.type_count(type.uri)
44
+ resources of type
45
+ %strong
46
+ = type.label.nil? ? type.uri : type.label
47
+ %br
@@ -1,5 +1,5 @@
1
1
  // the standard_menu_x functions in subnavigation_helper.rb are intended to be overridden by
2
- // your app to customise the contents of one or more of the sum navigation menus
2
+ // your app to customise the contents of one or more of the sub navigation menus
3
3
 
4
4
  %nav.pmd_nav_sub
5
5
  = row do
@@ -1,3 +1,3 @@
1
1
  module PublishMyData
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publish_my_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -547,7 +547,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
547
547
  version: '0'
548
548
  segments:
549
549
  - 0
550
- hash: 2361323917019423723
550
+ hash: -3468905910205825529
551
551
  required_rubygems_version: !ruby/object:Gem::Requirement
552
552
  none: false
553
553
  requirements: