[refs #2161] Split platforms on three groups
This commit is contained in:
parent
dee94bf751
commit
2c0422a3bc
|
@ -6,8 +6,12 @@ class CategoriesController < ApplicationController
|
|||
before_filter :check_global_access, :only => [:platforms, :new, :create]
|
||||
|
||||
def platforms
|
||||
@platforms = Platform.all
|
||||
@platforms_count = Platform.joins(:repositories => :projects).group('platforms.id').count
|
||||
@all_platforms = Platform.all
|
||||
@all_platforms_count = Platform.joins(:repositories => :projects).group('platforms.id').count
|
||||
@personal_platforms = Platform.personal
|
||||
@personal_platforms_count = Platform.personal.joins(:repositories => :projects).group('platforms.id').count
|
||||
@main_platforms = Platform.main
|
||||
@main_platforms_count = Platform.main.joins(:repositories => :projects).group('platforms.id').count
|
||||
end
|
||||
|
||||
def index
|
||||
|
|
|
@ -5,9 +5,27 @@
|
|||
%li.active= link_to t("layout.categories.platforms"), platforms_categories_path
|
||||
.content
|
||||
%h2.title= t("layout.platforms.list_header")
|
||||
%br
|
||||
.inner
|
||||
%h3.title= t("layout.platforms.list_header_main")
|
||||
%table.table
|
||||
- @platforms.each do |platform|
|
||||
- @main_platforms.each do |platform|
|
||||
%tr{:class => cycle("odd", "even")}
|
||||
%td= link_to platform.name, platform_categories_path(platform)
|
||||
%td.last= @platforms_count[platform.id].to_i
|
||||
%td.last= @main_platforms_count[platform.id].to_i
|
||||
%br
|
||||
.inner
|
||||
%h3.title= t("layout.platforms.list_header_personal")
|
||||
%table.table
|
||||
- @personal_platforms.each do |platform|
|
||||
%tr{:class => cycle("odd", "even")}
|
||||
%td= link_to platform.name, platform_categories_path(platform)
|
||||
%td.last= @personal_latforms_count[platform.id].to_i
|
||||
%br
|
||||
.inner
|
||||
%h3.title= t("layout.platforms.list_header_all")
|
||||
%table.table
|
||||
- @all_platforms.each do |platform|
|
||||
%tr{:class => cycle("odd", "even")}
|
||||
%td= link_to platform.name, platform_categories_path(platform)
|
||||
%td.last= @all_platforms_count[platform.id].to_i
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
%a{:href => all_build_lists_path}= t("layout.menu.build_lists")
|
||||
-if current_user.can_perform?('categories', 'index')
|
||||
%li{:class => controller.controller_path == 'categories' ? 'active' : '' }
|
||||
%a{:href => categories_path}= t("layout.menu.categories")
|
||||
%a{:href => catalogs_path}= t("layout.menu.categories")
|
||||
-if current_user.can_perform?('roles', 'index')
|
||||
%li{:class => controller.controller_path == 'roles' ? 'active' : '' }
|
||||
%a{:href => roles_path}= t("layout.menu.roles")
|
||||
|
|
|
@ -117,7 +117,7 @@ Rosa::Application.routes.draw do
|
|||
resources :repositories, :only => [:new, :create]
|
||||
end
|
||||
|
||||
match '/catalogs', :to => 'categories#platforms'
|
||||
match '/catalogs', :to => 'categories#platforms', :catalogs
|
||||
|
||||
match 'build_lists/status_build', :to => "build_lists#status_build"
|
||||
match 'build_lists/post_build', :to => "build_lists#post_build"
|
||||
|
|
Loading…
Reference in New Issue