lib/controllers/logs.rb in wackamole-0.0.9 vs lib/controllers/logs.rb in wackamole-0.1.2
- old
+ new
@@ -37,14 +37,33 @@
erb :"logs/show", :layout => false
end
# ---------------------------------------------------------------------------
# Filter logs
- post "/logs/filter" do
+ post "/logs/filter" do
@filter = Wackamole::SearchFilter.new
@filter.from_options( params[:filter] )
session[:filter] = @filter
@logs = Wackamole::Log.paginate( @filter.to_conds )
erb :"logs/filter.js", :layout => false
end
+
+ # ---------------------------------------------------------------------------
+ # Show logs for a given user
+ get "/logs/user/:username" do
+ @filter.search_terms = "user:#{params[:username]}"
+ session[:filter] = @filter
+
+ redirect '/logs/1'
+ end
+
+ # ---------------------------------------------------------------------------
+ # Show logs for a given feature
+ get "/logs/feature/:feature_id" do
+ @filter.feature_id = params[:feature_id]
+ session[:filter] = @filter
+
+ redirect '/logs/1'
+ end
+
end
\ No newline at end of file