Merge branch '3.2-master' into 270-user_control

This commit is contained in:
Alexander Machehin 2012-03-21 19:39:55 +06:00
commit 3c7dec3b97
10 changed files with 64 additions and 41 deletions

View File

@ -35,4 +35,18 @@ $(document).ready(function() {
$('div.information > div.profile > a').live('click', function(e) {
e.preventDefault();
});
$('.more_activities').live('click', function(){
var button = $(this);
$.ajax({
type: 'GET',
url: button.attr("href"),
success: function(data){
button.fadeOut('slow').after(data);
button.remove();
}
});
return false;
});
});

View File

@ -11,15 +11,21 @@ $(document).ready(function() {
$(this).attr('checked', 'checked');
$(this).removeAttr('disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
if ($(this).parent().find('.offset25 label').text() == 'main') {
$(this).parent().find('.offset25 input[type="checkbox"]').attr('checked', 'checked');
}
} else {
$(this).removeAttr('checked');
$(this).attr('disabled', 'disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('checked');
}
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
} else {
$(this).removeAttr('disabled');
$(this).removeAttr('checked');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('checked');
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
}
});

View File

@ -5,7 +5,11 @@ class ActivityFeedsController < ApplicationController
@filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all
@activity_feeds = current_user.activity_feeds
@activity_feeds = @activity_feeds.where(:kind => "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all
@activity_feeds = @activity_feeds.paginate :page => params[:page]
if request.format == '*/*'
render '_list', :layout => false
else
render 'index'
end
end
end

View File

@ -14,7 +14,7 @@ class User < ActiveRecord::Base
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true
devise :database_authenticatable, :registerable, #:omniauthable, # :token_authenticatable, :encryptable, :timeoutable
:recoverable, :rememberable, :validatable #, :trackable, :confirmable, :lockable
:recoverable, :rememberable, :validatable, :lockable #, :trackable, :confirmable
has_one :notifier, :class_name => 'Settings::Notifier', :dependent => :destroy #:notifier

View File

@ -0,0 +1,6 @@
- @activity_feeds.each do |activity_feed|
.activity
= render_activity_feed(activity_feed)
- if @activity_feeds.next_page
%a{:href => activity_feeds_path({:filter => @filter, :page => @activity_feeds.next_page}), :class => 'more_activities'}
.messages.messages-last=t('layout.activity_feed.load_messages')

View File

@ -1,10 +1,5 @@
%h3.fix= t("layout.activity_feed.header")
- @activity_feeds.each do |activity_feed|
.activity
= render_activity_feed(activity_feed)
- if @activity_feeds.next_page
%a{:href => activity_feeds_path({:filter => @filter, :page => @activity_feeds.next_page})}
.messages.messages-last=t('layout.activity_feed.load_messages')
=render 'list'
- content_for :sidebar, render('sidebar')
- content_for :feed_tabs, render('feed_tabs')

View File

@ -5,20 +5,20 @@
%h3= t("activerecord.attributes.build_list.bpl")
.all_platforms
- Platform.main.each do |pl|
- if pl.repository_ids.size > 0
.both
- if pl.platform_type == 'main'
= check_box_tag "bpls[]", pl.id, (params[:bpls]||[]).include?(pl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{pl.id}"
= label_tag "bpls_#{pl.id}", pl.name
- else
= check_box_tag "", "", :class => "additional_pl", :disabled => :disabled
= label_tag "", pl.name, :class => "additional_pl"
.offset25{:style => 'padding-left: 25px'}
= render 'include_repos', :platform => pl
-#%div{:class => "include_repos_#{p.id}"}= render 'include_repos', :platform => p
-#- Platform.main.each do |bpl|
-# .both
-# = check_box_tag "bpls[]", bpl.id, (params[:bpls]||[]).include?(bpl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{bpl.id}"
-# = label_tag "bpls_#{bpl.id}", bpl.name
%section.right
%h3= t("activerecord.attributes.build_list.arch")
- Arch.recent.each do |arch|
.both
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
= label_tag "arches_#{arch.id}", arch.name
%h3= t("activerecord.attributes.build_list.pl")
.lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}
%h3= t("activerecord.attributes.build_list.update_type")
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES
%h3= t("activerecord.attributes.build_list.preferences")
@ -30,19 +30,5 @@
= f.label :build_requires
%br
= f.submit t("layout.projects.build_button")
%section.right
%h3= t("activerecord.attributes.build_list.arch")
- Arch.recent.each do |arch|
.both
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
= label_tag "arches_#{arch.id}", arch.name
%h3= t("activerecord.attributes.build_list.pl")
.lineForm= f.select :pl_id, @project.repositories.collect{|r| ["#{r.platform.name}/#{r.name}", r.platform.id]}
-# %h3= t("activerecord.attributes.build_list.include_repos")
-# #include_repos
-#.preloaded_include_repos{:style => 'display: none'}
-# - @project.platforms.each do |p|
-# %div{:class => "include_repos_#{p.id}"}= render 'include_repos', :platform => p
= render 'projects/submenu'

View File

@ -35,10 +35,10 @@
.both
- if content_for?(:submenu)
.sub-menu= yield :submenu
.both
= render "layouts/flashes"
- if content_for?(:feed_tabs)
= yield :feed_tabs
.both
= render "layouts/flashes"
%article
- if content_for?(:sidebar)
%aside= yield :sidebar

View File

@ -0,0 +1,8 @@
class AddDeviseLockable < ActiveRecord::Migration
def change
add_column :users, :failed_attempts, :integer, :default => 0 # Only if lock strategy is :failed_attempts
add_column :users, :unlock_token, :string # Only if unlock strategy is :email or :both
add_column :users, :locked_at, :datetime
add_index :users, :unlock_token, :unique => true
end
end

View File

@ -11,14 +11,14 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120320102912) do
ActiveRecord::Schema.define(:version => 20120321130436) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
t.string "kind"
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "arches", :force => true do |t|
@ -370,16 +370,16 @@ ActiveRecord::Schema.define(:version => 20120320102912) do
t.string "name"
t.string "email", :default => "", :null => false
t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "password_salt", :default => "", :null => false
t.string "reset_password_token"
t.datetime "remember_created_at"
t.datetime "created_at"
t.datetime "updated_at"
t.text "ssh_key"
t.string "uname"
t.string "role"
t.string "language", :default => "en"
t.integer "own_projects_count", :default => 0, :null => false
t.datetime "reset_password_sent_at"
t.integer "own_projects_count", :default => 0, :null => false
t.text "professional_experience"
t.string "site"
t.string "company"
@ -388,10 +388,14 @@ ActiveRecord::Schema.define(:version => 20120320102912) do
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.integer "failed_attempts", :default => 0
t.string "unlock_token"
t.datetime "locked_at"
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
add_index "users", ["uname"], :name => "index_users_on_uname", :unique => true
add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
end