brightcontent 2.0.0.alpha3 → 2.0.0.alpha5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. data/README.md +13 -1
  2. data/VERSION +1 -1
  3. metadata +7 -178
  4. data/.gitignore +0 -8
  5. data/MIT-LICENSE +0 -20
  6. data/Rakefile +0 -14
  7. data/brightcontent.gemspec +0 -21
  8. data/core/.gitignore +0 -9
  9. data/core/Gemfile +0 -17
  10. data/core/Gemfile.lock +0 -163
  11. data/core/MIT-LICENSE +0 -20
  12. data/core/README.md +0 -44
  13. data/core/Rakefile +0 -14
  14. data/core/app/assets/images/brightcontent/.gitkeep +0 -0
  15. data/core/app/assets/images/brightcontent/glyphicons-halflings-white.png +0 -0
  16. data/core/app/assets/images/brightcontent/glyphicons-halflings.png +0 -0
  17. data/core/app/assets/javascripts/brightcontent/bootstrap.min.js +0 -6
  18. data/core/app/assets/javascripts/brightcontent/brightcontent.js +0 -17
  19. data/core/app/assets/javascripts/brightcontent/custom.js +0 -1
  20. data/core/app/assets/javascripts/brightcontent/main.js +0 -3
  21. data/core/app/assets/stylesheets/brightcontent/bootstrap-responsive.min.css +0 -9
  22. data/core/app/assets/stylesheets/brightcontent/bootstrap.min.css +0 -9
  23. data/core/app/assets/stylesheets/brightcontent/brightcontent.css +0 -17
  24. data/core/app/assets/stylesheets/brightcontent/custom.css +0 -1
  25. data/core/app/assets/stylesheets/brightcontent/main.css +0 -44
  26. data/core/app/controllers/brightcontent/admin_users_controller.rb +0 -6
  27. data/core/app/controllers/brightcontent/application_controller.rb +0 -22
  28. data/core/app/controllers/brightcontent/base_controller.rb +0 -27
  29. data/core/app/controllers/brightcontent/sessions_controller.rb +0 -24
  30. data/core/app/helpers/brightcontent/application_helper.rb +0 -4
  31. data/core/app/helpers/brightcontent/base_helper.rb +0 -17
  32. data/core/app/models/brightcontent/admin_user.rb +0 -7
  33. data/core/app/views/brightcontent/application/_menu.html.erb +0 -3
  34. data/core/app/views/brightcontent/application/_show_flash_names.html.erb +0 -5
  35. data/core/app/views/brightcontent/base/_form.html.erb +0 -10
  36. data/core/app/views/brightcontent/base/_list.html.erb +0 -8
  37. data/core/app/views/brightcontent/base/_list_actions.html.erb +0 -2
  38. data/core/app/views/brightcontent/base/edit.html.erb +0 -3
  39. data/core/app/views/brightcontent/base/index.html.erb +0 -22
  40. data/core/app/views/brightcontent/base/new.html.erb +0 -3
  41. data/core/app/views/brightcontent/sessions/new.html.erb +0 -12
  42. data/core/app/views/layouts/brightcontent/application.html.erb +0 -53
  43. data/core/brightcontent-core.gemspec +0 -31
  44. data/core/config/initializers/simple_form.rb +0 -142
  45. data/core/config/initializers/simple_form_bootstrap.rb +0 -45
  46. data/core/config/initializers/will_paginate.rb +0 -28
  47. data/core/config/routes.rb +0 -9
  48. data/core/db/migrate/20121206121725_create_brightcontent_admin_users.rb +0 -12
  49. data/core/lib/brightcontent/core.rb +0 -32
  50. data/core/lib/brightcontent/default_actions.rb +0 -19
  51. data/core/lib/brightcontent/engine.rb +0 -9
  52. data/core/lib/brightcontent/pagination.rb +0 -24
  53. data/core/lib/brightcontent/rails/routes.rb +0 -16
  54. data/core/lib/brightcontent/routes_parser.rb +0 -38
  55. data/core/lib/brightcontent-core.rb +0 -1
  56. data/core/lib/generators/brightcontent/install_generator.rb +0 -34
  57. data/core/lib/generators/brightcontent/resource_generator.rb +0 -22
  58. data/core/lib/generators/brightcontent/templates/brightcontent_controller.rb +0 -2
  59. data/core/lib/generators/brightcontent/templates/initializer.rb +0 -8
  60. data/core/script/rails +0 -8
  61. data/core/spec/dummy/README.rdoc +0 -261
  62. data/core/spec/dummy/Rakefile +0 -7
  63. data/core/spec/dummy/app/assets/javascripts/application.js +0 -15
  64. data/core/spec/dummy/app/assets/javascripts/brightcontent/custom.js +0 -1
  65. data/core/spec/dummy/app/assets/stylesheets/application.css +0 -13
  66. data/core/spec/dummy/app/assets/stylesheets/brightcontent/custom.css +0 -1
  67. data/core/spec/dummy/app/controllers/application_controller.rb +0 -3
  68. data/core/spec/dummy/app/controllers/brightcontent/blogs_controller.rb +0 -2
  69. data/core/spec/dummy/app/controllers/pages_controller.rb +0 -8
  70. data/core/spec/dummy/app/helpers/application_helper.rb +0 -2
  71. data/core/spec/dummy/app/mailers/.gitkeep +0 -0
  72. data/core/spec/dummy/app/models/.gitkeep +0 -0
  73. data/core/spec/dummy/app/models/blog.rb +0 -3
  74. data/core/spec/dummy/app/views/layouts/application.html.erb +0 -14
  75. data/core/spec/dummy/app/views/pages/index.html.erb +0 -1
  76. data/core/spec/dummy/config/application.rb +0 -59
  77. data/core/spec/dummy/config/boot.rb +0 -10
  78. data/core/spec/dummy/config/database.yml +0 -25
  79. data/core/spec/dummy/config/environment.rb +0 -5
  80. data/core/spec/dummy/config/environments/development.rb +0 -37
  81. data/core/spec/dummy/config/environments/production.rb +0 -67
  82. data/core/spec/dummy/config/environments/test.rb +0 -37
  83. data/core/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  84. data/core/spec/dummy/config/initializers/brightcontent.rb +0 -3
  85. data/core/spec/dummy/config/initializers/inflections.rb +0 -15
  86. data/core/spec/dummy/config/initializers/mime_types.rb +0 -5
  87. data/core/spec/dummy/config/initializers/secret_token.rb +0 -7
  88. data/core/spec/dummy/config/initializers/session_store.rb +0 -8
  89. data/core/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  90. data/core/spec/dummy/config/locales/en.yml +0 -5
  91. data/core/spec/dummy/config/routes.rb +0 -7
  92. data/core/spec/dummy/config.ru +0 -4
  93. data/core/spec/dummy/db/migrate/20121206225720_create_blogs.rb +0 -10
  94. data/core/spec/dummy/db/schema.rb +0 -30
  95. data/core/spec/dummy/lib/assets/.gitkeep +0 -0
  96. data/core/spec/dummy/public/404.html +0 -26
  97. data/core/spec/dummy/public/422.html +0 -26
  98. data/core/spec/dummy/public/500.html +0 -25
  99. data/core/spec/dummy/public/favicon.ico +0 -0
  100. data/core/spec/dummy/script/rails +0 -6
  101. data/core/spec/factories.rb +0 -16
  102. data/core/spec/features/login_spec.rb +0 -29
  103. data/core/spec/features/menu_spec.rb +0 -27
  104. data/core/spec/features/resources_form_spec.rb +0 -51
  105. data/core/spec/features/resources_index_spec.rb +0 -50
  106. data/core/spec/lib/brightcontent/routes_parser_spec.rb +0 -34
  107. data/core/spec/spec_helper.rb +0 -18
  108. data/core/spec/support/acceptance_helper.rb +0 -8
  109. data/pages/.gitignore +0 -9
  110. data/pages/Gemfile +0 -5
  111. data/pages/Gemfile.lock +0 -173
  112. data/pages/MIT-LICENSE +0 -20
  113. data/pages/README.md +0 -35
  114. data/pages/Rakefile +0 -14
  115. data/pages/app/assets/images/brightcontent/.gitkeep +0 -0
  116. data/pages/app/controllers/brightcontent/pages_controller.rb +0 -16
  117. data/pages/app/helpers/brightcontent/pages_helper.rb +0 -13
  118. data/pages/app/models/brightcontent/page.rb +0 -27
  119. data/pages/app/views/brightcontent/pages/_form_field_parent_id.html.erb +0 -1
  120. data/pages/app/views/brightcontent/pages/_list_field_name.html.erb +0 -1
  121. data/pages/brightcontent-pages.gemspec +0 -26
  122. data/pages/config/routes.rb +0 -3
  123. data/pages/db/migrate/20121207132810_create_brightcontent_pages.rb +0 -16
  124. data/pages/lib/brightcontent/pages/engine.rb +0 -14
  125. data/pages/lib/brightcontent/pages/methods.rb +0 -9
  126. data/pages/lib/brightcontent/pages.rb +0 -10
  127. data/pages/lib/brightcontent-pages.rb +0 -1
  128. data/pages/lib/generators/brightcontent/pages/install_generator.rb +0 -15
  129. data/pages/script/rails +0 -8
  130. data/pages/spec/dummy/README.rdoc +0 -261
  131. data/pages/spec/dummy/Rakefile +0 -7
  132. data/pages/spec/dummy/app/assets/javascripts/application.js +0 -15
  133. data/pages/spec/dummy/app/assets/javascripts/brightcontent/custom.js +0 -1
  134. data/pages/spec/dummy/app/assets/stylesheets/application.css +0 -13
  135. data/pages/spec/dummy/app/assets/stylesheets/brightcontent/custom.css +0 -1
  136. data/pages/spec/dummy/app/controllers/application_controller.rb +0 -3
  137. data/pages/spec/dummy/app/controllers/brightcontent/blogs_controller.rb +0 -2
  138. data/pages/spec/dummy/app/controllers/pages_controller.rb +0 -8
  139. data/pages/spec/dummy/app/helpers/application_helper.rb +0 -2
  140. data/pages/spec/dummy/app/mailers/.gitkeep +0 -0
  141. data/pages/spec/dummy/app/models/.gitkeep +0 -0
  142. data/pages/spec/dummy/app/models/blog.rb +0 -3
  143. data/pages/spec/dummy/app/views/layouts/application.html.erb +0 -14
  144. data/pages/spec/dummy/app/views/pages/index.html.erb +0 -1
  145. data/pages/spec/dummy/config/application.rb +0 -59
  146. data/pages/spec/dummy/config/boot.rb +0 -10
  147. data/pages/spec/dummy/config/database.yml +0 -25
  148. data/pages/spec/dummy/config/environment.rb +0 -5
  149. data/pages/spec/dummy/config/environments/development.rb +0 -37
  150. data/pages/spec/dummy/config/environments/production.rb +0 -67
  151. data/pages/spec/dummy/config/environments/test.rb +0 -37
  152. data/pages/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  153. data/pages/spec/dummy/config/initializers/brightcontent.rb +0 -3
  154. data/pages/spec/dummy/config/initializers/inflections.rb +0 -15
  155. data/pages/spec/dummy/config/initializers/mime_types.rb +0 -5
  156. data/pages/spec/dummy/config/initializers/secret_token.rb +0 -7
  157. data/pages/spec/dummy/config/initializers/session_store.rb +0 -8
  158. data/pages/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  159. data/pages/spec/dummy/config/locales/en.yml +0 -5
  160. data/pages/spec/dummy/config/routes.rb +0 -6
  161. data/pages/spec/dummy/config.ru +0 -4
  162. data/pages/spec/dummy/db/schema.rb +0 -44
  163. data/pages/spec/dummy/lib/assets/.gitkeep +0 -0
  164. data/pages/spec/dummy/public/404.html +0 -26
  165. data/pages/spec/dummy/public/422.html +0 -26
  166. data/pages/spec/dummy/public/500.html +0 -25
  167. data/pages/spec/dummy/public/favicon.ico +0 -0
  168. data/pages/spec/dummy/script/rails +0 -6
  169. data/pages/spec/factories.rb +0 -16
  170. data/pages/spec/features/menu_spec.rb +0 -16
  171. data/pages/spec/features/pages_spec.rb +0 -18
  172. data/pages/spec/models/brightcontent/page_spec.rb +0 -49
  173. data/pages/spec/spec_helper.rb +0 -18
  174. data/pages/spec/support/acceptance_helper.rb +0 -8
@@ -1,2 +0,0 @@
1
- <%= link_to "Edit", polymorphic_url(item, action: :edit), class: "btn btn-mini btn-primary" %>
2
- <%= link_to "Delete", polymorphic_url(item), class: "btn btn-mini", confirm: 'Are you sure?', method: :delete %>
@@ -1,3 +0,0 @@
1
- <h1>Edit <%= resource_instance_name.to_s %></h1>
2
-
3
- <%= render "form" %>
@@ -1,22 +0,0 @@
1
- <div id="overview">
2
-
3
- <%= link_to "Create new #{resource_instance_name.to_s.humanize}", polymorphic_url(resource_class, action: :new), class: "btn btn-primary btn-right" %>
4
- <h1><%= resource_collection_name.to_s.humanize %></h1>
5
-
6
- <table class="table table-hover">
7
- <thead>
8
- <tr>
9
- <% list_fields.each do |list_field| %>
10
- <th><%= list_field.humanize %></th>
11
- <% end %>
12
- <th></th>
13
- </tr>
14
- </thead>
15
- <tbody>
16
- <%= render "list", collection: collection, list_fields: list_fields %>
17
- </tbody>
18
- </table>
19
-
20
- <%= will_paginate collection %>
21
-
22
- </div>
@@ -1,3 +0,0 @@
1
- <h1>Create new <%= resource_instance_name.to_s %></h1>
2
-
3
- <%= render "form" %>
@@ -1,12 +0,0 @@
1
- <%= form_tag sessions_path, class: "form-signin" do %>
2
- <h2>Please sign in</h2>
3
- <div class="field">
4
- <%= label_tag :email %>
5
- <%= text_field_tag :email, params[:email] %>
6
- </div>
7
- <div class="field">
8
- <%= label_tag :password %>
9
- <%= password_field_tag :password %>
10
- </div>
11
- <%= submit_tag "Login", class: "btn btn-large btn-primary" %>
12
- <% end %>
@@ -1,53 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Brightcontent</title>
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <%= stylesheet_link_tag "brightcontent/brightcontent", :media => "all" %>
7
- <%= javascript_include_tag "brightcontent/brightcontent" %>
8
- <%= csrf_meta_tags %>
9
- <!--[if lt IE 9]>
10
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- </head>
13
- <body>
14
-
15
-
16
- <% if current_user %>
17
- <div class="navbar">
18
- <div class="navbar-inner">
19
- <div class="container">
20
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
21
- <span class="icon-bar"></span>
22
- <span class="icon-bar"></span>
23
- <span class="icon-bar"></span>
24
- </a>
25
- <%= link_to Brightcontent.application_name, root_path, class: "brand" %>
26
- <div class="nav-collapse collapse">
27
- <ul class="nav" id="menu">
28
- <%= render "menu" %>
29
- </ul>
30
- <ul class="nav pull-right">
31
- <li class="dropdown">
32
- <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= current_user.email %><b class="caret"></b></a>
33
- <ul class="dropdown-menu">
34
- <li><%= link_to "Admins", admin_users_path %></li>
35
- <li><%= link_to "Logout", logout_path %></li>
36
- <ul>
37
- </li>
38
- </ul>
39
- </div>
40
- </div>
41
- </div>
42
- </div>
43
- <% end %>
44
-
45
- <div class="container box">
46
- <%= render "brightcontent/application/show_flash_names" %>
47
- <%= yield %>
48
- </div>
49
-
50
- </div>
51
-
52
- </body>
53
- </html>
@@ -1,31 +0,0 @@
1
- $:.push File.expand_path("../lib", __FILE__)
2
-
3
- version = File.read(File.expand_path("../../VERSION",__FILE__)).strip
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "brightcontent-core"
7
- s.version = version
8
- s.email = "developers@brightin.nl"
9
- s.homepage = "http://brightin.nl"
10
- s.summary = "Brightcontent core"
11
- s.description = "Brightcontent core"
12
- s.authors = ["Developers at Brightin"]
13
-
14
- s.files = `git ls-files`.split("\n")
15
- s.test_files = `git ls-files -- spec/*`.split("\n")
16
- s.require_paths = ["lib"]
17
-
18
- s.add_dependency "rails", "~> 3.2.9"
19
- s.add_dependency "jquery-rails"
20
- s.add_dependency "bcrypt-ruby"
21
- s.add_dependency "inherited_resources"
22
- s.add_dependency "simple_form"
23
- s.add_dependency "will_paginate"
24
- s.add_dependency "bootstrap-wysihtml5-rails"
25
-
26
- s.add_development_dependency "sqlite3"
27
- s.add_development_dependency "rspec-rails"
28
- s.add_development_dependency "capybara"
29
- s.add_development_dependency "launchy"
30
- s.add_development_dependency "factory_girl_rails"
31
- end
@@ -1,142 +0,0 @@
1
- # Use this setup block to configure all options available in SimpleForm.
2
- SimpleForm.setup do |config|
3
- # Wrappers are used by the form builder to generate a
4
- # complete input. You can remove any component from the
5
- # wrapper, change the order or even add your own to the
6
- # stack. The options given below are used to wrap the
7
- # whole input.
8
- config.wrappers :default, :class => :input,
9
- :hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
10
- ## Extensions enabled by default
11
- # Any of these extensions can be disabled for a
12
- # given input by passing: `f.input EXTENSION_NAME => false`.
13
- # You can make any of these extensions optional by
14
- # renaming `b.use` to `b.optional`.
15
-
16
- # Determines whether to use HTML5 (:email, :url, ...)
17
- # and required attributes
18
- b.use :html5
19
-
20
- # Calculates placeholders automatically from I18n
21
- # You can also pass a string as f.input :placeholder => "Placeholder"
22
- b.use :placeholder
23
-
24
- ## Optional extensions
25
- # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
26
- # to the input. If so, they will retrieve the values from the model
27
- # if any exists. If you want to enable the lookup for any of those
28
- # extensions by default, you can change `b.optional` to `b.use`.
29
-
30
- # Calculates maxlength from length validations for string inputs
31
- b.optional :maxlength
32
-
33
- # Calculates pattern from format validations for string inputs
34
- b.optional :pattern
35
-
36
- # Calculates min and max from length validations for numeric inputs
37
- b.optional :min_max
38
-
39
- # Calculates readonly automatically from readonly attributes
40
- b.optional :readonly
41
-
42
- ## Inputs
43
- b.use :label_input
44
- b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
45
- b.use :error, :wrap_with => { :tag => :span, :class => :error }
46
- end
47
-
48
- # The default wrapper to be used by the FormBuilder.
49
- config.default_wrapper = :default
50
-
51
- # Define the way to render check boxes / radio buttons with labels.
52
- # Defaults to :nested for bootstrap config.
53
- # :inline => input + label
54
- # :nested => label > input
55
- config.boolean_style = :nested
56
-
57
- # Default class for buttons
58
- config.button_class = 'btn'
59
-
60
- # Method used to tidy up errors. Specify any Rails Array method.
61
- # :first lists the first message for each field.
62
- # Use :to_sentence to list all errors for each field.
63
- # config.error_method = :first
64
-
65
- # Default tag used for error notification helper.
66
- config.error_notification_tag = :div
67
-
68
- # CSS class to add for error notification helper.
69
- config.error_notification_class = 'alert alert-error'
70
-
71
- # ID to add for error notification helper.
72
- # config.error_notification_id = nil
73
-
74
- # Series of attempts to detect a default label method for collection.
75
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
76
-
77
- # Series of attempts to detect a default value method for collection.
78
- # config.collection_value_methods = [ :id, :to_s ]
79
-
80
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
81
- # config.collection_wrapper_tag = nil
82
-
83
- # You can define the class to use on all collection wrappers. Defaulting to none.
84
- # config.collection_wrapper_class = nil
85
-
86
- # You can wrap each item in a collection of radio/check boxes with a tag,
87
- # defaulting to :span. Please note that when using :boolean_style = :nested,
88
- # SimpleForm will force this option to be a label.
89
- # config.item_wrapper_tag = :span
90
-
91
- # You can define a class to use in all item wrappers. Defaulting to none.
92
- # config.item_wrapper_class = nil
93
-
94
- # How the label text should be generated altogether with the required text.
95
- # config.label_text = lambda { |label, required| "#{required} #{label}" }
96
-
97
- # You can define the class to use on all labels. Default is nil.
98
- config.label_class = 'control-label'
99
-
100
- # You can define the class to use on all forms. Default is simple_form.
101
- config.form_class = 'form-horizontal'
102
-
103
- # You can define which elements should obtain additional classes
104
- # config.generate_additional_classes_for = [:wrapper, :label, :input]
105
-
106
- # Whether attributes are required by default (or not). Default is true.
107
- # config.required_by_default = true
108
-
109
- # Tell browsers whether to use default HTML5 validations (novalidate option).
110
- # Default is enabled.
111
- config.browser_validations = false
112
-
113
- # Collection of methods to detect if a file type was given.
114
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
115
-
116
- # Custom mappings for input types. This should be a hash containing a regexp
117
- # to match as key, and the input type that will be used when the field name
118
- # matches the regexp as value.
119
- # config.input_mappings = { /count/ => :integer }
120
-
121
- # Custom wrappers for input types. This should be a hash containing an input
122
- # type as key and the wrapper that will be used for all inputs with specified type.
123
- # config.wrapper_mappings = { :string => :prepend }
124
-
125
- # Default priority for time_zone inputs.
126
- # config.time_zone_priority = nil
127
-
128
- # Default priority for country inputs.
129
- # config.country_priority = nil
130
-
131
- # Default size for text inputs.
132
- # config.default_input_size = 50
133
-
134
- # When false, do not use translations for labels.
135
- # config.translate_labels = true
136
-
137
- # Automatically discover new inputs in Rails' autoload path.
138
- # config.inputs_discovery = true
139
-
140
- # Cache SimpleForm inputs discovery
141
- config.cache_discovery = !Rails.env.development?
142
- end
@@ -1,45 +0,0 @@
1
- # Use this setup block to configure all options available in SimpleForm.
2
- SimpleForm.setup do |config|
3
- config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
4
- b.use :html5
5
- b.use :placeholder
6
- b.use :label
7
- b.wrapper :tag => 'div', :class => 'controls' do |ba|
8
- ba.use :input
9
- ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
10
- ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
11
- end
12
- end
13
-
14
- config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
15
- b.use :html5
16
- b.use :placeholder
17
- b.use :label
18
- b.wrapper :tag => 'div', :class => 'controls' do |input|
19
- input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
20
- prepend.use :input
21
- end
22
- input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
23
- input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
24
- end
25
- end
26
-
27
- config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
28
- b.use :html5
29
- b.use :placeholder
30
- b.use :label
31
- b.wrapper :tag => 'div', :class => 'controls' do |input|
32
- input.wrapper :tag => 'div', :class => 'input-append' do |append|
33
- append.use :input
34
- end
35
- input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
36
- input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
37
- end
38
- end
39
-
40
- # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
41
- # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
42
- # to learn about the different styles for forms and inputs,
43
- # buttons and other elements.
44
- config.default_wrapper = :bootstrap
45
- end
@@ -1,28 +0,0 @@
1
- module WillPaginate
2
- module ActionView
3
- def will_paginate(collection = nil, options = {})
4
- options[:renderer] ||= BootstrapLinkRenderer
5
- super.try :html_safe
6
- end
7
-
8
- class BootstrapLinkRenderer < LinkRenderer
9
- protected
10
-
11
- def html_container(html)
12
- tag :div, tag(:ul, html), container_attributes
13
- end
14
-
15
- def page_number(page)
16
- tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page)
17
- end
18
-
19
- def previous_or_next_page(page, text, classname)
20
- tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('disabled' unless page)].join(' ')
21
- end
22
-
23
- def gap
24
- tag :li, link(super, '#'), :class => 'disabled'
25
- end
26
- end
27
- end
28
- end
@@ -1,9 +0,0 @@
1
- Brightcontent::Engine.routes.draw do
2
- get 'login', to: 'sessions#new'
3
- get 'logout', to: 'sessions#destroy'
4
-
5
- resources :admin_users
6
- resources :sessions, only: [:new, :create, :destroy]
7
-
8
- root to: "admin_users#index"
9
- end
@@ -1,12 +0,0 @@
1
- class CreateBrightcontentAdminUsers < ActiveRecord::Migration
2
- def change
3
- create_table :brightcontent_admin_users do |t|
4
- t.string :email
5
- t.string :password_digest
6
-
7
- t.timestamps
8
- end
9
-
10
- Brightcontent::AdminUser.create!(:email => 'admin@example.com', :password => 'password')
11
- end
12
- end
@@ -1,32 +0,0 @@
1
- require "inherited_resources"
2
- require "simple_form"
3
- require "jquery-rails"
4
- require "will_paginate"
5
- require "bootstrap-wysihtml5-rails"
6
-
7
- require "brightcontent/rails/routes"
8
- require "brightcontent/engine"
9
-
10
- module Brightcontent
11
-
12
- autoload :Pagination, 'brightcontent/pagination'
13
- autoload :PageMethods, 'brightcontent/page_methods'
14
- autoload :RoutesParser, 'brightcontent/routes_parser'
15
- autoload :DefaultActions, 'brightcontent/default_actions'
16
-
17
- mattr_accessor :engine_resources
18
- @@engine_resources = %w{sessions admin_users}
19
-
20
- mattr_accessor :path
21
- @@path = "admin"
22
-
23
- mattr_accessor :application_name
24
- @@application_name = "Brightcontent"
25
-
26
- # Default way to setup Brightcontent.
27
- # Run rails g brightcontent:install to create initializer
28
- def self.setup
29
- yield self
30
- end
31
-
32
- end
@@ -1,19 +0,0 @@
1
- module Brightcontent
2
- module DefaultActions
3
- def show
4
- redirect_to action: :edit
5
- end
6
-
7
- def create
8
- create! { polymorphic_url(resource_class) }
9
- end
10
-
11
- def update
12
- update! { polymorphic_url(resource_class) }
13
- end
14
-
15
- def destroy
16
- destroy! { polymorphic_url(resource_class) }
17
- end
18
- end
19
- end
@@ -1,9 +0,0 @@
1
- module Brightcontent
2
- class Engine < ::Rails::Engine
3
- isolate_namespace Brightcontent
4
-
5
- initializer "Brightcontent precompile hook", :group => :all do |app|
6
- app.config.assets.precompile += ['brightcontent/brightcontent.js', 'brightcontent/brightcontent.css']
7
- end
8
- end
9
- end
@@ -1,24 +0,0 @@
1
- require 'active_support/concern'
2
-
3
- module Brightcontent
4
- module Pagination
5
- extend ActiveSupport::Concern
6
-
7
- module ClassMethods
8
- def per_page(number)
9
- @per_page_count = number
10
- end
11
-
12
- def per_page_count
13
- @per_page_count || 30
14
- end
15
- end
16
-
17
- private
18
-
19
- def end_of_association_chain
20
- super.paginate(page: params[:page], per_page: self.class.per_page_count)
21
- end
22
-
23
- end
24
- end
@@ -1,16 +0,0 @@
1
- module ActionDispatch::Routing
2
- class Mapper
3
- def brightcontent_resources(&block)
4
- define_user_resources(block) if block_given?
5
- mount Brightcontent::Engine => Brightcontent.path
6
- end
7
-
8
- private
9
-
10
- def define_user_resources(block)
11
- Brightcontent::Engine.routes.draw do
12
- instance_eval &block
13
- end
14
- end
15
- end
16
- end
@@ -1,38 +0,0 @@
1
- require 'active_support/inflector'
2
-
3
- module Brightcontent
4
- class RoutesParser
5
-
6
- def self.parse(routes_hash=nil, engine_resources=nil)
7
- new(routes_hash, engine_resources).user_resource
8
- end
9
-
10
- def initialize(routes_hash=nil, engine_resources=nil)
11
- @routes_hash = routes_hash
12
- @engine_resources = engine_resources
13
- end
14
-
15
- def user_resource
16
- resource_names - engine_resources
17
- end
18
-
19
- private
20
-
21
- def resource_names
22
- routes_hash.map do |route|
23
- if route && route[:action] == "index"
24
- route[:controller].match(/brightcontent\/(.+)/)[1]
25
- end
26
- end.compact
27
- end
28
-
29
- def routes_hash
30
- @routes_hash ||= Engine.routes.routes.map(&:defaults)
31
- end
32
-
33
- def engine_resources
34
- @engine_resources ||= Brightcontent.engine_resources
35
- end
36
-
37
- end
38
- end
@@ -1 +0,0 @@
1
- require 'brightcontent/core'
@@ -1,34 +0,0 @@
1
- module Brightcontent
2
- module Generators
3
- class InstallGenerator < Rails::Generators::Base
4
- source_root File.expand_path("../templates", __FILE__)
5
-
6
- desc "Creates a Brightcontent initializer, copy migrations, edit routes file"
7
-
8
- def copy_initializer
9
- template "initializer.rb", "config/initializers/brightcontent.rb"
10
- end
11
-
12
- def copy_migrations
13
- rake "brightcontent:install:migrations"
14
- end
15
-
16
- def add_routes
17
- route "brightcontent_resources do\n" \
18
- " #resources :vacancies #for example\n" \
19
- " end"
20
- end
21
-
22
- def copy_custom_assets
23
- copy_file "../../../../app/assets/stylesheets/brightcontent/custom.css", "app/assets/stylesheets/brightcontent/custom.css"
24
- copy_file "../../../../app/assets/javascripts/brightcontent/custom.js", "app/assets/javascripts/brightcontent/custom.js"
25
- end
26
-
27
- def setup_directory
28
- empty_directory "app/controllers/brightcontent"
29
- empty_directory "app/views/brightcontent"
30
- end
31
-
32
- end
33
- end
34
- end
@@ -1,22 +0,0 @@
1
- module Brightcontent
2
- module Generators
3
- class ResourceGenerator < Rails::Generators::NamedBase
4
- source_root File.expand_path("../templates", __FILE__)
5
-
6
- desc "Creates Brightcontent controller, route and empty views dir"
7
-
8
- def generate_controller
9
- template "brightcontent_controller.rb", "app/controllers/brightcontent/#{@name.pluralize.underscore}_controller.rb"
10
- end
11
-
12
- def generate_views_directory
13
- empty_directory "app/views/brightcontent/#{name.pluralize.underscore}"
14
- end
15
-
16
- def add_route
17
- inject_into_file 'config/routes.rb', "\n resources :#{name.pluralize.underscore}", { :after => "brightcontent_resources do" }
18
- end
19
-
20
- end
21
- end
22
- end
@@ -1,2 +0,0 @@
1
- class Brightcontent::<%= name.capitalize.pluralize %>Controller < Brightcontent::BaseController
2
- end
@@ -1,8 +0,0 @@
1
- Brightcontent.setup do |config|
2
- # The path where the admin interface should mount.
3
- config.path = "admin"
4
-
5
- # Name of the application which is displayed in header
6
- # Defaults to Rails application name
7
- # config.application_name = "Custom app name"
8
- end
data/core/script/rails DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
- ENGINE_PATH = File.expand_path('../../lib/brightcontent/engine', __FILE__)
6
-
7
- require 'rails/all'
8
- require 'rails/engine/commands'