orange 0.3.3 → 0.3.4
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.
@@ -43,7 +43,7 @@ module Orange::Middleware
|
|
43
43
|
site = packet['user'].orange_sites.first
|
44
44
|
if site.class.to_s == "OrangeSubsite"
|
45
45
|
subsite = orange[:sitemap].url_for(packet, {:resource => 'subsites', :resource_id => site.id})
|
46
|
-
packet.reroute("/admin#{subsite}
|
46
|
+
packet.reroute("/admin#{subsite}#{packet['route.path'].gsub(/^\//, '')}")
|
47
47
|
end
|
48
48
|
end
|
49
49
|
packet.flash['user.after_login'] = packet.request.path
|
@@ -40,7 +40,7 @@ module Orange
|
|
40
40
|
def latest(packet, opts = {})
|
41
41
|
limit = packet['news.latest_news_limit', 3]
|
42
42
|
do_list_view(packet, :latest, {
|
43
|
-
:list => model_class.all(:order => :
|
43
|
+
:list => model_class.all(:order => :updated_at.desc, :limit => limit)
|
44
44
|
})
|
45
45
|
end
|
46
46
|
|
@@ -49,7 +49,7 @@ module Orange
|
|
49
49
|
opts.merge!( :archive_url => archive_url(packet))
|
50
50
|
opts[:page] = opts[:page].blank? ? 1 : opts[:page].to_i
|
51
51
|
page = opts[:page].blank? ? 0 : opts[:page] - 1
|
52
|
-
opts[:list] = model_class.all(:order => :
|
52
|
+
opts[:list] = model_class.all(:order => [:updated_at.desc],
|
53
53
|
:limit => 5,
|
54
54
|
:offset => (5*page)
|
55
55
|
)
|
@@ -20,12 +20,16 @@ module Orange
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def view(packet, *args)
|
24
|
+
mode = packet['route.resource_action']
|
25
|
+
do_view(packet, mode, args.extract_options!)
|
26
|
+
end
|
23
27
|
|
24
28
|
def method_missing(mode, *args)
|
25
29
|
packet = args.first if args.first.kind_of? Orange::Packet
|
26
30
|
opts = args.extract_options!
|
27
31
|
opts[:resource_name] = 'slices'
|
28
|
-
|
32
|
+
do_view(packet, mode, opts)
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|