Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 2356 Bytes
1 | require 'comment' |
2 | require 'trackback' |
3 | |
4 | class Admin::FeedbackController < Admin::BaseController |
5 | |
6 | def index |
7 | conditions = ['blog_id = :blog_id', {:blog_id => Blog.default.id}] |
8 | |
9 | if params[:search] |
10 | conditions.first << ' and (url like :pattern or author like :pattern or title like :pattern or ip like :pattern or email like :pattern)' |
11 | conditions.last.merge!(:pattern => "%#{params[:search]}%") |
12 | end |
13 | |
14 | if params[:published] == 'f' |
15 | conditions.first << ' and (published = :published)' |
16 | conditions.last.merge!(:published => false) |
17 | end |
18 | |
19 | if params[:confirmed] == 'f' |
20 | conditions.first << ' AND (status_confirmed = :status_confirmed)' |
21 | conditions.last.merge!(:status_confirmed => false) |
22 | end |
23 | |
24 | @pages, @feedback = paginate(:feedback, |
25 | :order => 'feedback.created_at desc', |
26 | :conditions => conditions, |
27 | :per_page => 40) |
28 | |
29 | render_action 'list' |
30 | end |
31 | |
32 | def delete |
33 | if request.post? |
34 | begin |
35 | Feedback.destroy(params[:id]) |
36 | flash[:notice] = "Deleted" |
37 | rescue ActiveRecord::RecordNotFound |
38 | flash[:notice] = "Not found" |
39 | end |
40 | end |
41 | redirect_to :action => 'index', :page => params[:page], :search => params[:search] |
42 | end |
43 | |
44 | def bulkops |
45 | ids = (params[:feedback_check]||{}).keys.map(&:to_i) |
46 | |
47 | case params[:commit] |
48 | when 'Delete Checked Items' |
49 | count = 0 |
50 | ids.each do |id| |
51 | count += Feedback.delete(id) ## XXX Should this be #destroy? |
52 | end |
53 | flash[:notice] = "Deleted #{count} item(s)" |
54 | |
55 | # Sweep cache |
56 | PageCache.sweep_all |
57 | expire_fragment(/.*/) |
58 | when 'Mark Checked Items as Ham' |
59 | ids.each do |id| |
60 | feedback = Feedback.find(id) |
61 | feedback.mark_as_ham! |
62 | end |
63 | flash[:notice]= "Marked #{ids.size} item(s) as Ham" |
64 | when 'Mark Checked Items as Spam' |
65 | ids.each do |id| |
66 | feedback = Feedback.find(id) |
67 | feedback.mark_as_spam! |
68 | end |
69 | flash[:notice]= "Marked #{ids.size} item(s) as Spam" |
70 | when 'Confirm Classification of Checked Items' |
71 | ids.each do |id| |
72 | Feedback.find(id).confirm_classification! |
73 | end |
74 | flash[:notice] = "Confirmed classification of #{ids.size} item(s)" |
75 | else |
76 | flash[:notice] = "Not implemented" |
77 | end |
78 | |
79 | redirect_to :action => 'index', :page => params[:page], :search => params[:search] |
80 | end |
81 | end |