brightcontent-core 2.1.0 → 2.1.1

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: 785527dbe8ae6e79befb9e074d0ef98893551ba8
4
- data.tar.gz: 1932114b9e4589e765adffc5d630c2a482332434
3
+ metadata.gz: 0ff81cd24827adff2301e1c27e43bae64cf99b5c
4
+ data.tar.gz: 7f28f10f9edb23e1f32a851c1e94b4cbcdb89c63
5
5
  SHA512:
6
- metadata.gz: 75f2630d907c0303a7a72a9090d1d4306d446e4d2a33d757ecba8fc3d4947a51e755688f595d4d55d32b335ccc593d3606bcbf3f700aa0cf20a548614e3ab815
7
- data.tar.gz: 85db810a1df5e53b924b41dc3141322d8c49b67d71e28258ff82532781c1c25ca9451776886b25d7986ae57445b5107db04ef63a40358eebb088f88b2368fadb
6
+ metadata.gz: d1a776c397011e888583f85ddfc12d2e77660b444e835bb10c42eec1ca096347be07a96b368f680f8358f5b9c15c5e079c6e46eccc5916c34e22367b69aafea3
7
+ data.tar.gz: 875faa02c872d739780d9ff09d14b874fa06a427826cfc4563ca1a4cf2a2f6a125f4dcac561da9d5ca10f6205be8f08099e8d6d915b4feeb36dd5defeb40743e
@@ -1,4 +1,4 @@
1
- #= require bootstrap-wysihtml5/b3
1
+ #= require bootstrap-wysihtml5
2
2
  #= require brightcontent/wysithtml5-parser-rules
3
3
  #= require bootstrap-wysihtml5/locales/nl-NL
4
4
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  *= require bootstrap
3
- *= require bootstrap-wysihtml5/b3
3
+ *= require bootstrap-wysihtml5
4
4
  *= require brightcontent/signin
5
5
  */
6
6
 
@@ -16,7 +16,7 @@ module Brightcontent
16
16
  end
17
17
 
18
18
  def current_user
19
- @current_user ||= AdminUser.find(session[:brightcontent_user_id]) if session[:brightcontent_user_id]
19
+ @current_user ||= Brightcontent.user_model.find(session[:brightcontent_user_id]) if session[:brightcontent_user_id]
20
20
  end
21
21
  helper_method :current_user
22
22
 
@@ -6,7 +6,7 @@ module Brightcontent
6
6
  end
7
7
 
8
8
  def create
9
- user = AdminUser.find_by_email(params[:email])
9
+ user = Brightcontent.user_model.find_by_email(params[:email])
10
10
  if user && user.authenticate(params[:password])
11
11
  session[:brightcontent_user_id] = user.id
12
12
  redirect_to root_url
@@ -2,5 +2,6 @@ module Brightcontent
2
2
  class AdminUser < ActiveRecord::Base
3
3
  has_secure_password
4
4
  validates_uniqueness_of :email
5
+ attr_accessible *column_names if defined? ProtectedAttributes
5
6
  end
6
7
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  <% if user_resources.extra_menu? %>
4
4
  <li class="dropdown">
5
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Extra <b class="caret"></b></a>
5
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= t('brightcontent.extra_menu') %> <b class="caret"></b></a>
6
6
  <ul class="dropdown-menu">
7
7
  <%= render user_resources.extra_menu %>
8
8
  </ul>
@@ -1,6 +1,8 @@
1
- <% if item.send(field).present? %>
2
- <div class="controls file-preview">
3
- <%= image_tag item.send(field).url(item.send(field).styles.keys.first) %>
1
+ <%= form.input field %>
2
+ <% if item.send(field).present? && item.send(field).content_type =~ /^image\// %>
3
+ <div class="form-group file-preview">
4
+ <div class="col-sm-offset-2 col-sm-10">
5
+ <%= image_tag item.send(field).url(item.send(field).styles.keys.first) %>
6
+ </div>
4
7
  </div>
5
8
  <% end %>
6
- <%= form.input field %>
@@ -18,9 +18,9 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency "rails", ">= 4.0.0"
19
19
  s.add_dependency "bcrypt-ruby"
20
20
  s.add_dependency "bootstrap-sass", "~> 3.1"
21
- s.add_dependency "bootstrap-wysihtml5-rails"
21
+ s.add_dependency "bootstrap-wysihtml5-rails", "~> 0.3.2"
22
22
  s.add_dependency "coffee-rails"
23
- s.add_dependency "inherited_resources", ">= 1.4.1"
23
+ s.add_dependency "inherited_resources", "~> 1.4.1"
24
24
  s.add_dependency "jquery-rails"
25
25
  s.add_dependency "sass-rails", ">= 4.0.2"
26
26
  s.add_dependency "simple_form"
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
30
30
 
31
31
  s.add_development_dependency "rake"
32
32
  s.add_development_dependency "sqlite3"
33
- s.add_development_dependency "rspec"
33
+ s.add_development_dependency "rspec", "~> 2.14.1"
34
34
  s.add_development_dependency "rspec-rails"
35
35
  s.add_development_dependency "capybara"
36
36
  s.add_development_dependency "launchy"
@@ -20,6 +20,7 @@ en:
20
20
  hidden: Hidden
21
21
  sign_in: Please sign in
22
22
  editor_locale: ""
23
+ extra_menu: More
23
24
 
24
25
  activerecord:
25
26
  models:
@@ -20,6 +20,7 @@ nl:
20
20
  hidden: Verborgen
21
21
  sign_in: Inloggen
22
22
  editor_locale: "nl-NL"
23
+ extra_menu: Meer
23
24
 
24
25
  activerecord:
25
26
  models:
@@ -12,10 +12,7 @@ require "brightcontent/rails/routes"
12
12
  require "brightcontent/engine"
13
13
 
14
14
  module Brightcontent
15
- autoload :DefaultActions, 'brightcontent/default_actions'
16
15
  autoload :ModelExtensions, 'brightcontent/model_extensions'
17
- autoload :PageMethods, 'brightcontent/page_methods'
18
- autoload :Pagination, 'brightcontent/pagination'
19
16
  autoload :Resource, 'brightcontent/resource'
20
17
  autoload :Resources, 'brightcontent/resources'
21
18
  autoload :RoutesParser, 'brightcontent/routes_parser'
@@ -37,6 +34,12 @@ module Brightcontent
37
34
  mattr_accessor :application_name
38
35
  @@application_name = "Brightcontent"
39
36
 
37
+ mattr_writer :user_model
38
+ def self.user_model
39
+ @@user_model.is_a?(String) ? @@user_model.constantize : @@user_model
40
+ end
41
+ @@user_model = "Brightcontent::AdminUser"
42
+
40
43
  mattr_accessor :main_menu_count
41
44
  @@main_menu_count = 6
42
45
 
@@ -4,11 +4,15 @@ module Brightcontent
4
4
 
5
5
  module ClassMethods
6
6
  def brightcontent_columns
7
- @brightcontent_columns ||= column_names.dup
7
+ (column_names + added_brightcontent_columns).uniq
8
8
  end
9
9
 
10
10
  def add_brightcontent_column(column_name)
11
- brightcontent_columns.append(column_name.to_s)
11
+ added_brightcontent_columns << column_name.to_s
12
+ end
13
+
14
+ def added_brightcontent_columns
15
+ @_added_brightcontent_columns ||= []
12
16
  end
13
17
  end
14
18
  end
@@ -10,11 +10,17 @@ Brightcontent.setup do |config|
10
10
  # config.locale = "nl"
11
11
 
12
12
  # Set the amount of menu items which are shown directly in the top bar.
13
- # If there are more resources than this number, the remaining will be
13
+ # If there are more resources than this number, the remaining will be
14
14
  # accumulated in a drop down menu.
15
15
  # config.main_menu_count = 6
16
16
 
17
17
  # The attachments model only allows images and pdf documents by default.
18
18
  # Set to empty array to disable.
19
19
  # config.attachment_content_types = [/\Aimage/, "application/pdf"]
20
+
21
+ # Brightcontent provides its own user model: AdminUser. This is used by
22
+ # default. You can specify a custom user model as string or class.
23
+ # It has to implement an authenticate method.
24
+ # config.user_model = "Brightcontent::AdminUser"
25
+
20
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightcontent-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Developers at Brightin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-19 00:00:00.000000000 Z
11
+ date: 2014-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: bootstrap-wysihtml5-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.3.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.3.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coffee-rails
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,14 +84,14 @@ dependencies:
84
84
  name: inherited_resources
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 1.4.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.4.1
97
97
  - !ruby/object:Gem::Dependency
@@ -210,16 +210,16 @@ dependencies:
210
210
  name: rspec
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: 2.14.1
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 2.14.1
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: rspec-rails
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -391,7 +391,6 @@ files:
391
391
  - spec/dummy/db/migrate/20130720211920_create_comments.rb
392
392
  - spec/dummy/db/migrate/20140512085432_add_author_id_to_blogs.rb
393
393
  - spec/dummy/db/migrate/20140512090832_create_authors.rb
394
- - spec/dummy/db/schema.rb
395
394
  - spec/dummy/lib/assets/.gitkeep
396
395
  - spec/dummy/public/404.html
397
396
  - spec/dummy/public/422.html
@@ -480,7 +479,6 @@ test_files:
480
479
  - spec/dummy/db/migrate/20130720211920_create_comments.rb
481
480
  - spec/dummy/db/migrate/20140512085432_add_author_id_to_blogs.rb
482
481
  - spec/dummy/db/migrate/20140512090832_create_authors.rb
483
- - spec/dummy/db/schema.rb
484
482
  - spec/dummy/lib/assets/.gitkeep
485
483
  - spec/dummy/public/404.html
486
484
  - spec/dummy/public/422.html
@@ -1,47 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20140512090832) do
15
-
16
- create_table "authors", force: true do |t|
17
- t.string "name"
18
- t.datetime "created_at"
19
- t.datetime "updated_at"
20
- end
21
-
22
- create_table "blogs", force: true do |t|
23
- t.string "name"
24
- t.text "body"
25
- t.datetime "created_at"
26
- t.datetime "updated_at"
27
- t.boolean "featured"
28
- t.integer "author_id"
29
- end
30
-
31
- create_table "brightcontent_admin_users", force: true do |t|
32
- t.string "email"
33
- t.string "password_digest"
34
- t.datetime "created_at"
35
- t.datetime "updated_at"
36
- end
37
-
38
- create_table "comments", force: true do |t|
39
- t.text "text"
40
- t.integer "blog_id"
41
- t.datetime "created_at"
42
- t.datetime "updated_at"
43
- end
44
-
45
- add_index "comments", ["blog_id"], name: "index_comments_on_blog_id"
46
-
47
- end