pbw 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +8 -8
  2. data/MIT-LICENSE +1 -1
  3. data/Rakefile +7 -0
  4. data/app/controllers/pbw/application_controller.rb +9 -3
  5. data/app/controllers/pbw/areas_controller.rb +7 -0
  6. data/app/controllers/pbw/base_models_controller.rb +106 -0
  7. data/app/controllers/pbw/capabilities_controller.rb +7 -0
  8. data/app/controllers/pbw/constraints_controller.rb +7 -0
  9. data/app/controllers/pbw/item_containers_controller.rb +7 -0
  10. data/app/controllers/pbw/item_conversions_controller.rb +7 -0
  11. data/app/controllers/pbw/item_transfers_controller.rb +7 -0
  12. data/app/controllers/pbw/items_controller.rb +7 -0
  13. data/app/controllers/pbw/processes_controller.rb +7 -0
  14. data/app/controllers/pbw/roles_controller.rb +5 -2
  15. data/app/controllers/pbw/tokens_controller.rb +7 -0
  16. data/app/controllers/pbw/triggers_controller.rb +7 -0
  17. data/app/controllers/pbw/user_tokens_controller.rb +7 -0
  18. data/app/models/pbw/area.rb +17 -0
  19. data/app/models/pbw/capability.rb +5 -0
  20. data/app/models/pbw/constraint.rb +6 -0
  21. data/app/models/pbw/item.rb +15 -0
  22. data/app/models/pbw/item_container.rb +12 -0
  23. data/app/models/pbw/item_conversion.rb +9 -0
  24. data/app/models/pbw/item_transfer.rb +9 -0
  25. data/app/models/pbw/permission.rb +1 -0
  26. data/app/models/pbw/process.rb +10 -0
  27. data/app/models/pbw/role.rb +1 -0
  28. data/app/models/pbw/rule.rb +11 -0
  29. data/app/models/pbw/token.rb +16 -0
  30. data/app/models/pbw/trigger.rb +7 -0
  31. data/app/models/pbw/user.rb +7 -5
  32. data/app/models/pbw/user_token.rb +16 -0
  33. data/app/views/layouts/pbw/application.html.erb +41 -8
  34. data/config/initializers/devise.rb +80 -4
  35. data/config/locales/devise.en.yml +59 -0
  36. data/config/routes.rb +11 -0
  37. data/lib/generators/pbw/install/install_generator.rb +9 -1
  38. data/lib/generators/pbw/install/templates/application.html.erb +47 -0
  39. data/lib/pbw/engine.rb +33 -13
  40. data/lib/pbw/version.rb +1 -1
  41. data/public/Foundation-MIT-LICENSE.txt +20 -0
  42. data/public/config.rb +26 -0
  43. data/public/humans.txt +8 -0
  44. data/public/javascripts/foundation/foundation.alerts.js +52 -0
  45. data/public/javascripts/foundation/foundation.clearing.js +516 -0
  46. data/public/javascripts/foundation/foundation.cookie.js +74 -0
  47. data/public/javascripts/foundation/foundation.dropdown.js +178 -0
  48. data/public/javascripts/foundation/foundation.forms.js +525 -0
  49. data/public/javascripts/foundation/foundation.interchange.js +271 -0
  50. data/public/javascripts/foundation/foundation.joyride.js +844 -0
  51. data/public/javascripts/foundation/foundation.js +447 -0
  52. data/public/javascripts/foundation/foundation.magellan.js +134 -0
  53. data/public/javascripts/foundation/foundation.orbit.js +390 -0
  54. data/public/javascripts/foundation/foundation.placeholder.js +179 -0
  55. data/public/javascripts/foundation/foundation.reveal.js +330 -0
  56. data/public/javascripts/foundation/foundation.section.js +422 -0
  57. data/public/javascripts/foundation/foundation.tooltips.js +208 -0
  58. data/public/javascripts/foundation/foundation.topbar.js +303 -0
  59. data/public/javascripts/vendor/custom.modernizr.js +4 -0
  60. data/public/javascripts/vendor/jquery.js +9807 -0
  61. data/public/javascripts/vendor/zepto.js +2000 -0
  62. data/public/robots.txt +4 -0
  63. data/public/sass/_normalize.scss +402 -0
  64. data/public/sass/_settings.scss +1271 -0
  65. data/public/sass/app.scss +48 -0
  66. data/public/stylesheets/app.css +6686 -0
  67. metadata +82 -4
  68. data/app/assets/javascripts/pbw/application.js +0 -13
  69. data/app/assets/stylesheets/pbw/application.css +0 -13
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed. You are now signed in."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account was not activated yet."
12
+ invalid: "Invalid email or password."
13
+ invalid_token: "Invalid authentication token."
14
+ locked: "Your account is locked."
15
+ not_found_in_database: "Invalid email or password."
16
+ timeout: "Your session expired, please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"
data/config/routes.rb CHANGED
@@ -3,4 +3,15 @@ Pbw::Engine.routes.draw do
3
3
  class_name: 'Pbw::User',
4
4
  module: :devise
5
5
  }
6
+ resources :areas
7
+ resources :capabilities
8
+ resources :constraints
9
+ resources :processes
10
+ resources :items
11
+ resources :item_containers
12
+ resources :item_conversions
13
+ resources :item_transfers
14
+ resources :tokens
15
+ resources :triggers
16
+ resources :user_tokens
6
17
  end
@@ -31,7 +31,15 @@ module Pbw
31
31
  end
32
32
 
33
33
  def add_engine_routes
34
- route "mount Pbw::Engine, :at => '/'"
34
+ route "mount Pbw::Engine, :at => '/pbw'"
35
+ end
36
+
37
+ def devise_views
38
+ generate "devise:views"
39
+ end
40
+
41
+ def engine_layout
42
+ template "application.html.erb", "app/views/pbw/layouts/application.html.erb"
35
43
  end
36
44
  end
37
45
  end
@@ -0,0 +1,47 @@
1
+
2
+ <!DOCTYPE html>
3
+ <!--[if IE 8]> <html class="no-js lt-ie9" lang="en" > <![endif]-->
4
+ <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5
+ <head>
6
+ <meta charset="utf-8" />
7
+ <meta name="viewport" content="width=device-width" />
8
+ <title>PBW</title>
9
+ <link rel="stylesheet" href="stylesheets/app.css" />
10
+ <script src="javascripts/vendor/custom.modernizr.js"></script>
11
+ </head>
12
+ <body>
13
+ <div class="row">
14
+ <div class="large-12 columns">
15
+ <h2>Welcome to PBW</h2>
16
+ <p>This is version <%=Pbw::Engine.version%></p>
17
+ <hr />
18
+ </div>
19
+ </div>
20
+
21
+ <script>
22
+ document.write('<script src=' +
23
+ ('__proto__' in {} ? 'javascripts/vendor/zepto' : 'javascripts/vendor/jquery') +
24
+ '.js><\/script>')
25
+ </script>
26
+ <script src="javascripts/foundation/foundation.js"></script>
27
+ <script src="javascripts/foundation/foundation.alerts.js"></script>
28
+ <script src="javascripts/foundation/foundation.clearing.js"></script>
29
+ <script src="javascripts/foundation/foundation.cookie.js"></script>
30
+ <script src="javascripts/foundation/foundation.dropdown.js"></script>
31
+ <script src="javascripts/foundation/foundation.forms.js"></script>
32
+ <script src="javascripts/foundation/foundation.interchange.js"></script>
33
+ <script src="javascripts/foundation/foundation.joyride.js"></script>
34
+ <script src="javascripts/foundation/foundation.magellan.js"></script>
35
+ <script src="javascripts/foundation/foundation.orbit.js"></script>
36
+ <script src="javascripts/foundation/foundation.placeholder.js"></script>
37
+ <script src="javascripts/foundation/foundation.reveal.js"></script>
38
+ <script src="javascripts/foundation/foundation.section.js"></script>
39
+ <script src="javascripts/foundation/foundation.tooltips.js"></script>
40
+ <script src="javascripts/foundation/foundation.topbar.js"></script>
41
+
42
+
43
+ <script>
44
+ $(document).foundation();
45
+ </script>
46
+ </body>
47
+ </html>
data/lib/pbw/engine.rb CHANGED
@@ -1,20 +1,40 @@
1
+ require 'pbw/version'
2
+
1
3
  module Pbw
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace Pbw
4
6
  engine_name 'pbw'
5
-
7
+
8
+ config.mount_at = '/pbw'
9
+
10
+ rake_tasks do
11
+ load File.join(File.dirname(__FILE__), 'tasks/pbw_tasks.rake')
12
+ end
13
+
6
14
  config.generators do |g|
7
- g.orm :mongoid
8
- g.template_engine :erb
9
- g.test_framework :rspec
10
- g.assets :false
11
- g.helper :false
12
- g.javascript_engine :coffee
13
- end
14
-
15
- def self.config(&block)
16
- yield Engine.config if block
17
- Engine.config
18
- end
15
+ g.orm :mongoid
16
+ g.template_engine :erb
17
+ g.test_framework :rspec
18
+ g.assets :false
19
+ g.helper :false
20
+ g.javascript_engine :coffee
21
+ end
22
+
23
+ initializer "check config" do |app|
24
+ config.mount_at += '/' unless config.mount_at.last == '/'
25
+ end
26
+
27
+ initializer "static assets" do |app|
28
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
29
+ end
30
+
31
+ def self.config(&block)
32
+ yield Engine.config if block
33
+ Engine.config
34
+ end
35
+
36
+ def self.version
37
+ Pbw::VERSION
38
+ end
19
39
  end
20
40
  end
data/lib/pbw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pbw
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 ZURB, http://www.zurb.com/
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/public/config.rb ADDED
@@ -0,0 +1,26 @@
1
+ require 'zurb-foundation'
2
+ # Require any additional compass plugins here.
3
+
4
+
5
+ # Set this to the root of your project when deployed:
6
+ http_path = "/"
7
+ css_dir = "stylesheets"
8
+ sass_dir = "sass"
9
+ images_dir = "images"
10
+ javascripts_dir = "javascripts"
11
+
12
+ # You can select your preferred output style here (can be overridden via the command line):
13
+ # output_style = :expanded or :nested or :compact or :compressed
14
+
15
+ # To enable relative paths to assets via compass helper functions. Uncomment:
16
+ # relative_assets = true
17
+
18
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
19
+ # line_comments = false
20
+
21
+
22
+ # If you prefer the indented syntax, you might want to regenerate this
23
+ # project again passing --syntax sass, or you can uncomment this:
24
+ # preferred_syntax = :sass
25
+ # and then run:
26
+ # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
data/public/humans.txt ADDED
@@ -0,0 +1,8 @@
1
+ /* Foundation was made by ZURB, an interaction design and design strategy firm in Campbell, CA */
2
+ /* zurb.com */
3
+ /* humanstxt.org */
4
+
5
+ /* SITE */
6
+ Standards: HTML5, CSS3
7
+ Components: jQuery, Orbit, Reveal
8
+ Software: Coda, Textmate, Git
@@ -0,0 +1,52 @@
1
+ /*jslint unparam: true, browser: true, indent: 2 */
2
+
3
+ ;(function ($, window, document, undefined) {
4
+ 'use strict';
5
+
6
+ Foundation.libs.alerts = {
7
+ name : 'alerts',
8
+
9
+ version : '4.2.2',
10
+
11
+ settings : {
12
+ speed: 300, // fade out speed
13
+ callback: function (){}
14
+ },
15
+
16
+ init : function (scope, method, options) {
17
+ this.scope = scope || this.scope;
18
+
19
+ if (typeof method === 'object') {
20
+ $.extend(true, this.settings, method);
21
+ }
22
+
23
+ if (typeof method !== 'string') {
24
+ if (!this.settings.init) { this.events(); }
25
+
26
+ return this.settings.init;
27
+ } else {
28
+ return this[method].call(this, options);
29
+ }
30
+ },
31
+
32
+ events : function () {
33
+ var self = this;
34
+
35
+ $(this.scope).on('click.fndtn.alerts', '[data-alert] a.close', function (e) {
36
+ e.preventDefault();
37
+ $(this).closest("[data-alert]").fadeOut(self.speed, function () {
38
+ $(this).remove();
39
+ self.settings.callback();
40
+ });
41
+ });
42
+
43
+ this.settings.init = true;
44
+ },
45
+
46
+ off : function () {
47
+ $(this.scope).off('.fndtn.alerts');
48
+ },
49
+
50
+ reflow : function () {}
51
+ };
52
+ }(Foundation.zj, this, this.document));