orange 0.3.0 → 0.3.1
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.
@@ -1,7 +1,7 @@
|
|
1
1
|
- if model
|
2
2
|
%tr
|
3
3
|
- for prop in props
|
4
|
-
%td= model.attribute_get(prop[:name])
|
4
|
+
%td= model.attribute_get(prop[:name]).to_s[0..150]
|
5
5
|
%td.actions
|
6
6
|
= form_link('Delete', route_to(model_name, model.id, 'delete'), 'Are you sure you want to delete this?', {:method => 'delete'})
|
7
7
|
%a{:href => route_to(model_name, model.id, 'edit')} Edit
|
@@ -6,6 +6,7 @@ class OrangeRoute < Orange::SiteCarton
|
|
6
6
|
admin do
|
7
7
|
text :slug, :display_name => "Search Engine Friendly Page URL"
|
8
8
|
text :link_text
|
9
|
+
text :reroute_to, :length => 255
|
9
10
|
boolean :show_in_nav, :default => false, :display_name => 'Show in Navigation?'
|
10
11
|
end
|
11
12
|
orange do
|
@@ -25,6 +25,7 @@ module Orange
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def route(packet)
|
28
|
+
return packet.reroute(packet['route.reroute']) if packet['route.reroute']
|
28
29
|
resource = packet['route.resource']
|
29
30
|
raise 'resource not found' unless orange.loaded? resource
|
30
31
|
unless (packet['route.resource_action'])
|
@@ -56,6 +57,8 @@ module Orange
|
|
56
57
|
def route?(packet, path)
|
57
58
|
extras, matched = find_route_info(packet, path)
|
58
59
|
return false if(extras.length > 0 && !matched.accept_args)
|
60
|
+
return false if matched.resource.blank? && matched.reroute_to.blank?
|
61
|
+
packet['route.reroute'] = matched.reroute_to unless matched.reroute_to.blank?
|
59
62
|
packet['route.path'] = path
|
60
63
|
packet['route.route'] = matched
|
61
64
|
packet['route.resource'] = matched.resource.to_sym unless matched.resource.blank?
|