orange 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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?
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Haslem