Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 71
- Log:
Start of upgrade to Typo 4.0.0, the latest stable release since
2.6.0. Note test/mocks/themes/azure changes from a file to a
directory, so the file has been removed in this revision and
the directory will be added in the next revision.
- Author:
- adh
- Date:
- Mon Aug 07 22:18:11 +0100 2006
- Size:
- 2018 Bytes
1 | class Admin::FeedbackController < Admin::BaseController |
2 | def index |
3 | conditions = ["(contents.type = 'Comment' or contents.type = 'Trackback')"] |
4 | |
5 | if params[:search] |
6 | search_sql = "%#{params[:search]}%" |
7 | conditions.first << ' and (url like ? or author like ? or title like ? or ip like ? or email like ?)' |
8 | 5.times { conditions.push search_sql } |
9 | end |
10 | |
11 | if params[:published] == 'f' |
12 | conditions.first << ' and (published = ?)' |
13 | conditions.push false |
14 | end |
15 | |
16 | @pages, @feedback = paginate(:contents, |
17 | :order => 'contents.created_at desc', |
18 | :conditions => conditions, |
19 | :per_page => 40) |
20 | |
21 | render_action 'list' |
22 | end |
23 | |
24 | def delete |
25 | if request.post? |
26 | feedback = Content.find(params[:id]) |
27 | if feedback.kind_of? Comment or feedback.kind_of? Trackback |
28 | feedback.destroy |
29 | flash[:notice] = "Deleted" |
30 | else |
31 | flash[:notice] = "Not found" |
32 | end |
33 | end |
34 | redirect_to :action => 'index', :page => params[:page], :search => params[:search] |
35 | end |
36 | |
37 | def bulkops |
38 | STDERR.puts "Bulkops: #{params.inspect}" |
39 | |
40 | ids = (params[:feedback_check]||{}).keys.map(&:to_i) |
41 | |
42 | case params[:commit] |
43 | when 'Delete Checked Items' |
44 | count = 0 |
45 | ids.each do |id| |
46 | count += Content.delete(id) |
47 | end |
48 | flash[:notice] = "Deleted #{count} item(s)" |
49 | when 'Publish Checked Items' |
50 | ids.each do |id| |
51 | feedback = Content.find(id) |
52 | feedback.attributes[:published] = true |
53 | feedback.set_spam(false) |
54 | feedback.save |
55 | end |
56 | flash[:notice]= "Published #{ids.size} item(s)" |
57 | when 'Unpublish Checked Items' |
58 | ids.each do |id| |
59 | feedback = Content.find(id) |
60 | feedback.withdraw! |
61 | feedback.set_spam(true) |
62 | feedback.save |
63 | end |
64 | flash[:notice]= "Unpublished #{ids.size} item(s)" |
65 | else |
66 | flash[:notice] = "Not implemented" |
67 | end |
68 | |
69 | redirect_to :action => 'index', :page => params[:page], :search => params[:search] |
70 | end |
71 | end |