forked from manveru/rapaste
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
740 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
class SpamController < Ramaze::Controller | ||
map '/spam' | ||
helper :paginate, :formatting, :aspect | ||
engine :Haml | ||
layout '/layout' | ||
|
||
def list_pending | ||
@pastes = Paste.filter({:private => false, :approved => nil} & ({:category => 'spam'} | {:category => nil})) | ||
@pager = paginate(@pastes, :limit => $rapaste[:pager]) | ||
@count = @pastes.count | ||
end | ||
|
||
def list_spammy | ||
@pastes = Paste.filter(:private => false, :spammy => true) | ||
@pager = paginate(@pastes, :limit => $rapaste[:pager]) | ||
@count = @pastes.count | ||
end | ||
|
||
def mark | ||
return unless request.post? | ||
|
||
request.params.each do |id, category| | ||
if paste = Paste[id] | ||
if category == 'ham' | ||
paste.ham! | ||
elsif category == 'spam' | ||
paste.spam! | ||
end | ||
end | ||
end | ||
|
||
session[:undo] ||= [] | ||
session[:undo] << request.params | ||
session[:undo].shift until session[:undo].size < 10 # keep it reasonable | ||
|
||
flash[:good] = "Categorized this page, #{A('undo?', :href => Rs(:undo))}" | ||
|
||
redirect_referrer | ||
end | ||
|
||
def undo | ||
if last = session[:undo].pop | ||
Paste.filter(:id => last.keys.map{|k| k.to_i }).each do |paste| | ||
paste.category = nil | ||
paste.approved = nil | ||
paste.save | ||
end | ||
|
||
flash[:good] = "Undo successful, want to #{A('undo further?', :href => Rs(:undo))}" | ||
else | ||
flash[:bad] = "Nothing to undo" | ||
end | ||
|
||
redirect_referrer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
context | ||
please | ||
mode | ||
main | ||
special | ||
which | ||
either | ||
html | ||
default | ||
shares | ||
attr | ||
conversion | ||
else | ||
given | ||
over | ||
match | ||
also | ||
closed | ||
types | ||
long | ||
exit | ||
case | ||
check | ||
going | ||
root | ||
without | ||
left | ||
list | ||
even | ||
display | ||
lists | ||
where | ||
style | ||
should | ||
last | ||
info | ||
again | ||
handle | ||
false | ||
path | ||
elements | ||
modify | ||
error | ||
filter | ||
unit | ||
pershareitemtype | ||
author | ||
substring | ||
tierdetails | ||
return | ||
when | ||
affiliateid | ||
details | ||
some | ||
http | ||
dataitem | ||
expanded | ||
class | ||
public | ||
perunititemtype | ||
while | ||
depth | ||
would | ||
file | ||
later | ||
show | ||
body | ||
misc | ||
arguments | ||
response | ||
catch | ||
block | ||
join | ||
math | ||
document | ||
only | ||
pure | ||
first | ||
will | ||
find | ||
that | ||
name | ||
reload | ||
normal | ||
load | ||
tier | ||
user | ||
view | ||
michael | ||
local | ||
thanks | ||
onclick | ||
unitref | ||
because | ||
code | ||
more | ||
ajax | ||
about | ||
monetaryitemtype | ||
affiliate | ||
remove | ||
them | ||
then | ||
somewhere | ||
test | ||
version | ||
your | ||
want | ||
function | ||
files | ||
they | ||
page | ||
size | ||
shown | ||
start | ||
request | ||
support | ||
affiliatesdtx | ||
decimals | ||
modules | ||
sure | ||
using | ||
source | ||
found | ||
like | ||
working | ||
thing | ||
element | ||
actually | ||
been | ||
convert | ||
ruby | ||
searching | ||
type | ||
from | ||
with | ||
patch | ||
null | ||
hope | ||
data | ||
position | ||
read | ||
into | ||
this | ||
module | ||
filename | ||
controller | ||
broker | ||
already | ||
open | ||
exists | ||
text | ||
each | ||
after | ||
string | ||
line | ||
link | ||
resolve | ||
suite | ||
xbrli | ||
update | ||
work | ||
variables | ||
current | ||
raise | ||
have | ||
sharesitemtype | ||
admin | ||
instead | ||
money | ||
true | ||
windows |
Oops, something went wrong.