pullentity-client 0.0.7 → 0.0.8
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 +8 -8
- data/README.md +5 -1
- data/lib/pullentity-client/builder/middleman.rb +1 -1
- data/lib/pullentity-client/generate/auth.rb +32 -0
- data/lib/pullentity-client/helpers.rb +27 -121
- data/lib/pullentity-client/templates/app/views/shared/head.haml +2 -1
- data/lib/pullentity-client/templates/app/views/shared/js.haml +1 -1
- data/lib/pullentity-client/templates/defaults/config.erb +9 -0
- data/lib/pullentity-client/templates/defaults/test-data.js.erb +5 -4
- data/lib/pullentity-client/version.rb +1 -1
- data/pullentity-client.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTZlZjFlMWFiMzUxM2VkYjVkNWU3MmZiNGJmMDk3NmRjNDVmNjM0ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmVhN2NjYzBlZDRjZDU4OGE5MDFmY2E2OGQwMTI0NzZlZTJjMDg0Yg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDVhMWY2OTBmMWY5OTJjNDhmZmFhMjZjYjJkY2E1MzM5NjgyOGI1MGQ5YTQ4
|
10
|
+
MzYzNDMzN2FmZjI1ZmI0YTQ2NzNkNmZjMWVkYWM4MTA1ODIzMTg0ZmMyMWVh
|
11
|
+
NDA4NzFhMWY5M2JjODMxOGNjNjgxZDQzNTkzYjEyNTNiOGU5YzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWE5ZGEyMjM2MGFkMmRlNWNkZmY2MzE1ZDRhMWE2N2EwZjBhNzc3MDJjYWQx
|
14
|
+
NzFiOGRjN2NlMjA5YzUxN2YyYjA0YTJlOWMxNWM1MzQ5MGY4MzVkMDU1NDQ5
|
15
|
+
ODUwYTM4ZTYxOGI4NmI4YzQxYWIzOGMyMWIyNzc4ODM1MDhiMGM=
|
data/README.md
CHANGED
@@ -28,10 +28,14 @@ Run project
|
|
28
28
|
|
29
29
|
pullentity s # or pullentity server
|
30
30
|
|
31
|
-
since
|
31
|
+
since it's a middleman app you can
|
32
32
|
|
33
33
|
middleman s or middleman server
|
34
34
|
|
35
|
+
Setup (login, site selection & import data)
|
36
|
+
|
37
|
+
pullentity setup
|
38
|
+
|
35
39
|
Setup your credentials
|
36
40
|
|
37
41
|
pullentity login your@email.com
|
@@ -94,8 +94,40 @@ module Pullentity
|
|
94
94
|
response = conn.put("/api/v1/import_theme?auth_token=#{@token}&subdomain=#{@site}&theme_name=#{@theme_name}", payload )
|
95
95
|
@json_body = JSON.parse(response.body)
|
96
96
|
say "#{@json_body[:status]} #{@json_body[:message]}", :green
|
97
|
+
asw = ask "upload assets too ?", :yellow
|
98
|
+
if asw == "yes"
|
99
|
+
upload_assets()
|
100
|
+
else
|
101
|
+
say "skipping assets upload", :green
|
102
|
+
end
|
97
103
|
end
|
98
104
|
|
105
|
+
def upload_assets()
|
106
|
+
conn = Faraday.new(:url => domain) do |f|
|
107
|
+
f.request :multipart
|
108
|
+
f.request :url_encoded # form-encode POST params
|
109
|
+
#f.response :logger # log requests to STDOUT
|
110
|
+
f.adapter Faraday.default_adapter # make requests with Net::HTTP
|
111
|
+
end
|
112
|
+
|
113
|
+
say "upload application.js...", :green
|
114
|
+
payload = { :file => Faraday::UploadIO.new("#{location}/build/assets/javascripts/application.js", 'text/json') }
|
115
|
+
response = conn.put("/api/v1/upload_assets?auth_token=#{@token}&subdomain=#{@site}&theme_name=#{@theme_name}", payload )
|
116
|
+
|
117
|
+
say JSON.parse(response.body)
|
118
|
+
|
119
|
+
say "upload application.css...", :green
|
120
|
+
payload = { :file => Faraday::UploadIO.new("#{location}/build/assets/stylesheets/application.css", 'text/json') }
|
121
|
+
response = conn.put("/api/v1/upload_assets?auth_token=#{@token}&subdomain=#{@site}&theme_name=#{@theme_name}", payload )
|
122
|
+
|
123
|
+
say JSON.parse(response.body)
|
124
|
+
end
|
125
|
+
|
126
|
+
def images
|
127
|
+
Dir.glob("#{location}/build/assets/images/**/*")
|
128
|
+
end
|
129
|
+
|
130
|
+
|
99
131
|
def get_site_activated_theme_data
|
100
132
|
check_for_yaml
|
101
133
|
site_api_call("/api/v1/sites/#{@site}.json")
|
@@ -1,146 +1,52 @@
|
|
1
1
|
require "middleman"
|
2
|
+
require 'middleman-target'
|
2
3
|
|
3
4
|
module Pullentity::Client::Helpers
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
content_tag :footer , opts do
|
10
|
-
capture(&block)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def article(opts={}, &block)
|
15
|
-
content_tag :article , opts do
|
16
|
-
capture(&block)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def section(opts={}, &block)
|
21
|
-
content_tag :section , opts do
|
22
|
-
capture(&block)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def header(opts={}, &block)
|
27
|
-
content_tag :header , opts do
|
28
|
-
capture(&block)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def hgroup(opts={}, &block)
|
33
|
-
if block_given?
|
34
|
-
content_tag :hgroup, options do
|
35
|
-
capture(&block)
|
36
|
-
end
|
37
|
-
else
|
38
|
-
content_tag :hgroup do
|
39
|
-
content_tag( :h1 , opts[:title]).concat(
|
40
|
-
content_tag( :h2 , opts[:subtitle])
|
41
|
-
)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def list_view(opts={}, &block)
|
47
|
-
options = {:class=>opts[:class]}.merge({"data-type" => "listview"})
|
48
|
-
content_tag :ul, options do
|
49
|
-
capture(&block)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def list_item(opts={}, &block)
|
54
|
-
options = {:class=>opts[:class]}
|
55
|
-
options = options.merge({ :class=> "#{options[:class]} list-divider"}) if opts[:divider] == true
|
56
|
-
arrow = content_tag :div , :class=>"aside" do
|
57
|
-
content_tag( :i, "",{:class=>"icon-chevron-#{opts[:arrow]}"})
|
58
|
-
end if opts[:arrow].present?
|
59
|
-
|
60
|
-
if block_given?
|
61
|
-
content_tag :li, options do
|
62
|
-
capture(&block) << (arrow || "")
|
63
|
-
end
|
6
|
+
def javascript_include_tag(file)
|
7
|
+
if target?(:pullentity)
|
8
|
+
path = "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}"
|
9
|
+
"<script src='#{path}.js' type='text/javascript'></script>"
|
64
10
|
else
|
65
|
-
|
66
|
-
content_tag :h1 do
|
67
|
-
opts[:content]
|
68
|
-
end
|
69
|
-
end
|
11
|
+
super
|
70
12
|
end
|
71
13
|
end
|
72
14
|
|
73
|
-
def
|
74
|
-
if
|
75
|
-
|
76
|
-
|
77
|
-
end
|
15
|
+
def stylesheet_link_tag(file)
|
16
|
+
if target?(:pullentity)
|
17
|
+
path = "/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}"
|
18
|
+
"<link href='#{path}.css' media='screen' rel='stylesheet' type='text/css' />"
|
78
19
|
else
|
79
|
-
|
20
|
+
super
|
80
21
|
end
|
81
22
|
end
|
82
23
|
|
83
|
-
def
|
84
|
-
|
85
|
-
|
86
|
-
capture(&block)
|
87
|
-
end
|
88
|
-
else
|
24
|
+
def test_data_include_tag
|
25
|
+
unless target?(:pullentity)
|
26
|
+
javascript_include_tag "test-data"
|
89
27
|
end
|
28
|
+
end
|
29
|
+
def site_name
|
30
|
+
hsh = YAML.load_file(location + "pullentity.yml")
|
31
|
+
hsh["site"]
|
90
32
|
end
|
91
33
|
|
92
|
-
def
|
93
|
-
|
94
|
-
|
34
|
+
def theme_name
|
35
|
+
hsh = YAML.load_file(location + "pullentity.yml")
|
36
|
+
hsh["theme_name"]
|
95
37
|
end
|
96
38
|
|
97
|
-
def
|
98
|
-
|
99
|
-
if opts[:control]
|
100
|
-
auto = opts[:auto] ? "autoWidth" : ""
|
101
|
-
nav(opts.reject!{ |k| k == :control || k == :auto }) do
|
102
|
-
content_tag(:div, :class=>"control-group #{auto}") do
|
103
|
-
capture(&block)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
else
|
107
|
-
nav(opts, &block)
|
108
|
-
end
|
39
|
+
def location
|
40
|
+
@location ||= Pathname.new(Dir.pwd)
|
109
41
|
end
|
110
42
|
|
111
|
-
def
|
112
|
-
if
|
113
|
-
|
114
|
-
content_tag( :i, "",{:class=>"icon-#{type}"})
|
43
|
+
def asset_pathxxxx(file)
|
44
|
+
if target?(:pullentity)
|
45
|
+
'yea'
|
115
46
|
else
|
116
|
-
|
117
|
-
name <<
|
118
|
-
content_tag( :i, "",{:class=>"icon-#{type}"})
|
47
|
+
super
|
119
48
|
end
|
120
49
|
end
|
121
50
|
|
122
|
-
def dialog(opts, &block)
|
123
|
-
options = {:role => "dialog", :data=>{:type=>opts[:type] || "modal", :transition=>opts[:transition] || "slideup"}}
|
124
|
-
opts = opts.merge(options)
|
125
|
-
if block_given?
|
126
|
-
content_tag(:div, opts) do
|
127
|
-
capture(&block)
|
128
|
-
end
|
129
|
-
else
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
def render_tabbar(tabbar)
|
134
|
-
partial("views/tabbars/#{tabbar}")
|
135
|
-
end
|
136
|
-
|
137
|
-
def render_dialog(dialog)
|
138
|
-
partial("views/dialogs/#{dialog}")
|
139
|
-
end
|
140
|
-
|
141
|
-
def render_toolbar(tabbar)
|
142
|
-
partial("views/toolbars/#{tabbar}")
|
143
|
-
end
|
144
|
-
|
145
51
|
|
146
52
|
end
|
@@ -12,8 +12,9 @@
|
|
12
12
|
%script{:src => "https://raw.github.com/brandonaaron/livequery/master/jquery.livequery.js"}
|
13
13
|
|
14
14
|
= javascript_include_tag "application"
|
15
|
+
= stylesheet_link_tag "application"
|
15
16
|
|
16
|
-
=
|
17
|
+
= test_data_include_tag
|
17
18
|
|
18
19
|
= yield_content(:application_js)
|
19
20
|
|
@@ -81,9 +81,9 @@ $(document).ready ->
|
|
81
81
|
else
|
82
82
|
console.warn("not matching url")
|
83
83
|
|
84
|
-
window.render_theme = (theme_html)->
|
84
|
+
window.render_theme = (theme_html, data_hsh = window.data)->
|
85
85
|
if theme_html?
|
86
|
-
view = Mustache.to_html(theme_html,
|
86
|
+
view = Mustache.to_html(theme_html, data_hsh)
|
87
87
|
$("#content").html view
|
88
88
|
else
|
89
89
|
html = "<div style='margin:20px'><h1>Theme \"#{window.data.project.theme_template.name}\" not found!<h1>"
|
@@ -115,7 +115,7 @@ $(document).ready ->
|
|
115
115
|
$.each collection, (key, val) ->
|
116
116
|
window.data["photos"].push
|
117
117
|
img_medium: remote_path( val.image.image.medium.url)
|
118
|
-
img_large: remote_path(val.image.image.
|
118
|
+
img_large: remote_path(val.image.image.xlarge.url)
|
119
119
|
img_thumb: remote_path(val.image.image.thumb.url)
|
120
120
|
title: val.title
|
121
121
|
caption: val.caption
|
@@ -137,7 +137,7 @@ $(document).ready ->
|
|
137
137
|
else
|
138
138
|
#console.log "should be list!!"
|
139
139
|
data_projects = data_projects_for_list()
|
140
|
-
render_theme($(window.list_theme).html())
|
140
|
+
render_theme($(window.list_theme).html(), data_projects)
|
141
141
|
|
142
142
|
false
|
143
143
|
|
@@ -157,6 +157,7 @@ $(document).ready ->
|
|
157
157
|
a = _.filter(window.data["projects"], (num) ->
|
158
158
|
true if num.section.public_url is section.public_url
|
159
159
|
)
|
160
|
+
|
160
161
|
project_collection = _.map a, (p)->
|
161
162
|
p["project_photo"] = remote_path(p.photos[0].image.image.medium.url) unless p.photos.length == 0
|
162
163
|
p
|
data/pullentity-client.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_runtime_dependency(%q<compass>, ["~> 0.12.2"])
|
30
30
|
gem.add_runtime_dependency(%q<session>, ["~> 3.1"])
|
31
31
|
gem.add_runtime_dependency(%q<middleman>, ["3.0.12"])
|
32
|
+
gem.add_runtime_dependency("middleman-target")
|
32
33
|
gem.add_runtime_dependency(%q<faraday>)
|
33
34
|
gem.add_runtime_dependency("json")
|
34
35
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pullentity-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miguel michelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-script
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 3.0.12
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: middleman-target
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: faraday
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|