orange 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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}sitemap")
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 => :created_at.desc, :limit => limit)
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 => :created_at.desc,
52
+ opts[:list] = model_class.all(:order => [:updated_at.desc],
53
53
  :limit => 5,
54
54
  :offset => (5*page)
55
55
  )
@@ -1,5 +1,5 @@
1
1
  .news_items
2
- - list.each do |news|
2
+ - for news in list
3
3
  .news_item
4
4
  %h2.news_title
5
5
  %a{:href => news.link} #{news.title}
@@ -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
- orange[:parser].haml("#{mode.to_s}.haml", packet, opts)
32
+ do_view(packet, mode, opts)
29
33
  end
30
34
  end
31
35
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 3
9
- version: 0.3.3
8
+ - 4
9
+ version: 0.3.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Haslem