sunrise-cms 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/sunrise/manage.js.coffee +0 -4
- data/app/assets/stylesheets/sunrise/main.css +2 -2
- data/lib/sunrise/models/asset.rb +6 -3
- data/lib/sunrise/version.rb +1 -1
- data/spec/dummy/app/views/layouts/application.html.erb +14 -8
- data/spec/dummy/config/database.yml +3 -3
- data/spec/dummy/config/database.yml.sample +34 -0
- data/spec/dummy/config/initializers/sunrise.rb +46 -10
- metadata +4 -2
@@ -156,8 +156,6 @@ class Sunrise
|
|
156
156
|
new_id = new Date().getTime();
|
157
157
|
regexp = new RegExp("new_" + method, "g")
|
158
158
|
|
159
|
-
console.log link
|
160
|
-
|
161
159
|
$(link).parents("div.nested_bottom").before(content.replace(regexp, new_id))
|
162
160
|
|
163
161
|
remove_fields: (link) ->
|
@@ -166,8 +164,6 @@ class Sunrise
|
|
166
164
|
if hidden_field.length isnt 0
|
167
165
|
hidden_field.val('1')
|
168
166
|
|
169
|
-
console.log link
|
170
|
-
|
171
167
|
$(link).closest("div.nested_item").hide()
|
172
168
|
|
173
169
|
$(document).ready ->
|
@@ -832,7 +832,7 @@ a.close-but:hover {
|
|
832
832
|
box-shadow: none;
|
833
833
|
background-position: center -28px !important;
|
834
834
|
}
|
835
|
-
.tabs-holder .tabs-item span {
|
835
|
+
.tabs-holder .tabs-item span.tt-done {
|
836
836
|
display: block;
|
837
837
|
overflow: hidden;
|
838
838
|
height: 28px;
|
@@ -1368,7 +1368,7 @@ a.close-but:hover {
|
|
1368
1368
|
color: #8e2a96;
|
1369
1369
|
}
|
1370
1370
|
|
1371
|
-
.tabs-holder .tabs-item span {
|
1371
|
+
.post-edit-holder .tabs-holder .tabs-item span {
|
1372
1372
|
color: #616161;
|
1373
1373
|
padding: 6px 10px 0 10px;
|
1374
1374
|
height: 22px;
|
data/lib/sunrise/models/asset.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'rails-uploader'
|
3
2
|
|
4
3
|
module Sunrise
|
@@ -99,9 +98,13 @@ module Sunrise
|
|
99
98
|
@rotate_degrees_changed === true
|
100
99
|
end
|
101
100
|
|
101
|
+
def uploader_user(request)
|
102
|
+
request.env['warden'].user
|
103
|
+
end
|
104
|
+
|
102
105
|
def uploader_create(params, request = nil)
|
103
106
|
if uploader_can?(:create, request)
|
104
|
-
self.
|
107
|
+
self.user_id = uploader_user(request).try(:id)
|
105
108
|
params[:assetable_type] = "Noname" if params[:assetable_type].blank?
|
106
109
|
params[:assetable_id] = 0 if params[:assetable_id].blank?
|
107
110
|
super
|
@@ -119,7 +122,7 @@ module Sunrise
|
|
119
122
|
end
|
120
123
|
|
121
124
|
def uploader_can?(action, request)
|
122
|
-
ability = ::Ability.new(request
|
125
|
+
ability = ::Ability.new(uploader_user(request))
|
123
126
|
ability.can? action.to_sym, self
|
124
127
|
end
|
125
128
|
|
data/lib/sunrise/version.rb
CHANGED
@@ -1,14 +1,20 @@
|
|
1
|
-
<!DOCTYPE
|
2
|
-
<html>
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
3
|
<head>
|
4
|
-
<
|
5
|
-
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<%= csrf_meta_tag %>
|
6
|
+
<%= raw(render_meta_tags(@structure)) %>
|
7
|
+
<title><%= render_page_title(@structure) %></title>
|
8
|
+
<%= stylesheet_link_tag "application" %>
|
6
9
|
<%= javascript_include_tag "application" %>
|
7
|
-
<%=
|
10
|
+
<%= yield(:head) %>
|
8
11
|
</head>
|
9
12
|
<body>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
+
|
14
|
+
<div class='content'>
|
15
|
+
<%= yield %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<%= yield(:footer) %>
|
13
19
|
</body>
|
14
20
|
</html>
|
@@ -16,7 +16,7 @@ development:
|
|
16
16
|
pool: 5
|
17
17
|
username: root
|
18
18
|
password:
|
19
|
-
socket: /
|
19
|
+
socket: /tmp/mysql.sock
|
20
20
|
|
21
21
|
# Warning: The database defined as "test" will be erased and
|
22
22
|
# re-generated from your development database when you run "rake".
|
@@ -29,7 +29,7 @@ test:
|
|
29
29
|
pool: 5
|
30
30
|
username: root
|
31
31
|
password:
|
32
|
-
socket: /
|
32
|
+
socket: /tmp/mysql.sock
|
33
33
|
|
34
34
|
production:
|
35
35
|
adapter: mysql2
|
@@ -39,4 +39,4 @@ production:
|
|
39
39
|
pool: 5
|
40
40
|
username: root
|
41
41
|
password:
|
42
|
-
socket: /
|
42
|
+
socket: /tmp/mysql.sock
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# And be sure to use new-style password hashing:
|
2
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
3
|
+
development:
|
4
|
+
adapter: mysql2
|
5
|
+
encoding: utf8
|
6
|
+
reconnect: false
|
7
|
+
database: dummy
|
8
|
+
pool: 5
|
9
|
+
username: root
|
10
|
+
password:
|
11
|
+
socket: /var/run/mysqld/mysqld.sock
|
12
|
+
|
13
|
+
# Warning: The database defined as "test" will be erased and
|
14
|
+
# re-generated from your development database when you run "rake".
|
15
|
+
# Do not set this db to the same as development or production.
|
16
|
+
test:
|
17
|
+
adapter: mysql2
|
18
|
+
encoding: utf8
|
19
|
+
reconnect: false
|
20
|
+
database: dummy_test
|
21
|
+
pool: 5
|
22
|
+
username: root
|
23
|
+
password:
|
24
|
+
socket: /var/run/mysqld/mysqld.sock
|
25
|
+
|
26
|
+
production:
|
27
|
+
adapter: mysql2
|
28
|
+
encoding: utf8
|
29
|
+
reconnect: true
|
30
|
+
database: dummy
|
31
|
+
pool: 5
|
32
|
+
username: root
|
33
|
+
password:
|
34
|
+
socket: /var/run/mysqld/mysqld.sock
|
@@ -1,15 +1,51 @@
|
|
1
|
+
require 'meta_manager/orm/active_record'
|
2
|
+
require 'page_parts/orm/active_record'
|
3
|
+
|
1
4
|
# Use this hook to configure sunrise
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
Sunrise.setup do |config|
|
6
|
+
# Paginate records per page (default: 25)
|
7
|
+
# config.default_items_per_page = 25
|
8
|
+
|
9
|
+
# Display audits events on dashboard (default: 50)
|
10
|
+
# config.activities_per_page = 50
|
11
|
+
|
12
|
+
# By default show latest first (default: :desc)
|
13
|
+
# config.default_sort_mode = :desc
|
14
|
+
|
15
|
+
# The display for a model instance (i.e. a single database record).
|
16
|
+
# config.label_methods = [:title, :name]
|
17
|
+
|
18
|
+
# Defailt list template view (default: "thumbs")
|
19
|
+
# config.default_list_view = "thumbs"
|
20
|
+
|
21
|
+
# Avariable lists views (default: [:list, :thumbs, :table])
|
22
|
+
# config.available_list_view = [:list, :thumbs, :table]
|
23
|
+
|
24
|
+
# Defailt list template view (default: "sort_order")
|
25
|
+
# config.sort_column = "sort_order"
|
26
|
+
|
27
|
+
# Find template before rendering (default: true)
|
28
|
+
# config.scoped_views = true
|
29
|
+
|
30
|
+
# Set available locales in app (default: [])
|
31
|
+
# config.available_locales = []
|
32
|
+
|
33
|
+
# Set transliteration for babosa gem
|
34
|
+
# more info here: https://github.com/norman/babosa (default: :russian)
|
35
|
+
# config.transliteration = :russian
|
36
|
+
|
37
|
+
# Set list toolbar buttons (default: [:delete, :edit, :new, :sort, :export])
|
38
|
+
# config.default_toolbar_buttons = [:delete, :edit, :new, :sort, :export]
|
39
|
+
|
40
|
+
# Lists the formats that should be treated as navigational (default: [:html, :json])
|
41
|
+
# config.navigational_formats = [:html, :json]
|
7
42
|
end
|
8
43
|
|
9
|
-
|
10
|
-
|
11
|
-
Settings.defaults[:some_setting2] = "value2"
|
44
|
+
PublicActivity::Config.set do
|
45
|
+
orm :active_record
|
12
46
|
end
|
13
47
|
|
14
|
-
|
15
|
-
|
48
|
+
#if Settings.table_exists?
|
49
|
+
# Settings.defaults[:some_setting] = "value"
|
50
|
+
# Settings.defaults[:some_setting2] = "value2"
|
51
|
+
#end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunrise-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-05-
|
13
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -808,6 +808,7 @@ files:
|
|
808
808
|
- spec/dummy/config/routes.rb
|
809
809
|
- spec/dummy/config/application.rb
|
810
810
|
- spec/dummy/config/locales/en.yml
|
811
|
+
- spec/dummy/config/database.yml.sample
|
811
812
|
- spec/dummy/config/environment.rb
|
812
813
|
- spec/dummy/config/boot.rb
|
813
814
|
- spec/dummy/config/environments/production.rb
|
@@ -1031,6 +1032,7 @@ test_files:
|
|
1031
1032
|
- spec/dummy/config/routes.rb
|
1032
1033
|
- spec/dummy/config/application.rb
|
1033
1034
|
- spec/dummy/config/locales/en.yml
|
1035
|
+
- spec/dummy/config/database.yml.sample
|
1034
1036
|
- spec/dummy/config/environment.rb
|
1035
1037
|
- spec/dummy/config/boot.rb
|
1036
1038
|
- spec/dummy/config/environments/production.rb
|