zena 1.2.4 → 1.2.5
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/History.txt +18 -0
- data/app/controllers/nodes_controller.rb +11 -6
- data/app/controllers/sites_controller.rb +3 -2
- data/app/controllers/user_sessions_controller.rb +1 -1
- data/app/controllers/virtual_classes_controller.rb +3 -2
- data/app/models/document.rb +2 -2
- data/app/models/node.rb +6 -1
- data/app/models/note.rb +3 -27
- data/app/models/role.rb +11 -5
- data/app/models/site.rb +140 -43
- data/app/models/string_hash.rb +2 -0
- data/app/models/user.rb +9 -4
- data/app/models/user_session.rb +1 -1
- data/app/models/virtual_class.rb +49 -18
- data/app/views/sites/_form.erb +7 -4
- data/app/views/sites/_li.erb +15 -9
- data/app/views/users/_li.rhtml +3 -0
- data/app/views/users/index.rhtml +1 -1
- data/app/views/virtual_classes/_form.erb +1 -1
- data/bricks/acls/zena/init.rb +1 -2
- data/bricks/acls/zena/test/sites/erebus/roles.yml +4 -0
- data/bricks/activity/lib/bricks/activity.rb +24 -0
- data/bricks/activity/zena/migrate/20130711135905_add_activity_to_user.rb +9 -0
- data/bricks/activity/zena/test/integration/activity_integration_test.rb +29 -0
- data/bricks/captcha/zena/init.rb +0 -3
- data/bricks/fs_skin/lib/bricks/fs_skin.rb +3 -3
- data/bricks/fs_skin/zena/skins/blog/Node.zafu +1 -1
- data/bricks/fs_skin/zena/tasks.rb +2 -2
- data/bricks/fs_skin/zena/test/integration/fs_skin_integration_test.rb +2 -2
- data/bricks/fs_skin/zena/test/unit/fs_skin_test.rb +1 -1
- data/bricks/math/zena/init.rb +0 -3
- data/bricks/pdf/zena/init.rb +1 -5
- data/bricks/worker/zena/init.rb +0 -2
- data/bricks/zena/zena/migrate/20130617164527_add_master_id_to_site.rb +13 -0
- data/bricks/zena/zena/migrate/20130712081512_alter_login_users.rb +9 -0
- data/config/bricks.yml +4 -1
- data/lib/bricks/loader.rb +17 -9
- data/lib/tasks/zena.rake +40 -5
- data/lib/zafu/process/ruby_less_processing.rb +3 -5
- data/lib/zena.rb +2 -0
- data/lib/zena/acts/secure.rb +11 -2
- data/lib/zena/console.rb +5 -4
- data/lib/zena/core_ext/string.rb +2 -2
- data/lib/zena/deploy.rb +22 -6
- data/lib/zena/deploy/logrotate_app.rhtml +10 -7
- data/lib/zena/deploy/logrotate_host.rhtml +21 -26
- data/lib/zena/deploy/vhost.rhtml +3 -3
- data/lib/zena/foxy_parser.rb +1 -1
- data/lib/zena/info.rb +1 -1
- data/lib/zena/site_worker.rb +2 -2
- data/lib/zena/use.rb +0 -1
- data/lib/zena/use/ancestry.rb +1 -1
- data/lib/zena/use/authlogic.rb +2 -1
- data/lib/zena/use/display.rb +6 -0
- data/lib/zena/use/query_builder.rb +1 -1
- data/lib/zena/use/query_node.rb +3 -3
- data/lib/zena/use/rendering.rb +47 -13
- data/lib/zena/use/test_helper.rb +1 -1
- data/lib/zena/use/urls.rb +6 -104
- data/lib/zena/use/zafu_safe_definitions.rb +9 -4
- data/lib/zena/use/zafu_templates.rb +1 -0
- data/locale/app.pot +4 -0
- data/locale/de/LC_MESSAGES/zena.mo +0 -0
- data/locale/de/zena.po +6 -2
- data/locale/en/LC_MESSAGES/zena.mo +0 -0
- data/locale/en/zena.po +6 -2
- data/locale/fr/LC_MESSAGES/zena.mo +0 -0
- data/locale/fr/zena.po +5 -1
- data/locale/it/LC_MESSAGES/zena.mo +0 -0
- data/locale/it/zena.po +6 -2
- data/locale/zena.pot +4 -0
- data/test/functional/nodes_controller_test.rb +2 -133
- data/test/functional/sites_controller_test.rb +1 -1
- data/test/integration/multiple_hosts_test.rb +2 -1
- data/test/integration/navigation_test.rb +37 -0
- data/test/integration/query_node/basic.yml +1 -1
- data/test/integration/zafu_compiler/ajax.yml +7 -0
- data/test/integration/zafu_compiler/comments.yml +2 -2
- data/test/integration/zafu_compiler/context.yml +6 -2
- data/test/integration/zafu_compiler/display.yml +16 -4
- data/test/integration/zafu_compiler/forms.yml +1 -0
- data/test/integration/zafu_compiler/query.yml +7 -1
- data/test/integration/zafu_compiler/relations.yml +12 -7
- data/test/integration/zafu_compiler/roles.yml +3 -3
- data/test/integration/zafu_compiler/rubyless.yml +1 -2
- data/test/integration/zafu_compiler/safe_definitions.yml +5 -0
- data/test/sites/complex/roles.yml +1 -1
- data/test/sites/ocean/roles.yml +4 -0
- data/test/sites/zena/columns.yml +3 -1
- data/test/sites/zena/roles.yml +5 -1
- data/test/sites/zena/sites.yml +22 -0
- data/test/unit/document_test.rb +14 -0
- data/test/unit/node_test.rb +14 -0
- data/test/unit/role_test.rb +19 -4
- data/test/unit/site_test.rb +67 -0
- data/test/unit/user_test.rb +20 -0
- data/test/unit/virtual_class_test.rb +116 -11
- data/test/unit/zena/use/rendering_test.rb +1 -1
- data/zena.gemspec +67 -66
- metadata +126 -125
- data/bricks/fs_skin/zena/init.rb +0 -1
- data/bricks/grid/zena/init.rb +0 -4
- data/bricks/single/zena/init.rb +0 -1
- data/bricks/spreadsheet/zena/init.rb +0 -3
data/app/models/string_hash.rb
CHANGED
data/app/models/user.rb
CHANGED
|
@@ -64,9 +64,10 @@ class User < ActiveRecord::Base
|
|
|
64
64
|
include RubyLess
|
|
65
65
|
|
|
66
66
|
safe_attribute :login, :time_zone, :created_at, :updated_at, :lang, :id
|
|
67
|
-
safe_method :
|
|
67
|
+
safe_method :status => Number, :status_name => String,
|
|
68
68
|
:is_anon? => Boolean, :is_admin? => Boolean, :user? => Boolean, :commentator? => Boolean,
|
|
69
|
-
:moderated? => Boolean, :asset_host? => Boolean, [:in_group?, String] => Boolean
|
|
69
|
+
:moderated? => Boolean, :asset_host? => Boolean, [:in_group?, String] => Boolean,
|
|
70
|
+
:group_names => [String]
|
|
70
71
|
|
|
71
72
|
safe_context :node => node_user_proc,
|
|
72
73
|
:to_publish => ['Version'], :redactions => ['Version'], :proposed => ['Version'],
|
|
@@ -219,10 +220,14 @@ class User < ActiveRecord::Base
|
|
|
219
220
|
# This is set on the user during login.
|
|
220
221
|
alias asset_host? asset_host
|
|
221
222
|
|
|
222
|
-
def
|
|
223
|
+
def group_names
|
|
223
224
|
@group_names ||= begin
|
|
224
225
|
groups.all(:order=>'name').map(&:name)
|
|
225
|
-
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def in_group?(name)
|
|
230
|
+
group_names.include?(name)
|
|
226
231
|
end
|
|
227
232
|
|
|
228
233
|
# Return true if the user's status is high enough to start editing nodes.
|
data/app/models/user_session.rb
CHANGED
data/app/models/virtual_class.rb
CHANGED
|
@@ -146,14 +146,17 @@ class VirtualClass < Role
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
conditions[0] = conditions[0].join(' AND ')
|
|
149
|
-
|
|
149
|
+
|
|
150
|
+
seen_names = {}
|
|
150
151
|
Node.native_classes.each do |kpath, real_class|
|
|
152
|
+
seen_names[real_class.name] = true
|
|
151
153
|
load_roles_and_cache(build_vclass_from_real_class(real_class))
|
|
152
154
|
end
|
|
153
155
|
|
|
154
156
|
VirtualClass.all(
|
|
155
157
|
:conditions => conditions,
|
|
156
158
|
:order => 'kpath ASC').each do |vclass|
|
|
159
|
+
next if seen_names[vclass.name]
|
|
157
160
|
load_roles_and_cache(vclass)
|
|
158
161
|
end
|
|
159
162
|
|
|
@@ -184,15 +187,21 @@ class VirtualClass < Role
|
|
|
184
187
|
end
|
|
185
188
|
|
|
186
189
|
def build_vclass_from_real_class(real_class)
|
|
187
|
-
|
|
190
|
+
# Merge virtual class from db if it exists.
|
|
191
|
+
if vclass = VirtualClass.first(:conditions => {:name => real_class.name, :site_id => current_site.id})
|
|
192
|
+
# ...
|
|
193
|
+
else
|
|
194
|
+
vclass = VirtualClass.new(:name => real_class.name)
|
|
195
|
+
if real_class <= TextDocument
|
|
196
|
+
vclass.monolingual = true
|
|
197
|
+
end
|
|
198
|
+
end
|
|
188
199
|
vclass.kpath = real_class.kpath
|
|
189
200
|
vclass.real_class = real_class
|
|
190
201
|
vclass.include_role real_class.schema
|
|
191
202
|
vclass.instance_variable_set(:@is_real_class, true)
|
|
192
203
|
vclass.site_id = current_site.id
|
|
193
|
-
|
|
194
|
-
vclass.monolingual = true
|
|
195
|
-
end
|
|
204
|
+
|
|
196
205
|
vclass
|
|
197
206
|
end
|
|
198
207
|
|
|
@@ -405,19 +414,26 @@ class VirtualClass < Role
|
|
|
405
414
|
nil
|
|
406
415
|
end
|
|
407
416
|
end
|
|
417
|
+
|
|
418
|
+
def defined_in_db?
|
|
419
|
+
!id.blank?
|
|
420
|
+
end
|
|
408
421
|
|
|
409
422
|
# Return safe columns including super class's safe columns
|
|
410
423
|
def defined_safe_columns
|
|
411
|
-
@defined_safe_columns ||=
|
|
412
|
-
#
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
424
|
+
@defined_safe_columns ||= begin
|
|
425
|
+
# If we have
|
|
426
|
+
list = defined_in_db? ? super : []
|
|
427
|
+
if real_class?
|
|
428
|
+
# Get columns from the 'native' schema of the real class (this schema is a Property::Role,
|
|
429
|
+
# not a VirtualClass or ::Role).
|
|
430
|
+
#
|
|
431
|
+
# Only columns explicitly declared safe are safe here
|
|
432
|
+
list += real_class.schema.defined_columns.values.select do |col|
|
|
433
|
+
real_class.safe_method_type([col.name])
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
list.sort {|a,b| a.name <=> b.name}
|
|
421
437
|
end
|
|
422
438
|
end
|
|
423
439
|
|
|
@@ -553,6 +569,10 @@ class VirtualClass < Role
|
|
|
553
569
|
|
|
554
570
|
protected
|
|
555
571
|
def rebuild_kpath(superclass)
|
|
572
|
+
if self.name == self.real_class.name
|
|
573
|
+
return self[:kpath] = self.real_class.kpath
|
|
574
|
+
end
|
|
575
|
+
|
|
556
576
|
index = 0
|
|
557
577
|
kpath = nil
|
|
558
578
|
try_keys = "#{name}ABCDEFGHIJKLMNOPQRSTUCWXYZ1234567890"
|
|
@@ -588,14 +608,25 @@ class VirtualClass < Role
|
|
|
588
608
|
end
|
|
589
609
|
|
|
590
610
|
return if !errors.empty?
|
|
591
|
-
|
|
611
|
+
|
|
612
|
+
if native = Node.native_classes_by_name[name]
|
|
613
|
+
self[:real_class] = native.name
|
|
614
|
+
up = native.superclass
|
|
615
|
+
if up != ActiveRecord::Base
|
|
616
|
+
@superclass = VirtualClass[up.name]
|
|
617
|
+
else
|
|
618
|
+
# superclass of 'Node' virtual class is Node ruby class.
|
|
619
|
+
@superclass = Node
|
|
620
|
+
end
|
|
621
|
+
else
|
|
622
|
+
@superclass ||= self.superclass
|
|
623
|
+
self[:real_class] = get_real_class(@superclass)
|
|
624
|
+
end
|
|
592
625
|
|
|
593
626
|
if real_class? || name_changed? || @superclass != old.superclass
|
|
594
627
|
rebuild_kpath(@superclass)
|
|
595
628
|
end
|
|
596
629
|
|
|
597
|
-
self[:real_class] = get_real_class(@superclass)
|
|
598
|
-
|
|
599
630
|
unless (secure!(Group) { Group.find(self[:create_group_id]) } rescue nil)
|
|
600
631
|
errors.add('create_group_id', 'invalid group')
|
|
601
632
|
end
|
data/app/views/sites/_form.erb
CHANGED
|
@@ -14,21 +14,24 @@
|
|
|
14
14
|
<% end %>
|
|
15
15
|
<table cellspacing='0' class='edit_site'>
|
|
16
16
|
<tr><td class='label'><%= _('host') %></td><td><%= @site[:host] %></td></tr>
|
|
17
|
-
|
|
17
|
+
<tr><td class='label'><%= _('root') %></td><td><%= text_field('site', :root_zip, :size=>15, :value => @site.root_zip) %></td></tr>
|
|
18
|
+
<% Site.attributes_for_form(@site.is_alias?)[:text].each do |name| -%>
|
|
18
19
|
<tr><td class='label'><%= _(name) %></td><td><%= text_field('site', name, :size=>nil) %></td></tr>
|
|
19
20
|
<% end -%>
|
|
21
|
+
<% if !@site.is_alias? %>
|
|
20
22
|
<tr><td class='label'><%= _('redit_time') %></td><td><%= text_field('site', :redit_time, :size=>15, :value => @site.redit_time) %></td></tr>
|
|
21
23
|
<tr><td class='label'><%= _('public group') %></td><td><%= @site.public_group.name %></td></tr>
|
|
22
24
|
<tr><td class='label'><%= _('site group') %></td><td><%= @site.site_group.name %></td></tr>
|
|
23
25
|
<tr><td class='label'><%= _('API group') %></td><td><%= select('site', 'api_group_id', visitor.all_groups.map{|g| [g.name, g.id]}, {:include_blank => true, :selected => @site.api_group_id} ) %></td></tr>
|
|
24
|
-
|
|
26
|
+
<% end %>
|
|
27
|
+
|
|
25
28
|
<tr><td class='label'><%= _('options') %></td><td>
|
|
26
|
-
<% Site.attributes_for_form[:bool].each do |sym| -%>
|
|
29
|
+
<% Site.attributes_for_form(@site.is_alias?)[:bool].each do |sym| -%>
|
|
27
30
|
<input type='hidden' name='site[<%= sym %>]' value=''/>
|
|
28
31
|
<input type='checkbox' name='site[<%= sym %>]' value='1'<%= @site.send(sym) ? " checked='checked'" : '' %>/> <%= _(sym.to_s) %><br/>
|
|
29
32
|
<% end -%>
|
|
30
33
|
</td></tr>
|
|
31
|
-
<% if !@site.new_record? %>
|
|
34
|
+
<% if !@site.new_record? && !@site.is_alias? %>
|
|
32
35
|
<tr><td class='label'><%= _('action') %></td><td id='messages<%= @site[:id] %>'>
|
|
33
36
|
<ul>
|
|
34
37
|
<% Site::ACTIONS.each do |action| %>
|
data/app/views/sites/_li.erb
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<tr id='site<%= li[:id] %>'>
|
|
2
|
-
<td class='icon'><%= link_to_remote(_('site_img'),
|
|
2
|
+
<td class='icon'><%= link_to_remote(li.master_id ? _('alias_img') : _('site_img'),
|
|
3
3
|
:update =>"site#{li[:id]}",
|
|
4
4
|
:url => edit_site_path(li),
|
|
5
5
|
:method => :get) %></td>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
<td class="name"><%= li.host %></td>
|
|
7
|
+
<% if !li.master_id %>
|
|
8
|
+
<td class='root'><%= li.root_node.title.limit(10) %></td>
|
|
9
|
+
<% [:languages, :default_lang].each do |sym| -%>
|
|
10
|
+
<td class="<%= sym %>"><%= li[sym] %></td>
|
|
11
|
+
<% end -%>
|
|
12
|
+
<td class='public_group'><%= li.public_group.name %></td>
|
|
13
|
+
<td class='site_group' ><%= li.site_group.name %></td>
|
|
14
|
+
<td class='api_group' ><%= li.api_group ? li.api_group.name : _('no API') %></td>
|
|
15
|
+
<td class='redit_time' ><%= li.redit_time %></td>
|
|
16
|
+
<td class='options'><%= Site.attributes_for_form(li.is_alias?)[:bool].reject{|sym| !li.send(sym)}.join(', ') %></td>
|
|
17
|
+
<% else %>
|
|
18
|
+
<td colspan='8' class='root'><%= li.root_node.title %></td>
|
|
19
|
+
<% end -%>
|
|
14
20
|
</tr>
|
data/app/views/users/_li.rhtml
CHANGED
|
@@ -12,5 +12,8 @@ end %>
|
|
|
12
12
|
<td class="login"><%= li.is_anon? ? '<i>public</i>' : li.login %></td>
|
|
13
13
|
<td class="fullname" ><a href='<%= zen_path(li.node) %>'><%= li.node ? li.node.title : '' %></a></td>
|
|
14
14
|
<td class="login"><%= _(User::Num_to_status[li.status].to_s) %></td>
|
|
15
|
+
<% if Bricks::CONFIG['activity'] %>
|
|
16
|
+
<td class="seen_at"><%= format_date(li.seen_at, :format =>_(Zena::Use::Dates::DATETIME)) %></td>
|
|
17
|
+
<% end %>
|
|
15
18
|
<td class="groups"><%= li.groups.map {|g| g.name }.join(', ') %></td>
|
|
16
19
|
</tr>
|
data/app/views/users/index.rhtml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h2 class='title'><%= _('users') %></h2>
|
|
2
2
|
|
|
3
3
|
<table id='user_list' class='admin' cellspacing="0">
|
|
4
|
-
<tr><th class='nav' colspan='
|
|
4
|
+
<tr><th class='nav' colspan='6'><%= will_paginate @users %></th></tr>
|
|
5
5
|
<%= render :partial=>'users/li', :collection=>@users %>
|
|
6
6
|
<%= render :partial=>'users/add', :locals=>{:groups=>@groups} %>
|
|
7
7
|
</table>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<td class='label'><%= _('kpath') %></td>
|
|
29
29
|
<td><b><%= @virtual_class.kpath %></b></td>
|
|
30
30
|
</tr>
|
|
31
|
-
<tr><td class='label'><%= _('superclass')%></td><td><%= select('virtual_class', 'superclass', Node.classes_for_form(:without => ((@virtual_class.new_record? || @virtual_class.kind_of?(Role)) ? nil : @virtual_class.to_s)), :selected => @virtual_class.superclass.to_s ) %></td></tr>
|
|
31
|
+
<tr><td class='label'><%= _('superclass')%></td><td><%= select('virtual_class', 'superclass', ['']+Node.classes_for_form(:without => ((@virtual_class.new_record? || @virtual_class.kind_of?(Role)) ? nil : @virtual_class.to_s)), :selected => (@virtual_class.superclass.kind_of?(VirtualClass) ? @virtual_class.superclass.to_s : '') ) %></td></tr>
|
|
32
32
|
|
|
33
33
|
<% if @virtual_class.kind_of?(VirtualClass) -%>
|
|
34
34
|
<% Zena::Use::Fulltext::FULLTEXT_FIELDS.reverse_each do |fld| -%>
|
data/bricks/acls/zena/init.rb
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Site::CLEANUP_SQL.unshift ['acls', 'site_id = ?']
|
|
1
|
+
Site::CLEANUP_SQL.unshift ['acls', 'site_id = ?']
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Bricks
|
|
2
|
+
module Activity
|
|
3
|
+
module ControllerMethods
|
|
4
|
+
def self.included(base)
|
|
5
|
+
base.class_eval do
|
|
6
|
+
alias_method_chain :set_visitor, :activity
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def set_visitor_with_activity
|
|
11
|
+
set_visitor_without_activity
|
|
12
|
+
Zena::Db.set_attribute(visitor, 'seen_at', Time.now.utc)
|
|
13
|
+
end
|
|
14
|
+
end # ControllerMethods
|
|
15
|
+
|
|
16
|
+
module UserMethods
|
|
17
|
+
def self.included(base)
|
|
18
|
+
base.class_eval do
|
|
19
|
+
safe_method :seen_at => Time
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end # UserMethods
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../../test/test_helper'
|
|
2
|
+
|
|
3
|
+
class ActivityIntegrationTest < Zena::Integration::TestCase
|
|
4
|
+
|
|
5
|
+
context 'A visitor' do
|
|
6
|
+
setup do
|
|
7
|
+
$_test_site = 'test.host'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
context 'with normal access' do
|
|
11
|
+
setup do
|
|
12
|
+
post 'http://test.host/session', :login=>'ant', :password=>'ant'
|
|
13
|
+
assert_redirected_to 'http://test.host/oo'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
should 'not set seen_at on login' do
|
|
17
|
+
assert_equal nil, users(:ant).seen_at
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
should 'set seen_at on get' do
|
|
21
|
+
before = Time.now.utc.to_i
|
|
22
|
+
get 'http://test.host/oo'
|
|
23
|
+
after = Time.now.utc.to_i
|
|
24
|
+
seen_at = users(:ant).seen_at.to_i
|
|
25
|
+
assert (before <= seen_at) && (seen_at <= after)
|
|
26
|
+
end
|
|
27
|
+
end # with normal access
|
|
28
|
+
end # a visitor
|
|
29
|
+
end
|
data/bricks/captcha/zena/init.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Bricks
|
|
2
|
-
module
|
|
2
|
+
module FsSkin
|
|
3
3
|
ELEM = "([a-zA-Z_]+)"
|
|
4
4
|
ELEM_REGEXP = %r{^#{ELEM}$}
|
|
5
5
|
SECURE_PATH_REGEXP = %r{^[a-zA-Z_/\-\+]+$}
|
|
@@ -74,7 +74,7 @@ module Bricks
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# We move this method here so that we do not need to reference
|
|
77
|
-
# Bricks::
|
|
77
|
+
# Bricks::FsSkin in I18n when fs_skin brick is disabled.
|
|
78
78
|
def base.text_from_fs_skin(brick_name, skin_name, path, opts)
|
|
79
79
|
if path =~ SECURE_PATH_REGEXP
|
|
80
80
|
fullpath = "$#{brick_name}-#{skin_name}/#{path}"
|
|
@@ -186,5 +186,5 @@ module Bricks
|
|
|
186
186
|
end
|
|
187
187
|
end
|
|
188
188
|
end # SiteMethods
|
|
189
|
-
end #
|
|
189
|
+
end # FsSkin
|
|
190
190
|
end # Bricks
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<div style="clear: both;"> </div>
|
|
60
60
|
|
|
61
61
|
<div id="footer">
|
|
62
|
-
© Copyright <a href="#">
|
|
62
|
+
© Copyright <a href="#">FsSkin blog</a> | <r:zena type='made'/> | <r:login_link/>
|
|
63
63
|
</div>
|
|
64
64
|
</div>
|
|
65
65
|
</body>
|
|
@@ -9,11 +9,11 @@ namespace :fs_skin do
|
|
|
9
9
|
if ENV['HOST']
|
|
10
10
|
sites = [Site.find_by_host(ENV['HOST'])]
|
|
11
11
|
else
|
|
12
|
-
sites = Site.
|
|
12
|
+
sites = Site.master_sites
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
sites.each do |site|
|
|
16
|
-
|
|
16
|
+
setup_visitor(site.any_admin, site)
|
|
17
17
|
if ENV['WORKER'] == 'false' || RAILS_ENV == 'test'
|
|
18
18
|
# We avoid SiteWorker.
|
|
19
19
|
site.rebuild_fs_skin_index
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require File.dirname(__FILE__) + '/../../../../../test/test_helper'
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
class FsSkinIntegrationTest < Zena::Integration::TestCase
|
|
4
4
|
|
|
5
5
|
context 'A page using a fs_skin Skin' do
|
|
6
6
|
subject do
|
|
@@ -23,7 +23,7 @@ class Fs_skinIntegrationTest < Zena::Integration::TestCase
|
|
|
23
23
|
should 'use fs_skin template' do
|
|
24
24
|
get "http://test.host/en/blog#{subject.zip}.html"
|
|
25
25
|
assert_response :success
|
|
26
|
-
assert_match %r{Copyright <a href="#">
|
|
26
|
+
assert_match %r{Copyright <a href="#">FsSkin blog</a>}, response.body
|
|
27
27
|
end
|
|
28
28
|
end # with normal access
|
|
29
29
|
end # A page using a fs_skin Skin
|
data/bricks/math/zena/init.rb
CHANGED
data/bricks/pdf/zena/init.rb
CHANGED
data/bricks/worker/zena/init.rb
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class AddMasterIdToSite < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
add_column :sites, :master_id, :integer
|
|
4
|
+
# The id of the node without parent
|
|
5
|
+
add_column :sites, :orphan_id, :integer
|
|
6
|
+
execute "UPDATE sites SET orphan_id = root_id"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def self.down
|
|
10
|
+
remove_column :sites, :master_id
|
|
11
|
+
remove_column :sites, :orphan_id
|
|
12
|
+
end
|
|
13
|
+
end
|