From 6e4844629a5f46ad93d3af4d1beec7c1d628c2b5 Mon Sep 17 00:00:00 2001 From: David Morley Date: Sun, 19 Feb 2012 15:29:07 -0600 Subject: [PATCH 1/3] admin cleanup --- app/views/admins/_admin_bar.haml | 1 + app/views/admins/user_search.html.haml | 2 +- app/views/admins/weekly_user_stats.haml | 6 +++--- config/routes.rb | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/admins/_admin_bar.haml b/app/views/admins/_admin_bar.haml index a366c187c..e616148ee 100644 --- a/app/views/admins/_admin_bar.haml +++ b/app/views/admins/_admin_bar.haml @@ -7,6 +7,7 @@ %li= link_to 'Pod Stats', pod_stats_path %li= link_to 'Correlations', correlations_path - if AppConfig[:mount_resque_web] + %li= link_to 'Resque', '/admins/resque' %li= link_to 'Resque Overview', resque_web_path diff --git a/app/views/admins/user_search.html.haml b/app/views/admins/user_search.html.haml index 900e78ee7..ff74732ff 100644 --- a/app/views/admins/user_search.html.haml +++ b/app/views/admins/user_search.html.haml @@ -21,7 +21,7 @@ email: = text_field_tag 'user[email]', params[:user][:email] - invitation identifier + invitation identifier: = text_field_tag 'user[invitation_identifier]', params[:user][:invitation_identifier] invitation token: diff --git a/app/views/admins/weekly_user_stats.haml b/app/views/admins/weekly_user_stats.haml index 621798d85..6816c324e 100644 --- a/app/views/admins/weekly_user_stats.haml +++ b/app/views/admins/weekly_user_stats.haml @@ -5,9 +5,9 @@ %br .span-24.last - %h1 + %h2 = "Users per week (Current server date is: #{Time.now.to_date}) " %ul - - @created_users_by_week.keys.sort.each do |k| + - @created_users_by_week.keys.sort.reverse.each do |k| %li - = "Week stating on #{k} , #{@created_users_by_week[k]}" + = "Week starting on #{k} , #{@created_users_by_week[k]}" diff --git a/config/routes.rb b/config/routes.rb index 4b32af38c..efea3c00f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -110,6 +110,7 @@ Diaspora::Application.routes.draw do get :admin_inviter get :weekly_user_stats get :correlations + get :resque get :stats, :as => 'pod_stats' end From c41923081ae842d8820bde8aef6b7129aacdb821 Mon Sep 17 00:00:00 2001 From: David Morley Date: Sun, 19 Feb 2012 15:50:12 -0600 Subject: [PATCH 2/3] resque with header --- app/views/admins/resque.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/views/admins/resque.html.haml diff --git a/app/views/admins/resque.html.haml b/app/views/admins/resque.html.haml new file mode 100644 index 000000000..32b5ec42b --- /dev/null +++ b/app/views/admins/resque.html.haml @@ -0,0 +1,6 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.stream + = render :partial => resque_web_path From a63bcd008083b0976fdc0344e8dcf74bc73c18dd Mon Sep 17 00:00:00 2001 From: David Morley Date: Sun, 19 Feb 2012 21:28:12 -0600 Subject: [PATCH 3/3] make popular tags human readable --- app/controllers/admins_controller.rb | 2 +- app/views/admins/_admin_bar.haml | 1 - app/views/admins/resque.html.haml | 6 --- app/views/admins/stats.html.haml | 67 +++------------------------- config/routes.rb | 1 - 5 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 app/views/admins/resque.html.haml diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index 7dd8a8df6..d6ea8e217 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -36,7 +36,7 @@ class AdminsController < ApplicationController end def stats - @popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(15).count(:group => :tag, :order => 'count(taggings.id) DESC') + @popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(50).count(:group => :tag, :order => 'count(taggings.id) DESC') case params[:range] when "week" diff --git a/app/views/admins/_admin_bar.haml b/app/views/admins/_admin_bar.haml index e616148ee..a366c187c 100644 --- a/app/views/admins/_admin_bar.haml +++ b/app/views/admins/_admin_bar.haml @@ -7,7 +7,6 @@ %li= link_to 'Pod Stats', pod_stats_path %li= link_to 'Correlations', correlations_path - if AppConfig[:mount_resque_web] - %li= link_to 'Resque', '/admins/resque' %li= link_to 'Resque Overview', resque_web_path diff --git a/app/views/admins/resque.html.haml b/app/views/admins/resque.html.haml deleted file mode 100644 index 32b5ec42b..000000000 --- a/app/views/admins/resque.html.haml +++ /dev/null @@ -1,6 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -.stream - = render :partial => resque_web_path diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 17ae0f654..66a87413c 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -49,8 +49,6 @@ %span.percent_change{:class => (model[:change] > 0 ? "green" : "red")} = "(#{model[:change]}%)" - %br - %br %br %br %br @@ -65,63 +63,12 @@ %b #{@posts[:day_before]/@user_count.to_f} - /%h3 - / Posts over time - - /#stats_graph{:style => "text-align:right;position:relative;vertical-align:bottom;background-color:#eee;"} - / = @posts_per_day.inspect - / /- @posts_per_day.each do |key, val| - / /.asdo{:style => "display:inline-block;width:35px;vertical-align:bottom;background-color:#666;height:#{(val/@most_posts_within)*200}px;"} - - - %br - %br - %br - %br - - - -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br -%br - .span-24.last - %h2 - Misc Stuff - %br - %br - %h3 - = for tg in @popular_tags - = link_to tg, tags_path(tg) - -%br -%br - -.span-12 - %h3 - New public posts - /.stream - / /= render 'shared/stream', :posts => @new_public_posts - -.span-12.last - %h3 - Most Liked - .stream - = render 'shared/stream', :posts => @most_liked_posts + 50 Most Popular Tags + - @popular_tags.each do |name,count| + Tag Name: + %b= name + Count: + %b= count + %br diff --git a/config/routes.rb b/config/routes.rb index efea3c00f..4b32af38c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -110,7 +110,6 @@ Diaspora::Application.routes.draw do get :admin_inviter get :weekly_user_stats get :correlations - get :resque get :stats, :as => 'pod_stats' end