fanforce-app-factory 2.0.0.rc2 → 2.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37a435bd68e878c20b03d9732e7dec3c3fb1b2e4
4
- data.tar.gz: 316ecc9519abcf404302dec20048212a9bd611e5
3
+ metadata.gz: 9431c182b75b2b4653a85bd0c8e7359bbd607458
4
+ data.tar.gz: ca5ba701910a7a319fff8f899009e27709bf37ab
5
5
  SHA512:
6
- metadata.gz: 18a594cc7c197808b9c0e34ffedb242e57d18cf456d03c825885bd6ac25c9b0d4e71da58a8f40c6b4f9312d20cd3a8967602c143170edcf6b027c0c8e2fba605
7
- data.tar.gz: 901754e108e86dc527733cdfb4b754b887a25d4160e94b99fce0124d644e50884f8ee44b889be5ccf861cedd221ac4132119fa05fe42945cc6712756551b6786
6
+ metadata.gz: d764c6b657376eb5556b92941053855f26e5d0405ecda426fca06869b8b6cca582d7cc33e83ba80ae799979aba6731c76601da9e0d6832eb645c57cbe2eee212
7
+ data.tar.gz: 28b95d97db2f491bc300d08591e03d32762123ff3bdd51b4bf988526d25118e5dc978a2987566b65fe83f1c93c2cfdfdd9d72f4d90d6abd952c1daa93b6af857
@@ -0,0 +1,31 @@
1
+ class Fanforce::App::Sinatra
2
+
3
+ get '/internals/config.json' do
4
+ file = File.open("#{Fanforce::App.root_dir}/config.json")
5
+ config = MultiJson.load(file.read, symbolize_keys: true)
6
+ config[:iron_workers] ||= []
7
+
8
+ config[:iron_workers].each do |iron_worker|
9
+ iron_worker[:token] = ENV['IRON_TOKEN']
10
+ iron_worker[:project_id] = ENV['IRON_PROJECT_ID']
11
+ end
12
+
13
+ config.to_json
14
+ end
15
+
16
+ post '/internals/config.json' do
17
+ filename = "#{Fanforce::App.root_dir}/config.json"
18
+ file = File.open(filename)
19
+ old_config = MultiJson.load(file.read, symbolize_keys: true)
20
+ new_config = MultiJson.load(params[:config], symbolize_keys: true)
21
+ raise 'IUIDs do not match' if old_config[:_iuid] and old_config[:_iuid] != new_config[:_iuid]
22
+
23
+ File.open(filename, 'w') {|f| f.write(JSON.pretty_generate(Hash[new_config.sort])) }
24
+ json status: 'finished'
25
+ end
26
+
27
+ get '/app_factory/directives/:filename' do
28
+ factory_directive(params[:filename])
29
+ end
30
+
31
+ end
@@ -1,6 +1,6 @@
1
1
  App.directive('initiativeFooter', [() ->
2
2
  restrict: 'E',
3
- templateUrl: '/directives/initiative-footer'
3
+ templateUrl: '/app_factory/directives/initiative-footer'
4
4
  scope: {
5
5
  initiative_name: '=initiativeName'
6
6
  saveCallback: '=save'
@@ -0,0 +1 @@
1
+ @import 'scafolding_assets/css/engagement';
@@ -22,8 +22,8 @@ class Fanforce::App::CoreConfig
22
22
  @factory_dir || (raise 'factory_dir is missing')
23
23
  end
24
24
 
25
- def show_error_details=(bool)
26
- @show_error_details = [true,1,'1'].include?(bool)
25
+ def show_error_details=(opt)
26
+ @show_error_details = ['1','text'].include?(opt.to_s) ? opt.to_s : false
27
27
  end
28
28
 
29
29
  def redis_url
@@ -69,7 +69,7 @@ class Fanforce::App::CoreConfig
69
69
  require "#{@factory_dir}/sinatra/helper_routes/com_js_widget"
70
70
 
71
71
  Dir["#{@root_dir}/initializers/*.rb"].each {|f| require f } if File.directory?("#{@root_dir}/initializers")
72
- require "#{@factory_dir}/sinatra/Routes"
72
+ require "#{@factory_dir}/Routes"
73
73
  require "#{@root_dir}/Routes"
74
74
  end
75
75
 
@@ -0,0 +1,8 @@
1
+ .footer
2
+ %label Save initiative as...
3
+ .input-wrapper(onclick='$(this).find("input").focus()')
4
+ .prefix {{prefix}}
5
+ %input.form-control.input-sm(type='text' ng-disabled='is_disabled' ng-model='initiative_name')
6
+ %button.btn.btn-sm.btn-primary(ng-click='save()' ng-disabled='is_disabled')
7
+ %i.icon-plus.icon-white
8
+ Create
@@ -57,7 +57,7 @@ class App::Sinatra
57
57
  ######################################################################################################################
58
58
  # ENGAGE
59
59
 
60
- #static '/:organization_slug/:com_behavior_shortid/:initiative_id', :engage do route_engage_page_ui end
60
+ #static '/:organization_slug/:com_behavior_shortid/:initiative_id', :engagement do route_engagement_page_ui end
61
61
 
62
62
  ######################################################################################################################
63
63
 
@@ -5,8 +5,8 @@
5
5
  %title Fanforce
6
6
  %meta{'http-equiv'=>'Content-Type', content:'text/html; charset=iso-8859-1'}/
7
7
  %meta{'http-equiv'=>'Content-Language', content: 'en-us'}/
8
- = stylesheet '/engage.css'
9
- %body.layout-engage
8
+ = stylesheet '/engagement.css'
9
+ %body.layout-engagement
10
10
  .lyt-root
11
11
  .lyt-header
12
12
  #hello
@@ -0,0 +1,66 @@
1
+ @import 'compass/css3';
2
+ @import "compass/layout/sticky-footer";
3
+ @import 'compass/utilities';
4
+
5
+ //////////////////////////////////////////////////////////////////////////////////////////////////
6
+
7
+ @import 'app_factory/common';
8
+
9
+ //////////////////////////////////////////////////////////////////////////////////////////////////
10
+
11
+ h1, .h1 { font-size: 30px; font-weight:bold; margin:10px 0; line-height:1em; }
12
+ h2, .h2 { font-size: 20px; font-weight:bold; margin:8px 0; line-height:1em; }
13
+ h3, .h3 { font-size: 17px; font-weight:bold; margin:6px 0; line-height:1em; }
14
+ h4, .h4 { font-size: 14px; font-weight:bold; margin:4px 0; line-height:1em; }
15
+ h5, .h5 { font-size: 13px; font-weight: bold; margin:2px 0; line-height:1em; }
16
+ h6, .h6 { font-size: 12px; font-weight: bold; margin:2px 0; line-height:1em; }
17
+ h7, .h7 { font-size: 11px; font-weight: bold; margin:2px 0; line-height:1em; }
18
+
19
+ p, .p { line-height:1.5em; margin-bottom:10px; }
20
+ a { text-decoration:none; color:#1861a8;
21
+ &:hover { text-decoration:underline; }
22
+ }
23
+ strong, .strong { font-weight:bold; }
24
+ emphasis, .emphasis { font-style:italic; }
25
+
26
+ ul { list-style-type: square; list-style-position:outside; padding:0; margin-left:0; line-height:1.5em;
27
+ li { margin-top:5px; margin-left:1em; }
28
+ }
29
+
30
+ ol { list-style-type:decimal; list-style-position:outside; padding:0; margin-left:0; line-height:1.5em;
31
+ li { margin-top:5px; margin-left:1.5em; }
32
+ }
33
+
34
+ pre { font-family:"Courier New", Courier, monospace, sans-serif; color: #555; line-height: 1.6em; }
35
+
36
+ .hide { display:none !important; }
37
+
38
+ //////////////////////////////////////////////////////////////////////////////////////////////////
39
+ // FRAMEWORK: MODULE ACTIVATION
40
+ //////////////////////////////////////////////////////////////////////////////////////////////////
41
+ html { height:100%; }
42
+ body { height: 100%; background-color:#292a2e; @include ff-gradient(#26262a,#2b2d31); text-align:center; margin:0; font-family:'Helvetica', Arial, sans-serif; font-size:12px; line-height:1.5em;
43
+ @include sticky-footer(40px, ".lyt-root", ".lyt-root-footer", ".lyt-footer");
44
+
45
+ .lyt-root { @include ff-gradient(#26262a,#2b2d31); }
46
+ .lyt-header { min-height:80px;
47
+ .hello { background: #2d2d31; height:40px; line-height: 44px; text-align: right; border-bottom:1px solid #000000; @include box-shadow(#343438 0 1px 0);
48
+ .hello-wrapper { max-width: 960px; margin:0 auto; }
49
+ .greeting { color: #858789; font-style: italic; padding-right:10px; font-weight: 100; }
50
+ a { font-weight: bold; color: #aeb2b4; }
51
+ }
52
+ .logo { border-bottom:1px solid #000000; @include box-shadow(#343438 0 1px 0); background-position: center center; background-repeat:no-repeat;
53
+ img { margin-top:18px; }
54
+ }
55
+ }
56
+ .lyt-footer { color:#565d65; font-size:10px; line-height:40px; border-top:1px solid #343438; @include box-shadow(#000000 0 -1px 0);
57
+ a { color:#565d65;
58
+ &:hover { color:#747d88; }
59
+ }
60
+ }
61
+
62
+ // layout-specific components
63
+ .ff-widget { display:inline-block; @include box-shadow(#000000 2px 2px 2px); border:10px solid #ffffff; @include border-radius(3px); margin:50px 0 50px; color: #444444;
64
+ .loading { line-height: 100px; }
65
+ }
66
+ }
@@ -43,6 +43,10 @@ class Fanforce::App::Sinatra < Sinatra::Base
43
43
  end
44
44
  end
45
45
 
46
+ def self.create_basic_routes_from_views
47
+ create_basic_routes_from(:views)
48
+ end
49
+
46
50
  def self.create_basic_route(path)
47
51
  get "/#{path}" do page(path) end
48
52
  end
@@ -52,6 +56,12 @@ class Fanforce::App::Sinatra < Sinatra::Base
52
56
  get(url, &block)
53
57
  end
54
58
 
59
+ def factory_directive(page)
60
+ factory_dir = Pathname.new(Fanforce::App.config.factory_dir)
61
+ app_views_dir = Pathname.new(settings.views)
62
+ haml :"#{factory_dir.relative_path_from(app_views_dir).to_s}/directive_views/#{page}"
63
+ end
64
+
55
65
  def page(page, options={})
56
66
  app_views_dir = Pathname.new(settings.views)
57
67
  page = :"#{options[:com_dir]}/#{page}" if File.exists?("#{app_views_dir}/#{options[:com_dir]}/#{page}.haml")
@@ -12,14 +12,15 @@ class Fanforce::App::Sinatra
12
12
  end
13
13
  message = errors[0][:message]
14
14
 
15
+ show_error_details = params[:show_error_details] || Fanforce::App.config.show_error_details
15
16
  admin_details = fetch_admin_details(e, errors)
16
17
  Bugsnag.notify(e, admin_details.merge(app_id: Fanforce::App.app_id)) if Fanforce::App.is_bugsnag_enabled?
17
18
 
18
19
  body = {errors: message}
19
- body.merge!(admin_details.merge(backtrace: e.backtrace)).delete(:public_response) if params[:show_error_details] or Fanforce::App.config.show_error_details
20
+ body.merge!(admin_details.merge(backtrace: e.backtrace)).delete(:public_response) if show_error_details
20
21
 
21
22
  status(e.respond_to?(:code ) ? e.code : 500)
22
- if params[:show_error_details]=='text'
23
+ if show_error_details == 'text'
23
24
  response.headers['Content-Type'] = 'text/plain'
24
25
  format_as_text(body)
25
26
  else
@@ -29,7 +30,7 @@ class Fanforce::App::Sinatra
29
30
 
30
31
  def format_as_text(body)
31
32
  text = "--------------------------------------------------------------------------------------------------------\n"
32
- text += "ERROR: #{body[:errors]}\n"
33
+ text += "ERROR: #{body[:raw_message]}\n"
33
34
  text += "CLASS: #{body[:error_class]}\n" if body[:error_class]
34
35
  text += "\nCURL COMMAND: #{body[:curl_command]}\n" if body[:curl_command]
35
36
  text += "\nBACKTRACE:\n#{body[:backtrace].join("\n")}\n" if body[:backtrace]
@@ -8,8 +8,8 @@ class Fanforce::App::Sinatra
8
8
  page :edit_initiative, :layout => :standard, com_dir: params[:com_behavior_shortid]
9
9
  end
10
10
 
11
- def route_engage_page_ui
12
- page :engage, :layout => :standard, com_dir: params[:com_behavior_shortid]
11
+ def route_engagement_page_ui
12
+ page :engagement, :layout => :engagement, com_dir: params[:com_behavior_shortid]
13
13
  end
14
14
 
15
15
  def route_archive_initiative_callback
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class AppFactory
3
- VERSION = '2.0.0.rc2'
3
+ VERSION = '2.0.0.rc4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-app-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc2
4
+ version: 2.0.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark
@@ -308,6 +308,7 @@ files:
308
308
  - fanforce-app-factory.gemspec
309
309
  - lib/fanforce/app_factory.rb
310
310
  - lib/fanforce/app_factory/Rakefile
311
+ - lib/fanforce/app_factory/Routes.rb
311
312
  - lib/fanforce/app_factory/app.rb
312
313
  - lib/fanforce/app_factory/asset_framework/app_factory/_bootstrap.scss
313
314
  - lib/fanforce/app_factory/asset_framework/app_factory/_common.scss
@@ -359,6 +360,7 @@ files:
359
360
  - lib/fanforce/app_factory/asset_framework/app_factory/lib/ng-visible.js
360
361
  - lib/fanforce/app_factory/asset_framework/app_factory/lib/url.coffee
361
362
  - lib/fanforce/app_factory/asset_framework/app_factory/lib/utils.coffee
363
+ - lib/fanforce/app_factory/asset_framework/app_factory/scafolding/_engagement.scss
362
364
  - lib/fanforce/app_factory/asset_framework/app_factory/scafolding/_promotional.scss
363
365
  - lib/fanforce/app_factory/asset_framework/app_factory/scafolding/_standard.scss
364
366
  - lib/fanforce/app_factory/asset_framework/app_factory/scafolding/promotional.coffee
@@ -370,10 +372,12 @@ files:
370
372
  - lib/fanforce/app_factory/cli/_cleanorgs.rb
371
373
  - lib/fanforce/app_factory/controllers/base_controller.rb
372
374
  - lib/fanforce/app_factory/core_config.rb
375
+ - lib/fanforce/app_factory/directive_views/initiative-footer.haml
373
376
  - lib/fanforce/app_factory/scafolding/Routes.rb
374
- - lib/fanforce/app_factory/scafolding/layouts/engage.haml
377
+ - lib/fanforce/app_factory/scafolding/layouts/engagement.haml
375
378
  - lib/fanforce/app_factory/scafolding/public/favicon.ico
376
379
  - lib/fanforce/app_factory/scafolding/public/robots.txt
380
+ - lib/fanforce/app_factory/scafolding/scafolding_assets/css/engagement.scss
377
381
  - lib/fanforce/app_factory/scafolding/scafolding_assets/css/promotional.scss
378
382
  - lib/fanforce/app_factory/scafolding/scafolding_assets/css/standard.scss
379
383
  - lib/fanforce/app_factory/scafolding/scafolding_assets/img/icon-16.png
@@ -396,7 +400,6 @@ files:
396
400
  - lib/fanforce/app_factory/scafolding/views/new_message.haml
397
401
  - lib/fanforce/app_factory/scafolding/views/source_details.haml
398
402
  - lib/fanforce/app_factory/scafolding/views/widget_templates.haml
399
- - lib/fanforce/app_factory/sinatra/Routes.rb
400
403
  - lib/fanforce/app_factory/sinatra/_load.rb
401
404
  - lib/fanforce/app_factory/sinatra/error_handling.rb
402
405
  - lib/fanforce/app_factory/sinatra/helper_routes/app.rb
@@ -1,17 +0,0 @@
1
- class Fanforce::App::Sinatra
2
-
3
- get '/internals/config.json' do
4
- File.open("#{Fanforce::App.root_dir}/config.json").read
5
- end
6
-
7
- post '/internals/config.json' do
8
- filename = File.open("#{Fanforce::App.root_dir}/config.json")
9
- old_config = MultiJson.load(filename.read, symbolize_keys: true)
10
- new_config = MultiJson.load(params[:config], symbolize_keys: true)
11
- raise 'IUIDs do not match' if old_config[:_iuid] and old_config[:_iuid] != new_config[:_iuid]
12
-
13
- File.open(filename, 'w') {|f| f.write(JSON.pretty_generate(Hash[new_config.sort])) }
14
- json status: 'finished'
15
- end
16
-
17
- end