fanforce-plugin-factory 2.0.0.rc15 → 2.0.0.rc16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/initiative-footer/_initiative-footer.coffee +2 -1
- data/lib/fanforce/plugin_factory/directive_views/campaign-footer.haml +1 -1
- data/lib/fanforce/plugin_factory/directive_views/initiative-footer.haml +1 -1
- data/lib/fanforce/plugin_factory/sinatra/_load.rb +5 -0
- data/lib/fanforce/plugin_factory/sinatra/helpers/ractive.rb +20 -6
- data/lib/fanforce/plugin_factory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21b09a1ea73d8048e81fad91617274128f0d5277
|
4
|
+
data.tar.gz: 3c3ba94227357137c371cef1c7059d15504d0a3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e2600ccfff01bb278a23f81b80e71ec9b49eaf282d242454e3f2375e53cd7efc85d59815f6c538aadc7714298e150ad2951ef77fedf16854c73dd56339a0d43
|
7
|
+
data.tar.gz: 130356789529c4b38cfbc10e2a02023156d4a11445ad4f703a7969f47bbe1315d5e408d9c944f597b5cd8a2ccef7bd4d5d83735b15f8c01f8efce1981a274567
|
@@ -5,11 +5,12 @@ App.directive('initiativeFooter', [() ->
|
|
5
5
|
initiative_name: '=initiativeName'
|
6
6
|
saveCallback: '=save'
|
7
7
|
prefix: '@'
|
8
|
+
button: '@?'
|
8
9
|
}
|
9
10
|
link: (($scope, $element, attrs) ->
|
10
11
|
|
11
12
|
$scope.save = (()->
|
12
|
-
$scope.saveCallback()
|
13
|
+
$scope.saveCallback($scope.initiative_name)
|
13
14
|
)
|
14
15
|
|
15
16
|
)
|
@@ -61,6 +61,11 @@ class Fanforce::Plugin::Sinatra < Sinatra::Base
|
|
61
61
|
haml :"#{factory_dir.relative_path_from(plugin_views_dir).to_s}/directive_views/#{page}"
|
62
62
|
end
|
63
63
|
|
64
|
+
def partial(path, options={})
|
65
|
+
options[:css_framework] = params[:css_framework] if params[:css_framework]
|
66
|
+
haml(path.to_sym, options)
|
67
|
+
end
|
68
|
+
|
64
69
|
def page(page, options={})
|
65
70
|
plugin_views_dir = Pathname.new(settings.views)
|
66
71
|
|
@@ -6,6 +6,13 @@ module Fanforce::Plugin::Sinatra::RactiveHelpers
|
|
6
6
|
context = create_context
|
7
7
|
|
8
8
|
html = context.capture_haml(&block)
|
9
|
+
html.gsub!(/([^\s])\s*\{\{\/if}}(\s*\{\{elseif)/, '\1\2') # if/elseif
|
10
|
+
html.gsub!(/([^\s])\s*\{\{\/if}}(\s*\{\{else)/, '\1\2') # if/else
|
11
|
+
html.gsub!(/([^\s])\s*\{\{\/elseif}}(\s*\{\{elseif)/, '\1\2') # elseif/elseif
|
12
|
+
html.gsub!(/([^\s])\s*\{\{\/elseif}}(\s*\{\{else)/, '\1\2') # elseif/else
|
13
|
+
html.gsub!(/{\{\/elseif}}/, '{{/if}}') # /elseif -> /if
|
14
|
+
html.gsub!(/{\{\/else}}/, '{{/if}}') # /else -> /if
|
15
|
+
|
9
16
|
return html if format == :html
|
10
17
|
|
11
18
|
single_line_html = html.split(/\r?\n/).inject('') {|sl, l| sl += l.strip + ' ' }
|
@@ -13,25 +20,32 @@ module Fanforce::Plugin::Sinatra::RactiveHelpers
|
|
13
20
|
matches.inject({}) {|t,m| t[m[0]] = m[1]; t }.to_json
|
14
21
|
end
|
15
22
|
|
16
|
-
def RACTIVE(helper, &block)
|
23
|
+
def RACTIVE(command, helper, &block)
|
17
24
|
begin require 'haml' rescue LoadError raise 'You must have the haml gem installed to use Fanforce.compile_jquery_templates.' end
|
18
25
|
raise ArgumentError, 'Missing block' unless block_given?
|
19
26
|
|
27
|
+
opener = "#{command}"
|
28
|
+
opener += " #{helper}" if helper
|
29
|
+
closer = command.gsub('#','')
|
30
|
+
|
20
31
|
context = create_context
|
21
|
-
|
22
|
-
"{{#{helper}}}\n" + context.capture_haml(&block) + "{{/#{helper.gsub(/(#|\^)/,'')}}}"
|
32
|
+
"{{#{opener}}}\n" + context.capture_haml(&block).to_s.split("\n").inject('') {|html, l| html += " #{l}\n"} + "{{/#{closer}}}"
|
23
33
|
end
|
24
34
|
|
25
35
|
def IF(helper, &block)
|
26
|
-
RACTIVE(helper, &block)
|
36
|
+
RACTIVE('#if', helper, &block)
|
27
37
|
end
|
28
38
|
|
29
39
|
def ELSE_IF(helper, &block)
|
30
|
-
RACTIVE(helper, &block)
|
40
|
+
RACTIVE('elseif', helper, &block)
|
41
|
+
end
|
42
|
+
|
43
|
+
def ELSE(&block)
|
44
|
+
RACTIVE('else', nil, &block)
|
31
45
|
end
|
32
46
|
|
33
47
|
def FOREACH(helper, &block)
|
34
|
-
RACTIVE(helper, &block)
|
48
|
+
RACTIVE("##{helper}", nil, &block)
|
35
49
|
end
|
36
50
|
|
37
51
|
def create_context
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanforce-plugin-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|