[issue #428] Merge branch 'master' into 428-advisory
Conflicts: app/controllers/projects/build_lists_controller.rb db/schema.rb
This commit is contained in:
commit
26a643eed1
|
@ -17,6 +17,10 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def top_menu_class(base)
|
||||||
|
(controller_name.include?('build_lists') ? controller_name : params[:controller]).include?(base.to_s) ? 'active' : nil
|
||||||
|
end
|
||||||
|
|
||||||
def title_object object
|
def title_object object
|
||||||
name = object.class == Group ? object.uname : object.name
|
name = object.class == Group ? object.uname : object.name
|
||||||
object_name = t "activerecord.models.#{object.class.name.downcase}"
|
object_name = t "activerecord.models.#{object.class.name.downcase}"
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
%ul
|
%ul
|
||||||
- (collection = t which_menu).each do |base, title|
|
- (collection = t which_menu).each do |base, title|
|
||||||
- if can? :index, base.to_s.classify.constantize
|
- if can? :index, base.to_s.classify.constantize
|
||||||
%li= link_to title, send(:"#{namespace}#{base}_path"), :class => params[:controller].include?(base.to_s) ? 'active' : ''
|
%li= link_to title, send(:"#{namespace}#{base}_path"), :class => top_menu_class(base)
|
||||||
- if current_user.try(:admin?) and which_menu == 'top_menu'
|
- if current_user.try(:admin?) and which_menu == 'top_menu'
|
||||||
%li= link_to t('admins_menu_header'), admin_users_path, :class => t('admins_menu').has_key?(controller_name.to_sym) ? 'active' : ''
|
%li= link_to t('admins_menu_header'), admin_users_path, :class => top_menu_class('admin')
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
class AddBuildPriorityToUsers < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
add_column :users, :build_priority, :integer, :default => 50
|
||||||
|
User.update_all :build_priority => 50
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
remove_column :users, :build_priority
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20120428105843) do
|
ActiveRecord::Schema.define(:version => 20120505101650) do
|
||||||
|
|
||||||
create_table "activity_feeds", :force => true do |t|
|
create_table "activity_feeds", :force => true do |t|
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
|
@ -354,7 +354,6 @@ ActiveRecord::Schema.define(:version => 20120428105843) do
|
||||||
t.datetime "remember_created_at"
|
t.datetime "remember_created_at"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.text "ssh_key"
|
|
||||||
t.string "uname"
|
t.string "uname"
|
||||||
t.string "role"
|
t.string "role"
|
||||||
t.string "language", :default => "en"
|
t.string "language", :default => "en"
|
||||||
|
@ -374,6 +373,7 @@ ActiveRecord::Schema.define(:version => 20120428105843) do
|
||||||
t.datetime "confirmed_at"
|
t.datetime "confirmed_at"
|
||||||
t.datetime "confirmation_sent_at"
|
t.datetime "confirmation_sent_at"
|
||||||
t.string "authentication_token"
|
t.string "authentication_token"
|
||||||
|
t.integer "build_priority", :default => 50
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token"
|
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token"
|
||||||
|
|
Loading…
Reference in New Issue