pullentity-client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.DS_Store +0 -0
- data/.gitignore +47 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/pullentity +5 -0
- data/lib/.DS_Store +0 -0
- data/lib/pullentity-client/.DS_Store +0 -0
- data/lib/pullentity-client/builder/middleman.rb +14 -0
- data/lib/pullentity-client/cli.rb +85 -0
- data/lib/pullentity-client/generate/auth.rb +173 -0
- data/lib/pullentity-client/generate/exporter.rb +107 -0
- data/lib/pullentity-client/generate/project.rb +99 -0
- data/lib/pullentity-client/generate/view.rb +47 -0
- data/lib/pullentity-client/helpers.rb +146 -0
- data/lib/pullentity-client/logger.rb +14 -0
- data/lib/pullentity-client/templates/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/assets/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.svg +255 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/pullentity-client/templates/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/lib/pullentity-client/templates/app/assets/images/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/assets/images/favicon.ico +0 -0
- data/lib/pullentity-client/templates/app/assets/javascripts/application.js.erb +4 -0
- data/lib/pullentity-client/templates/app/assets/javascripts/mustache.js +535 -0
- data/lib/pullentity-client/templates/app/assets/stylesheets/application.css.scss +1 -0
- data/lib/pullentity-client/templates/app/assets/stylesheets/customtheme.css.scss +1 -0
- data/lib/pullentity-client/templates/app/index.html.haml +15 -0
- data/lib/pullentity-client/templates/app/views/.DS_Store +0 -0
- data/lib/pullentity-client/templates/app/views/list.haml +11 -0
- data/lib/pullentity-client/templates/app/views/shared/body.haml +26 -0
- data/lib/pullentity-client/templates/app/views/shared/css.haml +48 -0
- data/lib/pullentity-client/templates/app/views/shared/head.haml +19 -0
- data/lib/pullentity-client/templates/app/views/shared/js.haml +43 -0
- data/lib/pullentity-client/templates/app/views/themes/home.haml +21 -0
- data/lib/pullentity-client/templates/app/views/themes/theme1.haml +21 -0
- data/lib/pullentity-client/templates/defaults/Gemfile.erb +8 -0
- data/lib/pullentity-client/templates/defaults/LICENSE.erb +1 -0
- data/lib/pullentity-client/templates/defaults/Readme.mkd.erb +1 -0
- data/lib/pullentity-client/templates/defaults/build.yml.erb +2 -0
- data/lib/pullentity-client/templates/defaults/config.erb +23 -0
- data/lib/pullentity-client/templates/defaults/gitignore.erb +2 -0
- data/lib/pullentity-client/templates/defaults/layout.haml.erb +13 -0
- data/lib/pullentity-client/templates/defaults/pullentity.yml.erb +5 -0
- data/lib/pullentity-client/templates/defaults/test-data.js.erb +87 -0
- data/lib/pullentity-client/templates/rakefile +0 -0
- data/lib/pullentity-client/templates/specs/app_spec.coffee.erb +3 -0
- data/lib/pullentity-client/utils.rb +81 -0
- data/lib/pullentity-client/version.rb +5 -0
- data/lib/pullentity-client.rb +39 -0
- data/pullentity-client.gemspec +39 -0
- data/spec/cli/command_spec.rb +90 -0
- data/spec/pullentity-client/builder/middleman_spec.rb +22 -0
- data/spec/pullentity-client/generate/exporter_spec.rb +53 -0
- data/spec/pullentity-client/generate/project_spec.rb +90 -0
- data/spec/pullentity-client/logger_spec.rb +25 -0
- data/spec/pullentity-client/utils_spec.rb +94 -0
- data/spec/spec_helper.rb +42 -0
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +255 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/images/.DS_Store +0 -0
- data/vendor/assets/images/pullentity/.DS_Store +0 -0
- data/vendor/assets/javascripts/pullentity/.DS_Store +0 -0
- data/vendor/assets/javascripts/pullentity.js +0 -0
- data/vendor/assets/stylesheets/.DS_Store +0 -0
- data/vendor/assets/stylesheets/pullentity/themes/default.css.scss +0 -0
- data/vendor/assets/stylesheets/pullentity.css.scss +1 -0
- metadata +335 -0
@@ -0,0 +1,146 @@
|
|
1
|
+
require "middleman"
|
2
|
+
|
3
|
+
module Pullentity::Client::Helpers
|
4
|
+
|
5
|
+
#TODO separate elements in specific classes:
|
6
|
+
# views, asides, articles, header, tabbar, toolbar etc...
|
7
|
+
|
8
|
+
def footer(opts={}, &block)
|
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
|
64
|
+
else
|
65
|
+
content_tag :li, options do
|
66
|
+
content_tag :h1 do
|
67
|
+
opts[:content]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def divider(opts={}, &block)
|
74
|
+
if block_given?
|
75
|
+
list_item({:divider=>true}.merge(opts)) do
|
76
|
+
capture(&block)
|
77
|
+
end
|
78
|
+
else
|
79
|
+
list_item({:divider=>true}.merge(opts))
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def nav(opts={}, &block)
|
84
|
+
if block_given?
|
85
|
+
content_tag(:nav, opts) do
|
86
|
+
capture(&block)
|
87
|
+
end
|
88
|
+
else
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def tabbar(opts={}, &block)
|
93
|
+
opts = opts.merge({"data-type" => "tabbar"})
|
94
|
+
nav(opts, &block)
|
95
|
+
end
|
96
|
+
|
97
|
+
def toolbar(opts={}, &block)
|
98
|
+
opts = opts.merge({"data-type" => "toolbar"})
|
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
|
109
|
+
end
|
110
|
+
|
111
|
+
def icon(type, opts={}, &block)
|
112
|
+
if block_given?
|
113
|
+
capture(&block) <<
|
114
|
+
content_tag( :i, "",{:class=>"icon-#{type}"})
|
115
|
+
else
|
116
|
+
name = opts[:text].present? ? content_tag( :span, opts[:text]) : ""
|
117
|
+
name <<
|
118
|
+
content_tag( :i, "",{:class=>"icon-#{type}"})
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
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
|
+
|
146
|
+
end
|
Binary file
|
Binary file
|
Binary file
|