Merge branch '3.2-master' into 270-user_control
This commit is contained in:
commit
3c7dec3b97
|
@ -35,4 +35,18 @@ $(document).ready(function() {
|
||||||
$('div.information > div.profile > a').live('click', function(e) {
|
$('div.information > div.profile > a').live('click', function(e) {
|
||||||
e.preventDefault();
|
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;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,15 +11,21 @@ $(document).ready(function() {
|
||||||
$(this).attr('checked', 'checked');
|
$(this).attr('checked', 'checked');
|
||||||
$(this).removeAttr('disabled');
|
$(this).removeAttr('disabled');
|
||||||
$(this).parent().find('.offset25 input[type="checkbox"]').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 {
|
} else {
|
||||||
$(this).removeAttr('checked');
|
$(this).removeAttr('checked');
|
||||||
$(this).attr('disabled', 'disabled');
|
$(this).attr('disabled', 'disabled');
|
||||||
$(this).parent().find('.offset25 input[type="checkbox"]').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');
|
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').attr('disabled', 'disabled');
|
||||||
} else {
|
} else {
|
||||||
$(this).removeAttr('disabled');
|
$(this).removeAttr('disabled');
|
||||||
|
$(this).removeAttr('checked');
|
||||||
$(this).parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
|
$(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');
|
//$('.additional_pl').parent().find('.offset25 input[type="checkbox"]').removeAttr('disabled');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,11 @@ class ActivityFeedsController < ApplicationController
|
||||||
@filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all
|
@filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all
|
||||||
@activity_feeds = current_user.activity_feeds
|
@activity_feeds = current_user.activity_feeds
|
||||||
@activity_feeds = @activity_feeds.where(:kind => "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all
|
@activity_feeds = @activity_feeds.where(:kind => "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all
|
||||||
|
|
||||||
@activity_feeds = @activity_feeds.paginate :page => params[:page]
|
@activity_feeds = @activity_feeds.paginate :page => params[:page]
|
||||||
|
if request.format == '*/*'
|
||||||
|
render '_list', :layout => false
|
||||||
|
else
|
||||||
|
render 'index'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ class User < ActiveRecord::Base
|
||||||
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true
|
validates_inclusion_of :avatar_file_size, :in => (0..MAX_AVATAR_SIZE), :allow_nil => true
|
||||||
|
|
||||||
devise :database_authenticatable, :registerable, #:omniauthable, # :token_authenticatable, :encryptable, :timeoutable
|
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
|
has_one :notifier, :class_name => 'Settings::Notifier', :dependent => :destroy #:notifier
|
||||||
|
|
||||||
|
|
|
@ -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')
|
|
@ -1,10 +1,5 @@
|
||||||
%h3.fix= t("layout.activity_feed.header")
|
%h3.fix= t("layout.activity_feed.header")
|
||||||
- @activity_feeds.each do |activity_feed|
|
=render 'list'
|
||||||
.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')
|
|
||||||
|
|
||||||
- content_for :sidebar, render('sidebar')
|
- content_for :sidebar, render('sidebar')
|
||||||
- content_for :feed_tabs, render('feed_tabs')
|
- content_for :feed_tabs, render('feed_tabs')
|
||||||
|
|
|
@ -5,20 +5,20 @@
|
||||||
%h3= t("activerecord.attributes.build_list.bpl")
|
%h3= t("activerecord.attributes.build_list.bpl")
|
||||||
.all_platforms
|
.all_platforms
|
||||||
- Platform.main.each do |pl|
|
- Platform.main.each do |pl|
|
||||||
.both
|
- if pl.repository_ids.size > 0
|
||||||
- if pl.platform_type == 'main'
|
.both
|
||||||
= check_box_tag "bpls[]", pl.id, (params[:bpls]||[]).include?(pl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{pl.id}"
|
= 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
|
= label_tag "bpls_#{pl.id}", pl.name
|
||||||
- else
|
.offset25{:style => 'padding-left: 25px'}
|
||||||
= check_box_tag "", "", :class => "additional_pl", :disabled => :disabled
|
= render 'include_repos', :platform => pl
|
||||||
= label_tag "", pl.name, :class => "additional_pl"
|
%section.right
|
||||||
.offset25{:style => 'padding-left: 25px'}
|
%h3= t("activerecord.attributes.build_list.arch")
|
||||||
= render 'include_repos', :platform => pl
|
- Arch.recent.each do |arch|
|
||||||
-#%div{:class => "include_repos_#{p.id}"}= render 'include_repos', :platform => p
|
.both
|
||||||
-#- Platform.main.each do |bpl|
|
= check_box_tag "arches[]", arch.id, (params[:arches]||[]).include?(arch.id.to_s), :id => "arches_#{arch.id}"
|
||||||
-# .both
|
= label_tag "arches_#{arch.id}", arch.name
|
||||||
-# = check_box_tag "bpls[]", bpl.id, (params[:bpls]||[]).include?(bpl.id.to_s), :class => 'build_bpl_ids', :id => "bpls_#{bpl.id}"
|
%h3= t("activerecord.attributes.build_list.pl")
|
||||||
-# = label_tag "bpls_#{bpl.id}", bpl.name
|
.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")
|
%h3= t("activerecord.attributes.build_list.update_type")
|
||||||
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES
|
.lineForm= f.select :update_type, BuildList::UPDATE_TYPES
|
||||||
%h3= t("activerecord.attributes.build_list.preferences")
|
%h3= t("activerecord.attributes.build_list.preferences")
|
||||||
|
@ -30,19 +30,5 @@
|
||||||
= f.label :build_requires
|
= f.label :build_requires
|
||||||
%br
|
%br
|
||||||
= f.submit t("layout.projects.build_button")
|
= 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'
|
= render 'projects/submenu'
|
||||||
|
|
|
@ -35,10 +35,10 @@
|
||||||
.both
|
.both
|
||||||
- if content_for?(:submenu)
|
- if content_for?(:submenu)
|
||||||
.sub-menu= yield :submenu
|
.sub-menu= yield :submenu
|
||||||
.both
|
|
||||||
= render "layouts/flashes"
|
|
||||||
- if content_for?(:feed_tabs)
|
- if content_for?(:feed_tabs)
|
||||||
= yield :feed_tabs
|
= yield :feed_tabs
|
||||||
|
.both
|
||||||
|
= render "layouts/flashes"
|
||||||
%article
|
%article
|
||||||
- if content_for?(:sidebar)
|
- if content_for?(:sidebar)
|
||||||
%aside= yield :sidebar
|
%aside= yield :sidebar
|
||||||
|
|
|
@ -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
|
14
db/schema.rb
14
db/schema.rb
|
@ -11,14 +11,14 @@
|
||||||
#
|
#
|
||||||
# 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 => 20120320102912) do
|
ActiveRecord::Schema.define(:version => 20120321130436) 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
|
||||||
t.string "kind"
|
t.string "kind"
|
||||||
t.text "data"
|
t.text "data"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "arches", :force => true do |t|
|
create_table "arches", :force => true do |t|
|
||||||
|
@ -370,16 +370,16 @@ ActiveRecord::Schema.define(:version => 20120320102912) do
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "email", :default => "", :null => false
|
t.string "email", :default => "", :null => false
|
||||||
t.string "encrypted_password", :limit => 128, :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.string "reset_password_token"
|
||||||
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"
|
||||||
t.integer "own_projects_count", :default => 0, :null => false
|
|
||||||
t.datetime "reset_password_sent_at"
|
t.datetime "reset_password_sent_at"
|
||||||
|
t.integer "own_projects_count", :default => 0, :null => false
|
||||||
t.text "professional_experience"
|
t.text "professional_experience"
|
||||||
t.string "site"
|
t.string "site"
|
||||||
t.string "company"
|
t.string "company"
|
||||||
|
@ -388,10 +388,14 @@ ActiveRecord::Schema.define(:version => 20120320102912) do
|
||||||
t.string "avatar_content_type"
|
t.string "avatar_content_type"
|
||||||
t.integer "avatar_file_size"
|
t.integer "avatar_file_size"
|
||||||
t.datetime "avatar_updated_at"
|
t.datetime "avatar_updated_at"
|
||||||
|
t.integer "failed_attempts", :default => 0
|
||||||
|
t.string "unlock_token"
|
||||||
|
t.datetime "locked_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
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", ["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", ["uname"], :name => "index_users_on_uname", :unique => true
|
||||||
|
add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue