pullentity-client 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +7 -1
- data/lib/pullentity-client/helpers.rb +17 -5
- data/lib/pullentity-client/templates/defaults/config.erb +1 -7
- data/lib/pullentity-client/version.rb +1 -1
- data/lib/pullentity-client.rb +1 -0
- data/pullentity-client.gemspec +4 -2
- data/vendor/assets/javascripts/pullentity-backbone/app/helpers/app_helper.js.coffee +2 -2
- data/vendor/assets/javascripts/pullentity-backbone/app/models/project.js.coffee +2 -2
- data/vendor/assets/javascripts/pullentity-backbone/app/models/section.js.coffee +2 -2
- data/vendor/assets/javascripts/pullentity-backbone/app/models/site.js.coffee +2 -2
- data/vendor/assets/javascripts/pullentity-backbone/app/site.js.coffee +1 -0
- data/vendor/assets/javascripts/pullentity-backbone/app/views/main.js.coffee +25 -1
- metadata +24 -18
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "middleman"
|
2
2
|
require 'middleman-target'
|
3
|
+
|
3
4
|
URL_REMOTE = "http://pullentity.s3.amazonaws.com"
|
4
5
|
|
5
6
|
module Pullentity::Client::Helpers
|
@@ -51,11 +52,15 @@ module Pullentity::Client::Helpers
|
|
51
52
|
end
|
52
53
|
end
|
53
54
|
|
54
|
-
|
55
55
|
end
|
56
56
|
|
57
|
+
# config.rb
|
58
|
+
require 'rack/rewrite'
|
59
|
+
|
60
|
+
|
57
61
|
module Pullentity::Client::MiddlemanConfig
|
58
62
|
class << self
|
63
|
+
|
59
64
|
def registered(app)
|
60
65
|
app.helpers Pullentity::Client::Helpers
|
61
66
|
app.set :site_name, site_name
|
@@ -69,13 +74,20 @@ module Pullentity::Client::MiddlemanConfig
|
|
69
74
|
app.set :markdown, :layout_engine => :haml
|
70
75
|
app.set :default_encoding, 'utf-8'
|
71
76
|
|
72
|
-
app.
|
73
|
-
# config is the Compass.configuration object
|
74
|
-
config.output_style = :compact
|
77
|
+
app.configure :build do
|
75
78
|
if target?(:pullentity)
|
76
|
-
|
79
|
+
activate :minify_css
|
80
|
+
activate :minify_javascript
|
81
|
+
app.set :http_prefix, "#{URL_REMOTE}"
|
82
|
+
app.set :images_dir, "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets"
|
77
83
|
end
|
78
84
|
end
|
85
|
+
|
86
|
+
app.use Rack::Rewrite do
|
87
|
+
r301 %r{/sections(.*)}, '/'
|
88
|
+
r301 %r{/projects(.*)}, '/'
|
89
|
+
end
|
90
|
+
|
79
91
|
end
|
80
92
|
|
81
93
|
def site_name
|
data/lib/pullentity-client.rb
CHANGED
data/pullentity-client.gemspec
CHANGED
@@ -26,12 +26,14 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_runtime_dependency(%q<erubis>, ["~> 2.7.0"])
|
27
27
|
gem.add_runtime_dependency(%q<rocco>, ["~> 0.7"])
|
28
28
|
gem.add_runtime_dependency(%q<thor>, ["~> 0.15.4"])
|
29
|
-
gem.add_runtime_dependency(%q<compass>, ["~> 0.12.2"])
|
29
|
+
#gem.add_runtime_dependency(%q<compass>, ["~> 0.12.2"])
|
30
30
|
gem.add_runtime_dependency(%q<session>, ["~> 3.1"])
|
31
|
-
gem.add_runtime_dependency(%q<middleman>, ["3.
|
31
|
+
gem.add_runtime_dependency(%q<middleman>, ["3.1.4"])
|
32
32
|
gem.add_runtime_dependency("middleman-target")
|
33
33
|
gem.add_runtime_dependency(%q<faraday>)
|
34
34
|
gem.add_runtime_dependency("json")
|
35
|
+
gem.add_runtime_dependency("rack-rewrite")
|
36
|
+
|
35
37
|
|
36
38
|
# gem.add_development_dependency(%q<bundler>, ["~> 1.0.14"])
|
37
39
|
gem.add_development_dependency(%q<bundler>, ["~> 1.1"])
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Handlebars.registerHelper 'SectionUrl', (section)->
|
2
|
-
"
|
2
|
+
"/#sections/#{section.id}"
|
3
3
|
|
4
4
|
Handlebars.registerHelper 'ProjectUrl', (project)->
|
5
|
-
"
|
5
|
+
"/#projects/#{project.id}"
|
6
6
|
|
7
7
|
Handlebars.registerHelper 'ProjectImg', (version)->
|
8
8
|
v = version ? version : "url"
|
@@ -6,6 +6,6 @@ class Pullentity.Collections.Projects extends Backbone.Collection
|
|
6
6
|
|
7
7
|
url : ()->
|
8
8
|
if @id
|
9
|
-
"#{Pullentity.Domain}.
|
9
|
+
"#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/projects/#{@id}"
|
10
10
|
else
|
11
|
-
"#{Pullentity.Domain}.
|
11
|
+
"#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/projects"
|
@@ -7,7 +7,7 @@ class Pullentity.Collections.Sections extends Backbone.Collection
|
|
7
7
|
|
8
8
|
url : ()->
|
9
9
|
if @id
|
10
|
-
"#{Pullentity.Domain}.
|
10
|
+
"#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/sections/#{@id}"
|
11
11
|
else
|
12
|
-
"#{Pullentity.Domain}.
|
12
|
+
"#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site/sections"
|
13
13
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Pullentity.Models.Site extends Backbone.Model
|
2
2
|
url : ()->
|
3
3
|
if @id
|
4
|
-
"#{Pullentity.Domain}.
|
4
|
+
"#{Pullentity.Domain}.#{Pullentity.host}/api/v1/site"
|
5
5
|
else
|
6
|
-
"#{Pullentity.Domain}.
|
6
|
+
"#{Pullentity.Domain}.#{Pullentity.host}/api/v1/sites"
|
7
7
|
|
@@ -23,6 +23,8 @@ class Pullentity.Views.Commons.Main extends Backbone.View
|
|
23
23
|
|
24
24
|
@render()
|
25
25
|
|
26
|
+
@setupLinks()
|
27
|
+
|
26
28
|
# quizas cargar router acá
|
27
29
|
|
28
30
|
setTitle: ()=>
|
@@ -45,7 +47,7 @@ class Pullentity.Views.Commons.Main extends Backbone.View
|
|
45
47
|
#console.log("get section #{id}")
|
46
48
|
@find_in_section(id)
|
47
49
|
|
48
|
-
Backbone.history.start(
|
50
|
+
Backbone.history.start(pushState: true)
|
49
51
|
|
50
52
|
render: ()=>
|
51
53
|
#console.info("should render layout")
|
@@ -128,4 +130,26 @@ class Pullentity.Views.Commons.Main extends Backbone.View
|
|
128
130
|
#console.error "error while creating Handlebars script out of template for [", $(@current_theme_obj), e
|
129
131
|
throw e
|
130
132
|
|
133
|
+
setupLinks: ()=>
|
134
|
+
# Globally capture clicks. If they are internal and not in the pass
|
135
|
+
# through list, route them through Backbone's navigate method.
|
136
|
+
$(document).on "click", "a[href^='/']", (event) =>
|
137
|
+
|
138
|
+
href = $(event.currentTarget).attr('href')
|
139
|
+
|
140
|
+
# chain 'or's for other black list routes
|
141
|
+
passThrough = href.indexOf('sign_out') >= 0
|
142
|
+
|
143
|
+
# Allow shift+click for new tabs, etc.
|
144
|
+
if !passThrough && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey
|
145
|
+
event.preventDefault()
|
146
|
+
|
147
|
+
# Remove leading slashes and hash bangs (backward compatablility)
|
148
|
+
url = href.replace(/^\//,'').replace('\#\/','')
|
149
|
+
|
150
|
+
# Instruct Backbone to trigger routing events
|
151
|
+
@app_router.navigate url, { trigger: true }
|
152
|
+
|
153
|
+
return false
|
154
|
+
|
131
155
|
layout = new Pullentity.Views.Commons.Main
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pullentity-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coffee-script
|
@@ -124,13 +124,13 @@ dependencies:
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 0.15.4
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
127
|
+
name: session
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: '3.1'
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,41 +138,41 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
141
|
+
version: '3.1'
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
|
-
name:
|
143
|
+
name: middleman
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
145
145
|
none: false
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - '='
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
149
|
+
version: 3.1.4
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
none: false
|
154
154
|
requirements:
|
155
|
-
- -
|
155
|
+
- - '='
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
157
|
+
version: 3.1.4
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
|
-
name: middleman
|
159
|
+
name: middleman-target
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
161
161
|
none: false
|
162
162
|
requirements:
|
163
|
-
- - '
|
163
|
+
- - ! '>='
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
165
|
+
version: '0'
|
166
166
|
type: :runtime
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
169
|
none: false
|
170
170
|
requirements:
|
171
|
-
- - '
|
171
|
+
- - ! '>='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: '0'
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
|
-
name:
|
175
|
+
name: faraday
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|
177
177
|
none: false
|
178
178
|
requirements:
|
@@ -188,7 +188,7 @@ dependencies:
|
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
|
-
name:
|
191
|
+
name: json
|
192
192
|
requirement: !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
@@ -204,7 +204,7 @@ dependencies:
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
- !ruby/object:Gem::Dependency
|
207
|
-
name:
|
207
|
+
name: rack-rewrite
|
208
208
|
requirement: !ruby/object:Gem::Requirement
|
209
209
|
none: false
|
210
210
|
requirements:
|
@@ -430,12 +430,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
430
430
|
- - ! '>='
|
431
431
|
- !ruby/object:Gem::Version
|
432
432
|
version: '0'
|
433
|
+
segments:
|
434
|
+
- 0
|
435
|
+
hash: 4005454624083693998
|
433
436
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
434
437
|
none: false
|
435
438
|
requirements:
|
436
439
|
- - ! '>='
|
437
440
|
- !ruby/object:Gem::Version
|
438
441
|
version: '0'
|
442
|
+
segments:
|
443
|
+
- 0
|
444
|
+
hash: 4005454624083693998
|
439
445
|
requirements: []
|
440
446
|
rubyforge_project:
|
441
447
|
rubygems_version: 1.8.25
|