From 1b871bf6dd596176d314900455912e8edbe7301d Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Tue, 17 Apr 2012 12:23:58 +0400 Subject: [PATCH 1/3] [refs #404] Remove downloads statistics functional --- config/routes.rb | 3 --- config/schedule.rb | 6 ------ {app/models => doc/downloads}/download.rb | 0 {app/controllers => doc/downloads}/downloads_controller.rb | 0 {app/views => doc}/downloads/index.html.haml | 0 doc/downloads/schedule.rb | 5 +++++ 6 files changed, 5 insertions(+), 9 deletions(-) rename {app/models => doc/downloads}/download.rb (100%) rename {app/controllers => doc/downloads}/downloads_controller.rb (100%) rename {app/views => doc}/downloads/index.html.haml (100%) create mode 100644 doc/downloads/schedule.rb diff --git a/config/routes.rb b/config/routes.rb index 70f523a8d..346266c16 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -178,9 +178,6 @@ Rosa::Application.routes.draw do resources :event_logs, :only => :index - match 'statistics/' => 'downloads#index', :as => :downloads - match 'statistics/refresh' => 'downloads#refresh', :as => :downloads_refresh - match '/forbidden', :to => 'pages#forbidden', :as => 'forbidden' match '/terms-of-service', :to => 'pages#tos', :as => 'tos' diff --git a/config/schedule.rb b/config/schedule.rb index f1d6faa22..69ec02b5d 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -7,12 +7,6 @@ # runner "Download.parse_and_remove_nginx_log" #end -every 1.day, :at => '5:00' do - #rake "sudo_test:projects" - runner "Download.rotate_nginx_log" - runner "Download.parse_and_remove_nginx_log" -end - every 1.day, :at => '4:00 am' do rake "import:sync:all", :output => 'log/sync.log' end diff --git a/app/models/download.rb b/doc/downloads/download.rb similarity index 100% rename from app/models/download.rb rename to doc/downloads/download.rb diff --git a/app/controllers/downloads_controller.rb b/doc/downloads/downloads_controller.rb similarity index 100% rename from app/controllers/downloads_controller.rb rename to doc/downloads/downloads_controller.rb diff --git a/app/views/downloads/index.html.haml b/doc/downloads/index.html.haml similarity index 100% rename from app/views/downloads/index.html.haml rename to doc/downloads/index.html.haml diff --git a/doc/downloads/schedule.rb b/doc/downloads/schedule.rb new file mode 100644 index 000000000..884c2ed43 --- /dev/null +++ b/doc/downloads/schedule.rb @@ -0,0 +1,5 @@ +every 1.day, :at => '5:00' do + #rake "sudo_test:projects" + runner "Download.rotate_nginx_log" + runner "Download.parse_and_remove_nginx_log" +end From 74b21381e2f2b009a05a686502f7e0c2d48923c1 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Tue, 17 Apr 2012 12:41:05 +0400 Subject: [PATCH 2/3] [refs #404] Remove unnessacary downloads files --- doc/downloads/downloads_controller.rb | 16 -------------- doc/downloads/index.html.haml | 30 --------------------------- doc/downloads/schedule.rb | 5 ----- 3 files changed, 51 deletions(-) delete mode 100644 doc/downloads/downloads_controller.rb delete mode 100644 doc/downloads/index.html.haml delete mode 100644 doc/downloads/schedule.rb diff --git a/doc/downloads/downloads_controller.rb b/doc/downloads/downloads_controller.rb deleted file mode 100644 index 59a76d80d..000000000 --- a/doc/downloads/downloads_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -# -*- encoding : utf-8 -*- -class DownloadsController < ApplicationController - before_filter :authenticate_user! - load_and_authorize_resource - - def index - @downloads = Download.paginate :page => params[:page], :per_page => 30 - end - - def refresh - Download.rotate_nginx_log - Download.parse_and_remove_nginx_log - - redirect_to downloads_path, :notice => t('flash.downloads.statistics_refreshed') - end -end diff --git a/doc/downloads/index.html.haml b/doc/downloads/index.html.haml deleted file mode 100644 index f8d35caeb..000000000 --- a/doc/downloads/index.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -.block - .content - %h2.title - = title t("layout.downloads.title") - .inner - %h3= t("layout.downloads.message") - .inner - %table.table - %tr - %th.first= t("activerecord.attributes.download.name") - %th= t("activerecord.attributes.download.version") - %th= t("activerecord.attributes.download.distro") - %th= t("activerecord.attributes.download.platform") - %th.last= t("activerecord.attributes.download.counter") - - @downloads.each do |download| - %tr{:class => cycle("odd", "even")} - %td - = download.name - %td - = download.version - %td - = download.distro - %td - = download.platform - %td.last - = download.counter - .actions-bar.wat-cf - .actions - = will_paginate @downloads -= render 'admin/submenu' diff --git a/doc/downloads/schedule.rb b/doc/downloads/schedule.rb deleted file mode 100644 index 884c2ed43..000000000 --- a/doc/downloads/schedule.rb +++ /dev/null @@ -1,5 +0,0 @@ -every 1.day, :at => '5:00' do - #rake "sudo_test:projects" - runner "Download.rotate_nginx_log" - runner "Download.parse_and_remove_nginx_log" -end From 2c9d4583e884e30c7a62fa738e0050eee46489a3 Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Tue, 17 Apr 2012 13:17:52 +0400 Subject: [PATCH 3/3] [refs #404] Remove downloads from menu --- config/locales/en.yml | 15 --------------- config/locales/menu.en.yml | 4 +--- config/locales/menu.ru.yml | 2 -- config/locales/ru.yml | 15 --------------- 4 files changed, 1 insertion(+), 35 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8b087faae..b78182bff 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -64,11 +64,6 @@ en: unlock: Do not receive unlock instructions? sign_in_through: Sign in by %{provider} - downloads: - title: Downloads statistic - message: Automatically updated every 24 hours - refresh_btn: Refresh - weekdays: Monday: Monday Tuesday: Tuesday @@ -137,9 +132,6 @@ en: exception_message: Access violation to this page! - downloads: - statistics_refreshed: Statistics refreshed - collaborators: successfully_changed: Collaborators list successfully changed error_in_changing: Collaborators list changing error @@ -172,7 +164,6 @@ en: arch: Arch private_user: Private user product_build_list: Product build list - download: Statistics attributes: settings: @@ -195,9 +186,3 @@ en: created_at: Created updated_at: Updated - download: - name: Name - version: Version - distro: Source - platform: Platform - counter: Downloads diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index bac7d9023..f3bae9b88 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -3,7 +3,6 @@ en: repositories: Repositories personal_repository: My repository products: Products - downloads: Statistics top_menu: platforms: Platforms projects: Projects @@ -38,5 +37,4 @@ en: users: Users register_requests: Invites event_logs: Event log - downloads: Download statistic - \ No newline at end of file + diff --git a/config/locales/menu.ru.yml b/config/locales/menu.ru.yml index 6099b8ae4..209b30527 100644 --- a/config/locales/menu.ru.yml +++ b/config/locales/menu.ru.yml @@ -3,7 +3,6 @@ ru: products: Продукты repositories: Репозитории personal_repository: Мой репозиторий - downloads: Статистика top_menu: platforms: Платформы projects: Проекты @@ -38,4 +37,3 @@ ru: users: Пользователи register_requests: Инвайты event_logs: Лог событий - downloads: Статистика закачек пакетов diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 97ae8ba21..670dcec8f 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -64,11 +64,6 @@ ru: unlock: Не получили инструкции по разблокировке? sign_in_through: Войти через %{provider} - downloads: - title: Статистика закачек пакетов - message: Обновляется автоматически каждые 24 часа - refresh_btn: Обновить - weekdays: Monday: Понедельник Tuesday: Вторник @@ -137,9 +132,6 @@ ru: exception_message: У Вас нет доступа к этой странице! - downloads: - statistics_refreshed: Статистика обновлена - collaborators: successfully_changed: Список коллабораторов успешно изменен error_in_changing: Ошибка изменения списка коллабораторов @@ -172,7 +164,6 @@ ru: arch: Arch private_user: Приватный пользователь product_build_list: Сборочный лист продукта - download: Статистика auto_build_list: Автоматическая пересборка пакетов attributes: @@ -196,9 +187,3 @@ ru: created_at: Создана updated_at: Обновлена - download: - name: Название - version: Версия - distro: Дистрибутив - platform: Архитектура - counter: Закачки