Merge branch 'develop' into competition
Conflicts: config/routes.rb lib/redmine.rb
This commit is contained in:
commit
6a8d697582
12
Gemfile
12
Gemfile
|
@ -15,6 +15,18 @@ gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
|
||||||
gem "builder", "3.0.0"
|
gem "builder", "3.0.0"
|
||||||
gem 'acts-as-taggable-on'
|
gem 'acts-as-taggable-on'
|
||||||
|
|
||||||
|
# Gems used only for assets and not required
|
||||||
|
# in production environments by default.
|
||||||
|
group :assets do
|
||||||
|
gem 'sass-rails', '~> 3.2.3'
|
||||||
|
gem 'coffee-rails', '~> 3.2.1'
|
||||||
|
|
||||||
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
|
# gem 'therubyracer', :platforms => :ruby
|
||||||
|
|
||||||
|
gem 'uglifier', '>= 1.0.3'
|
||||||
|
end
|
||||||
|
|
||||||
# Optional gem for LDAP authentication
|
# Optional gem for LDAP authentication
|
||||||
group :ldap do
|
group :ldap do
|
||||||
gem "net-ldap", "~> 0.3.1"
|
gem "net-ldap", "~> 0.3.1"
|
||||||
|
|
20
Gemfile.lock
20
Gemfile.lock
|
@ -40,7 +40,16 @@ GEM
|
||||||
arel (3.0.2)
|
arel (3.0.2)
|
||||||
builder (3.0.0)
|
builder (3.0.0)
|
||||||
coderay (1.0.9)
|
coderay (1.0.9)
|
||||||
|
coffee-rails (3.2.2)
|
||||||
|
coffee-script (>= 2.2.0)
|
||||||
|
railties (~> 3.2.0)
|
||||||
|
coffee-script (2.2.0)
|
||||||
|
coffee-script-source
|
||||||
|
execjs
|
||||||
|
coffee-script-source (1.6.1)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
|
execjs (1.4.0)
|
||||||
|
multi_json (~> 1.0)
|
||||||
fastercsv (1.5.0)
|
fastercsv (1.5.0)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
i18n (0.6.1)
|
i18n (0.6.1)
|
||||||
|
@ -86,6 +95,11 @@ GEM
|
||||||
rdoc (3.12.2)
|
rdoc (3.12.2)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
ruby-openid (2.1.8)
|
ruby-openid (2.1.8)
|
||||||
|
sass (3.2.7)
|
||||||
|
sass-rails (3.2.6)
|
||||||
|
railties (~> 3.2.0)
|
||||||
|
sass (>= 3.1.10)
|
||||||
|
tilt (~> 1.3)
|
||||||
sprockets (2.2.2)
|
sprockets (2.2.2)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
|
@ -97,6 +111,9 @@ GEM
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.37)
|
tzinfo (0.3.37)
|
||||||
|
uglifier (1.0.3)
|
||||||
|
execjs (>= 0.3.0)
|
||||||
|
multi_json (>= 1.0.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
x86-mingw32
|
x86-mingw32
|
||||||
|
@ -107,6 +124,7 @@ DEPENDENCIES
|
||||||
acts-as-taggable-on
|
acts-as-taggable-on
|
||||||
builder (= 3.0.0)
|
builder (= 3.0.0)
|
||||||
coderay (~> 1.0.6)
|
coderay (~> 1.0.6)
|
||||||
|
coffee-rails (~> 3.2.1)
|
||||||
fastercsv (~> 1.5.0)
|
fastercsv (~> 1.5.0)
|
||||||
i18n (~> 0.6.0)
|
i18n (~> 0.6.0)
|
||||||
jquery-rails (~> 2.0.2)
|
jquery-rails (~> 2.0.2)
|
||||||
|
@ -116,4 +134,6 @@ DEPENDENCIES
|
||||||
rails (= 3.2.13)
|
rails (= 3.2.13)
|
||||||
rdoc (>= 2.4.2)
|
rdoc (>= 2.4.2)
|
||||||
ruby-openid (~> 2.1.4)
|
ruby-openid (~> 2.1.4)
|
||||||
|
sass-rails (~> 3.2.3)
|
||||||
seems_rateable!
|
seems_rateable!
|
||||||
|
uglifier (>= 1.0.3)
|
||||||
|
|
|
@ -23,6 +23,7 @@ class AdminController < ApplicationController
|
||||||
|
|
||||||
before_filter :require_admin
|
before_filter :require_admin
|
||||||
helper :sort
|
helper :sort
|
||||||
|
helper :Users
|
||||||
include SortHelper
|
include SortHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -39,6 +40,121 @@ class AdminController < ApplicationController
|
||||||
render :action => "projects", :layout => false if request.xhr?
|
render :action => "projects", :layout => false if request.xhr?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def users
|
||||||
|
@project_type = params[:project_type]
|
||||||
|
role = params[:role]
|
||||||
|
|
||||||
|
sort_init 'login', 'asc'
|
||||||
|
sort_update %w(login firstname lastname mail admin created_on last_login_on)
|
||||||
|
|
||||||
|
case params[:format]
|
||||||
|
when 'xml', 'json'
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => 15})
|
||||||
|
else
|
||||||
|
@limit = 15#per_page_option
|
||||||
|
end
|
||||||
|
|
||||||
|
@status = params[:status] || 1
|
||||||
|
has = {
|
||||||
|
"show_changesets" => true
|
||||||
|
}
|
||||||
|
# @count = Redmine::Activity::Fetcher.new(User.current, :author => @user).scope_select {|t| !has["show_#{t}"].nil?}.events(nil, nil).count
|
||||||
|
|
||||||
|
scope = UserStatus.visible
|
||||||
|
case role
|
||||||
|
when 'teacher'
|
||||||
|
scope = UserStatus.teacher
|
||||||
|
when 'student'
|
||||||
|
scope = UserStatus.student
|
||||||
|
else
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
scope = scope.in_group(params[:group_id]) if params[:group_id].present?
|
||||||
|
# scope.each do |user|
|
||||||
|
# UserStatus.create(:changesets_count => user.changesets.count, :watchers_count => user.watcher_users.count, :user_id => user.id)
|
||||||
|
# end
|
||||||
|
@user_count = scope.count
|
||||||
|
@user_pages = Paginator.new @user_count, @limit, params['page']
|
||||||
|
#@offset ||= @user_pages.offset
|
||||||
|
#@users = scope.order(sort_clause).limit(@limit).offset(@offset).all
|
||||||
|
@user_base_tag = params[:id] ? 'base_users':'base'
|
||||||
|
if params[:user_sort_type].present?
|
||||||
|
case params[:user_sort_type]
|
||||||
|
when '0'
|
||||||
|
@offset ||= @user_pages.reverse_offset
|
||||||
|
unless @offset == 0
|
||||||
|
@users_statuses = scope.offset(@offset).limit(@limit).all.reverse
|
||||||
|
else
|
||||||
|
limit = @user_count % @limit
|
||||||
|
if limit == 0
|
||||||
|
limit = @limit
|
||||||
|
end
|
||||||
|
@users_statuses = scope.offset(@offset).limit(limit).all.reverse
|
||||||
|
end
|
||||||
|
@s_type = 0
|
||||||
|
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
||||||
|
# @projects = @projects[@offset, @limit]
|
||||||
|
when '1'
|
||||||
|
@offset ||= @user_pages.reverse_offset
|
||||||
|
unless @offset == 0
|
||||||
|
@users_statuses = scope.reorder('grade').offset(@offset).limit(@limit).all.reverse
|
||||||
|
else
|
||||||
|
limit = @user_count % @limit
|
||||||
|
if limit == 0
|
||||||
|
limit = @limit
|
||||||
|
end
|
||||||
|
@users_statuses = scope.reorder('grade').offset(@offset).limit(limit).all.reverse
|
||||||
|
end
|
||||||
|
@s_type = 1
|
||||||
|
#sort {|x,y| y.user_status.changesets_count <=> x.user_status.changesets_count}
|
||||||
|
#@users = @users[@offset, @limit]
|
||||||
|
when '2'
|
||||||
|
@offset ||= @user_pages.reverse_offset
|
||||||
|
unless @offset == 0
|
||||||
|
@users_statuses = scope.reorder('watchers_count').offset(@offset).limit(@limit).all.reverse
|
||||||
|
else
|
||||||
|
limit = @user_count % @limit
|
||||||
|
if limit == 0
|
||||||
|
limit = @limit
|
||||||
|
end
|
||||||
|
@users_statuses = scope.reorder('watchers_count').offset(@offset).limit(limit).all.reverse
|
||||||
|
end
|
||||||
|
@s_type = 2
|
||||||
|
#@users = @users[@offset, @limit]
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
@offset ||= @user_pages.reverse_offset
|
||||||
|
unless @offset == 0
|
||||||
|
@users_statuses = scope.reorder('grade').offset(@offset).limit(@limit).all.reverse
|
||||||
|
else
|
||||||
|
limit = @user_count % @limit
|
||||||
|
if limit == 0
|
||||||
|
limit = @limit
|
||||||
|
end
|
||||||
|
@users_statuses = scope.reorder('grade').offset(@offset).limit(limit).all.reverse
|
||||||
|
end
|
||||||
|
@s_type = 1
|
||||||
|
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
||||||
|
# @projects = @projects[@offset, @limit]
|
||||||
|
end
|
||||||
|
|
||||||
|
@users = []
|
||||||
|
@users_statuses.each do |obj|
|
||||||
|
@users << User.find_by_id("#{obj.user_id}")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
@groups = Group.all.sort
|
||||||
|
render :layout => @user_base_tag
|
||||||
|
}
|
||||||
|
format.api
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def plugins
|
def plugins
|
||||||
@plugins = Redmine::Plugin.all
|
@plugins = Redmine::Plugin.all
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class OpenSourceProjectsController < ApplicationController
|
class OpenSourceProjectsController < ApplicationController
|
||||||
|
|
||||||
before_filter :find_osp, :only => [:master_apply, :accept_master_apply, :refuse_master_apply]
|
before_filter :find_osp, :only => [:master_apply, :accept_master_apply, :refuse_master_apply]
|
||||||
before_filter :require_master, :only => [:master_apply, :accept_master_apply, :refuse_master_apply]
|
before_filter :require_master, :only => [:master_apply, :accept_master_apply, :refuse_master_apply]
|
||||||
|
|
||||||
helper :sort
|
helper :sort
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :apply_project_masters
|
helper :apply_project_masters
|
||||||
|
@ -12,6 +12,7 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
# GET /open_source_projects
|
# GET /open_source_projects
|
||||||
# GET /open_source_projects.json
|
# GET /open_source_projects.json
|
||||||
def index
|
def index
|
||||||
|
|
||||||
@app_dir = params[:app_dir]
|
@app_dir = params[:app_dir]
|
||||||
@language = params[:language]
|
@language = params[:language]
|
||||||
@created_at = params[:created_at]
|
@created_at = params[:created_at]
|
||||||
|
@ -22,8 +23,10 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
|
|
||||||
@os_project_count = @open_source_projects.count
|
@os_project_count = @open_source_projects.count
|
||||||
@os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
|
@os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
|
||||||
|
|
||||||
@open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
|
@open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
|
||||||
|
|
||||||
|
@bugs = BugToOsp.order('created_at desc').limit(8)
|
||||||
|
|
||||||
# @open_source_projects = OpenSourceProject.all
|
# @open_source_projects = OpenSourceProject.all
|
||||||
|
|
||||||
|
@ -32,11 +35,11 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
format.json { render json: @open_source_projects }
|
format.json { render json: @open_source_projects }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def master_apply
|
def master_apply
|
||||||
@apply = @open_source_project.apply_tips
|
@apply = @open_source_project.apply_tips
|
||||||
@applicants = @open_source_project.applicants
|
@applicants = @open_source_project.applicants
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => "base_opensource_p"
|
render :layout => "base_opensource_p"
|
||||||
|
@ -49,7 +52,7 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
# GET /open_source_projects/1.json
|
# GET /open_source_projects/1.json
|
||||||
def show
|
def show
|
||||||
@open_source_project = OpenSourceProject.find(params[:id])
|
@open_source_project = OpenSourceProject.find(params[:id])
|
||||||
|
|
||||||
sort_init 'updated_at', 'desc'
|
sort_init 'updated_at', 'desc'
|
||||||
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
|
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
|
||||||
'replies' => "#{RelativeMemo.table_name}.replies_count",
|
'replies' => "#{RelativeMemo.table_name}.replies_count",
|
||||||
|
@ -63,9 +66,9 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
includes(:last_reply).
|
includes(:last_reply).
|
||||||
limit(@topic_pages.per_page).
|
limit(@topic_pages.per_page).
|
||||||
offset(@topic_pages.offset).
|
offset(@topic_pages.offset).
|
||||||
order(sort_clause).
|
order(sort_clause).
|
||||||
all
|
all
|
||||||
|
|
||||||
@bugs = @open_source_project.bugs.limit(6)
|
@bugs = @open_source_project.bugs.limit(6)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -75,26 +78,36 @@ class OpenSourceProjectsController < ApplicationController
|
||||||
format.json { render json: @open_source_project }
|
format.json { render json: @open_source_project }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allbug
|
||||||
def search
|
@bugs = BugToOsp.visible
|
||||||
|
|
||||||
|
@bug_count = @bugs.count
|
||||||
|
@bug_pages = Paginator.new @bug_count, per_page_option, params['page']
|
||||||
|
@bugs = @bugs.includes(:bug).reorder("#{RelativeMemo.table_name}.created_at DESC").limit(@bug_pages.per_page).offset(@bug_pages.offset).all
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html
|
||||||
|
format.json { render json: @open_source_project }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
|
||||||
# added by yiang 暴力添加,请绕道
|
end
|
||||||
def showmemo
|
|
||||||
@open_source_project = OpenSourceProject.find(params[:id])
|
|
||||||
|
|
||||||
sort_init 'updated_at', 'desc'
|
def showbug
|
||||||
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
|
@open_source_project = OpenSourceProject.find(params[:id])
|
||||||
|
|
||||||
|
sort_init 'updated_at', 'desc'
|
||||||
|
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
|
||||||
'replies' => "#{RelativeMemo.table_name}.replies_count",
|
'replies' => "#{RelativeMemo.table_name}.replies_count",
|
||||||
'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
|
'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
|
||||||
|
|
||||||
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
|
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
|
||||||
@topic_count = @open_source_project.topics.count
|
@topic_count = @open_source_project.bugs.count
|
||||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||||
@memos = @open_source_project.topics.
|
@memos = @open_source_project.bugs.
|
||||||
reorder("#{RelativeMemo.table_name}.sticky DESC").
|
reorder("#{RelativeMemo.table_name}.sticky DESC").
|
||||||
includes(:last_reply).
|
includes(:last_reply).
|
||||||
limit(@topic_pages.per_page).
|
limit(@topic_pages.per_page).
|
||||||
|
@ -102,13 +115,42 @@ def showmemo
|
||||||
order(sort_clause).
|
order(sort_clause).
|
||||||
all
|
all
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => "base_opensource_p"
|
render :layout => "base_opensource_p"
|
||||||
}
|
}
|
||||||
format.json { render json: @open_source_project }
|
format.json { render json: @open_source_project }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
# added by yiang 暴力添加,请绕道
|
||||||
|
def showmemo
|
||||||
|
@open_source_project = OpenSourceProject.find(params[:id])
|
||||||
|
|
||||||
|
sort_init 'updated_at', 'desc'
|
||||||
|
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
|
||||||
|
'replies' => "#{RelativeMemo.table_name}.replies_count",
|
||||||
|
'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
|
||||||
|
|
||||||
|
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
|
||||||
|
@topic_count = @open_source_project.topics.count
|
||||||
|
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||||
|
@memos = @open_source_project.topics.
|
||||||
|
reorder("#{RelativeMemo.table_name}.sticky DESC").
|
||||||
|
includes(:last_reply).
|
||||||
|
limit(@topic_pages.per_page).
|
||||||
|
offset(@topic_pages.offset).
|
||||||
|
order(sort_clause).
|
||||||
|
all
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
render :layout => "base_opensource_p"
|
||||||
|
}
|
||||||
|
format.json { render json: @open_source_project }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# GET /open_source_projects/new
|
# GET /open_source_projects/new
|
||||||
# GET /open_source_projects/new.json
|
# GET /open_source_projects/new.json
|
||||||
def new
|
def new
|
||||||
|
@ -168,52 +210,51 @@ end
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_condition
|
def remove_condition
|
||||||
@app_dir = params[:app_dir]
|
@app_dir = params[:app_dir]
|
||||||
@language = params[:language]
|
@language = params[:language]
|
||||||
@created_at = params[:created_at]
|
@created_at = params[:created_at]
|
||||||
redirect_to open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => @created_at, :name => params[:name])
|
redirect_to open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => @created_at, :name => params[:name])
|
||||||
end
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
# per_page_option = 10
|
# per_page_option = 10
|
||||||
#
|
#
|
||||||
# @open_source_projects = OpenSourceProject.filter(@app_dir, @language, @created_at)
|
# @open_source_projects = OpenSourceProject.filter(@app_dir, @language, @created_at)
|
||||||
# @open_source_projects = @open_source_projects.like(params[:name]) if params[:name].present?
|
# @open_source_projects = @open_source_projects.like(params[:name]) if params[:name].present?
|
||||||
#
|
#
|
||||||
# @os_project_count = @open_source_projects.count
|
# @os_project_count = @open_source_projects.count
|
||||||
# @os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
|
# @os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
|
||||||
#
|
#
|
||||||
# @open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
|
# @open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page)
|
||||||
|
|
||||||
redirect_to open_source_projects_path(:name => params[:name])
|
redirect_to open_source_projects_path(:name => params[:name])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def refuse_master_apply
|
def refuse_master_apply
|
||||||
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
|
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
|
||||||
@apply.first.destory
|
@apply.first.destory
|
||||||
|
|
||||||
redirect_to master_apply_open_source_project_path
|
redirect_to master_apply_open_source_project_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept_master_apply
|
def accept_master_apply
|
||||||
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
|
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
|
||||||
if @apply.count == 1
|
if @apply.count == 1
|
||||||
@apply.first.update_attributes(:status => 2)
|
@apply.first.update_attributes(:status => 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_to master_apply_open_source_project_path
|
redirect_to master_apply_open_source_project_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def require_master
|
def require_master
|
||||||
render_403 unless @open_source_project.admin?(User.current)
|
render_403 unless @open_source_project.admin?(User.current)
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_osp
|
def find_osp
|
||||||
@open_source_project = OpenSourceProject.find(params[:id])
|
@open_source_project = OpenSourceProject.find(params[:id])
|
||||||
render_404 unless @open_source_project.present?
|
render_404 unless @open_source_project.present?
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
class TestController < ApplicationController
|
class TestController < ApplicationController
|
||||||
|
|
||||||
helper :UserScore
|
helper :UserScore
|
||||||
|
layout 'bootstrap_base'
|
||||||
|
|
||||||
|
def bootstrap; end
|
||||||
|
|
||||||
def zip
|
def zip
|
||||||
homeworks_attach_path = []
|
homeworks_attach_path = []
|
||||||
|
|
|
@ -67,7 +67,7 @@ class UsersController < ApplicationController
|
||||||
if User.current.admin?
|
if User.current.admin?
|
||||||
@memberships = @user.memberships.all
|
@memberships = @user.memberships.all
|
||||||
else
|
else
|
||||||
cond = Project.visible_condition(User.current) + "AND projects.project_type <> 1"
|
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
|
||||||
@memberships = @user.memberships.all(:conditions => cond)
|
@memberships = @user.memberships.all(:conditions => cond)
|
||||||
end
|
end
|
||||||
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
|
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
|
||||||
|
@ -565,7 +565,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def watch_projects
|
def watch_projects
|
||||||
@watch_projects = Project.joins(:watchers).where("project_type <>? and watchable_type = ? and user_id = ?", '1','Project', @user.id)
|
@watch_projects = Project.joins(:watchers).where("project_type <>? and watchable_type = ? and watchers.user_id = ?", '1','Project', @user.id)
|
||||||
@state = 1
|
@state = 1
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -782,7 +782,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def setting_layout(default_base='base_users')
|
def setting_layout(default_base='base_users')
|
||||||
User.current.admin? ? 'base_admin' : default_base
|
User.current.admin? ? default_base : default_base
|
||||||
end
|
end
|
||||||
|
|
||||||
# 必填自己的工作单位,其实就是学校
|
# 必填自己的工作单位,其实就是学校
|
||||||
|
|
|
@ -1338,9 +1338,22 @@ module ApplicationHelper
|
||||||
def hubspot_head
|
def hubspot_head
|
||||||
tags = javascript_include_tag('hubspot/messenger.min', 'hubspot/messenger-theme-future')
|
tags = javascript_include_tag('hubspot/messenger.min', 'hubspot/messenger-theme-future')
|
||||||
tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future', 'hubspot/messenger-theme-flat')
|
tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future', 'hubspot/messenger-theme-flat')
|
||||||
unless User.current.pref.warn_on_leaving_unsaved == '0'
|
end
|
||||||
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
|
|
||||||
end
|
def bootstrap_head
|
||||||
|
tags = stylesheet_link_tag('bootstrap/bootstrap.min', 'bootstrap/bootstrap-theme.min')
|
||||||
|
tags << javascript_include_tag('bootstrap/affix')
|
||||||
|
tags << javascript_include_tag('bootstrap/alert')
|
||||||
|
tags << javascript_include_tag('bootstrap/button')
|
||||||
|
tags << javascript_include_tag('bootstrap/carousel')
|
||||||
|
tags << javascript_include_tag('bootstrap/collapse')
|
||||||
|
tags << javascript_include_tag('bootstrap/dropdown')
|
||||||
|
tags << javascript_include_tag('bootstrap/modal')
|
||||||
|
tags << javascript_include_tag('bootstrap/popover')
|
||||||
|
tags << javascript_include_tag('bootstrap/scrollspy')
|
||||||
|
tags << javascript_include_tag('bootstrap/tab')
|
||||||
|
tags << javascript_include_tag('bootstrap/tooltip')
|
||||||
|
tags << javascript_include_tag('bootstrap/transition')
|
||||||
tags
|
tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1610,6 +1623,13 @@ module ApplicationHelper
|
||||||
|
|
||||||
def render_dynamic_nav
|
def render_dynamic_nav
|
||||||
home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index'}
|
home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index'}
|
||||||
|
home_link = "<li>" << home_link << "</li>"
|
||||||
|
bootstrap_render_dynamic_nav
|
||||||
|
content_tag :ul, (home_link.html_safe+bootstrap_render_dynamic_nav)
|
||||||
|
end
|
||||||
|
|
||||||
|
def bootstrap_render_dynamic_nav
|
||||||
|
|
||||||
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
|
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
|
||||||
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
|
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
|
||||||
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.contest_domain}
|
main_contest_link = link_to l(:label_contest_innovate), {:controller => 'welcome', :action => 'index', :host => Setting.contest_domain}
|
||||||
|
@ -1630,7 +1650,6 @@ module ApplicationHelper
|
||||||
|
|
||||||
#@nav_dispaly_project_label
|
#@nav_dispaly_project_label
|
||||||
nav_list = Array.new
|
nav_list = Array.new
|
||||||
nav_list.push(home_link) if !@nav_dispaly_home_path_label
|
|
||||||
nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label
|
nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label
|
||||||
nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label
|
nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label
|
||||||
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label
|
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label
|
||||||
|
@ -1651,7 +1670,7 @@ module ApplicationHelper
|
||||||
nav_list.collect do |nav_item|
|
nav_list.collect do |nav_item|
|
||||||
content_li << content_tag(:li, nav_item)
|
content_li << content_tag(:li, nav_item)
|
||||||
end
|
end
|
||||||
content_tag :ul, content_li.html_safe
|
content_li.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_user
|
def current_user
|
||||||
|
@ -1666,5 +1685,20 @@ module ApplicationHelper
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
def footer_logo(ul_class=nil, li_class=nil)
|
||||||
|
logos = []
|
||||||
|
logos.push(link_to image_tag('/images/footer_logo/nudt.png',:alt=>"nudt"),"http://www.nudt.edu.cn/special.asp?classid=12" )
|
||||||
|
logos.push(link_to image_tag('/images/footer_logo/peking_eecs.png', :alt=>"peking_eecs"), "http://eecs.pku.edu.cn" )
|
||||||
|
logos.push(link_to image_tag('/images/footer_logo/buaa_scse.png', :alt=>"buaa_scse"), "http://scse.buaa.edu.cn/" )
|
||||||
|
logos.push(link_to image_tag('/images/footer_logo/iscas.png', :alt=>"iscas"), "http://www.iscas.ac.cn" )
|
||||||
|
logos.push(link_to image_tag('/images/footer_logo/inforbus.png', :alt=>"inforbus"), "http://www.inforbus.com" )
|
||||||
|
|
||||||
|
logos.collect! { |logo|
|
||||||
|
content_tag(:li, logo.html_safe, :class => li_class.to_s)
|
||||||
|
}
|
||||||
|
|
||||||
|
content_tag(:ul, logos.join("").html_safe, :class => ul_class.to_s).html_safe
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,12 +59,11 @@ module IssuesHelper
|
||||||
|
|
||||||
def issue_heading(issue)
|
def issue_heading(issue)
|
||||||
#h("#{issue.tracker} ##{issue.id}")
|
#h("#{issue.tracker} ##{issue.id}")
|
||||||
#h("#{issue.tracker} #{issue.source_from}")
|
# h("#{issue.tracker} #{issue.source_from}")
|
||||||
s = ''
|
s = ''
|
||||||
s << ">>"
|
s << link_to(@issue.project.name, project_issues_path(@issue.project))
|
||||||
s << link_to(@issue.project.name+l(:issue_list), project_issues_path(@issue.project))
|
s << " > #"
|
||||||
s << " >"
|
s << @issue.project_index
|
||||||
s << @issue.source_from
|
|
||||||
s.html_safe
|
s.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -46,4 +46,12 @@ module OpenSourceProjectsHelper
|
||||||
end
|
end
|
||||||
description
|
description
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show_description_of_bug(bug)
|
||||||
|
description = bug.description
|
||||||
|
if description.nil? || description == ''
|
||||||
|
description = bug.open_source_project.name + l(:label_bug)
|
||||||
|
end
|
||||||
|
description
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,4 +5,8 @@ class BugToOsp < ActiveRecord::Base
|
||||||
|
|
||||||
validates_presence_of :osp_id, :relative_memo_id
|
validates_presence_of :osp_id, :relative_memo_id
|
||||||
|
|
||||||
|
scope :visible, lambda {|*args|
|
||||||
|
nil
|
||||||
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1156,7 +1156,11 @@ class Issue < ActiveRecord::Base
|
||||||
# back string obj which is belong to project.
|
# back string obj which is belong to project.
|
||||||
def source_from
|
def source_from
|
||||||
"" << self.project.name.to_s <<
|
"" << self.project.name.to_s <<
|
||||||
"#" << (self.project.issues.index(self).to_i + 1).to_s
|
"#" << project_index
|
||||||
|
end
|
||||||
|
|
||||||
|
def project_index
|
||||||
|
(self.project.issues.index(self).to_i + 1).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -70,6 +70,11 @@ class RelativeMemo < ActiveRecord::Base
|
||||||
def cannot_reply_to_locked_topic
|
def cannot_reply_to_locked_topic
|
||||||
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def short_content(length = 25)
|
||||||
|
str = "^(.{,#{length}})[^\n\r]*.*$"
|
||||||
|
content.gsub(Regexp.new(str), '\1...').strip if content
|
||||||
|
end
|
||||||
|
|
||||||
# def update_memos_forum
|
# def update_memos_forum
|
||||||
# if forum_id_changed?
|
# if forum_id_changed?
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
<% if User.current.admin? %>
|
||||||
|
<div class="contextual">
|
||||||
|
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3><%= l(:label_user_plural)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
<%= l(:label_filter_plural) %>
|
||||||
|
</legend>
|
||||||
|
<label for='status'><%= l(:field_status) %>:</label>
|
||||||
|
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
|
||||||
|
|
||||||
|
<% if @groups.present? %>
|
||||||
|
<label for='group_id'><%= l(:label_group) %>:</label>
|
||||||
|
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<label for='name'><%= l(:label_user) %>:</label>
|
||||||
|
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||||
|
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
|
||||||
|
</fieldset>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="autoscroll">
|
||||||
|
<table class="list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
||||||
|
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
||||||
|
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
||||||
|
<%= sort_header_tag('mail', :caption => l(:field_mail)) %>
|
||||||
|
|
||||||
|
<%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %>
|
||||||
|
<%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %>
|
||||||
|
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% for user in @users -%>
|
||||||
|
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
|
||||||
|
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
|
||||||
|
<td class="firstname"><%= h(user.firstname) %></td>
|
||||||
|
<td class="lastname"><%= h(user.lastname) %></td>
|
||||||
|
<td class="email"><%= mail_to(h(user.mail)) %></td>
|
||||||
|
<td align="center"><%= checked_image user.admin? %></td>
|
||||||
|
<td class="created_on" align="center"><%= format_time(user.created_on) %></td>
|
||||||
|
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
||||||
|
<td class="buttons"> <%= change_status_link(user) %>
|
||||||
|
<%= delete_link user_path(user, :back_url => users_path(params)) unless User.current == user %> </td>
|
||||||
|
</tr>
|
||||||
|
<% end -%>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="pagination">
|
||||||
|
<ul>
|
||||||
|
<%= pagination_links_full @user_pages, @user_count %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% html_title(l(:label_user_plural)) -%>
|
||||||
|
<%else %>
|
||||||
|
|
||||||
|
<% end%>
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
|
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
|
||||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
|
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
|
||||||
<%= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
<div id="footer" class="muted ">
|
||||||
|
<div style="border-top:solid 1px #C6E9F1;"></div>
|
||||||
|
<div class="desc center block-inline">
|
||||||
|
主办单位:
|
||||||
|
<%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47"%>
|
||||||
|
<%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41"%>
|
||||||
|
<%= link_to "联系我们","http://forge.trustie.net/projects/2/member"%>
|
||||||
|
<%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%>
|
||||||
|
</div>
|
||||||
|
<div class="center">
|
||||||
|
2007~2014
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= footer_logo("center ul-style-none", "float-left") %>
|
||||||
|
|
||||||
|
<div class="debug">
|
||||||
|
<%= debug(params) if Rails.env.development? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,82 @@
|
||||||
|
<%
|
||||||
|
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
|
||||||
|
realUrl = request.original_url
|
||||||
|
if (realUrl.match(/forge\.trustie\.net\/*/))
|
||||||
|
@nav_dispaly_project_label = 1
|
||||||
|
@nav_dispaly_forum_label = 1
|
||||||
|
elsif (realUrl.match(/course\.trustie\.net\/*/))
|
||||||
|
@nav_dispaly_course_all_label = 1
|
||||||
|
@nav_dispaly_forum_label = 1
|
||||||
|
@nav_dispaly_course_label = nil
|
||||||
|
@nav_dispaly_store_all_label = 1
|
||||||
|
elsif (realUrl.match(/user\.trustie\.net\/*/))
|
||||||
|
@nav_dispaly_home_path_label = 1
|
||||||
|
@nav_dispaly_main_course_label = 1
|
||||||
|
@nav_dispaly_main_project_label = 1
|
||||||
|
@nav_dispaly_main_contest_label = 1
|
||||||
|
elsif (realUrl.match(/contest\.trustie\.net\/*/))
|
||||||
|
@nav_dispaly_contest_label = 1
|
||||||
|
@nav_dispaly_store_all_label = 1
|
||||||
|
else
|
||||||
|
@nav_dispaly_project_all_label = 1
|
||||||
|
@nav_dispaly_course_all_label = 1
|
||||||
|
@nav_dispaly_forum_label = 1
|
||||||
|
@nav_dispaly_bid_label = 1
|
||||||
|
@nav_dispaly_contest_label = 1
|
||||||
|
@nav_dispaly_store_all_label = 1
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
|
||||||
|
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||||
|
<div class="container">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<%=link_to image_tag("/images/logo5.png", class: 'navbar-brand', style:"width: 50px; height: 50px; padding:4px"), '/' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||||
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<%= bootstrap_render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
|
||||||
|
<li class="dropdown hidden">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="#">Action</a></li>
|
||||||
|
<li><a href="#">Another action</a></li>
|
||||||
|
<li><a href="#">Something else here</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><a href="#">Separated link</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><a href="#">One more separated link</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<form class="navbar-form navbar-left hidden" role="search">
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="text" class="form-control" placeholder="Search">
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-default">Submit</button>
|
||||||
|
</form>
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<li class="dropdown <%= "hidden" unless User.current.logged? %>">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%></li>
|
||||||
|
<li><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %></li>
|
||||||
|
<li><%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<%= bootstrap_render_menu :account_menu -%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="<%= current_language %>">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<title><%= h html_title %></title>
|
||||||
|
<meta name="description" content="<%= Redmine::Info.app_name %>"/>
|
||||||
|
<meta name="keywords" content="issue,bug,tracker"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<%= csrf_meta_tag %>
|
||||||
|
<%= favicon %>
|
||||||
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'bootstrap_custom.css', :media => 'all' %>
|
||||||
|
<%= javascript_heads %>
|
||||||
|
<%#= javascript_include_tag "jquery.leanModal.min" %>
|
||||||
|
<%= bootstrap_head %>
|
||||||
|
<%= javascript_include_tag 'gas' %>
|
||||||
|
<%= yield :header_tags -%>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<%= render :partial => 'layouts/bootstrap_base_header' %>
|
||||||
|
<div class="container">
|
||||||
|
<%= render_flash_messages %>
|
||||||
|
<%= yield %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
||||||
|
<div id="ajax-modal" style="display:none;"></div>
|
||||||
|
<%= render :partial => 'layouts/bootstrap_base_footer' %>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,80 @@
|
||||||
|
<!--added by fq -->
|
||||||
|
<!--display the board-->
|
||||||
|
|
||||||
|
<div class="borad-topic-count" style="margin-top:10px">
|
||||||
|
<span>共有 <%= link_to @topic_count %> 个贴子 </span>
|
||||||
|
</div>
|
||||||
|
<div style="padding-top: 10px">
|
||||||
|
<% if memos.any? %>
|
||||||
|
<% memos.each do |topic| %>
|
||||||
|
<table class="content-text-list">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%>
|
||||||
|
<%= image_tag('../images/avatars/User/0', :class => "avatar") unless topic.author%> </td>
|
||||||
|
<td>
|
||||||
|
<table width="630px" border="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
|
||||||
|
<% if topic.url.nil? || topic.url == '' %>
|
||||||
|
<%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to h(topic.subject), topic.url, :target => '_blank' %>
|
||||||
|
<% end %></td>
|
||||||
|
<td align="right" rowspan="3">
|
||||||
|
<table class="borad-count">
|
||||||
|
<tr>
|
||||||
|
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), topic.url, :target => '_blank' %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center">回帖</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
|
||||||
|
<td align="right" rowspan="3">
|
||||||
|
<table class="borad-count">
|
||||||
|
<tr>
|
||||||
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center">关注</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
|
||||||
|
<td align="right" rowspan="3">
|
||||||
|
<table class="borad-count">
|
||||||
|
<tr>
|
||||||
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center">浏览</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="font_description"><%= topic.short_content(70) %> </span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left"><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
|
||||||
|
<br />
|
||||||
|
</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to topic.topic_resource, topic.url, :target => '_blank' %>
|
||||||
|
</span></td>
|
||||||
|
<td colspan="3" align="center"><%= no_use_link(topic, User.current) %> </td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<div class="pagination">
|
||||||
|
<%= pagination_links_full @topic_pages, @topic_count %>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<p class="nodata">
|
||||||
|
<%= l(:label_no_data) %>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -2,7 +2,7 @@
|
||||||
<!--display the board-->
|
<!--display the board-->
|
||||||
|
|
||||||
<div class="borad-topic-count" style="margin-top:10px">
|
<div class="borad-topic-count" style="margin-top:10px">
|
||||||
<span>共有 <%= link_to memos.count %> 个贴子 </span
|
<span>共有 <%= link_to @topic_count %> 个贴子 </span>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top: 10px">
|
<div style="padding-top: 10px">
|
||||||
<% if memos.any? %>
|
<% if memos.any? %>
|
||||||
|
@ -18,12 +18,12 @@
|
||||||
<% if topic.url.nil? || topic.url == '' %>
|
<% if topic.url.nil? || topic.url == '' %>
|
||||||
<%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %>
|
<%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to h(topic.subject), topic.url %>
|
<%= link_to h(topic.subject), topic.url, :target => '_blank' %>
|
||||||
<% end %></td>
|
<% end %></td>
|
||||||
<td align="right" rowspan="3">
|
<td align="right" rowspan="3">
|
||||||
<table class="borad-count">
|
<table class="borad-count">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), open_source_project_relative_memo_path(open_source_project, topic) %></td>
|
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), topic.url, :target => '_blank' %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">回帖</td>
|
<td align="center">回帖</td>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<td align="right" rowspan="3">
|
<td align="right" rowspan="3">
|
||||||
<table class="borad-count">
|
<table class="borad-count">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %></td>
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">关注</td>
|
<td align="center">关注</td>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<td align="right" rowspan="3">
|
<td align="right" rowspan="3">
|
||||||
<table class="borad-count">
|
<table class="borad-count">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %></td>
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">浏览</td>
|
<td align="center">浏览</td>
|
||||||
|
@ -51,17 +51,16 @@
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" ><span class="font_description"> </span></td>
|
<td><span class="font_description"> </span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" colspan="2" ><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
|
<td align="left"><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
|
||||||
<br />
|
<br />
|
||||||
</span></td>
|
</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
|
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
|
||||||
</span></td>
|
</span></td>
|
||||||
<td align="left"><%= no_use_link(topic, User.current) %> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<%= javascript_include_tag "ichart.1.2.min" %>
|
<%= javascript_include_tag "ichart.1.2.min" %>
|
||||||
<%= stylesheet_link_tag "sec-analysis.css" %>
|
<%= stylesheet_link_tag "sec-analysis.css" %>
|
||||||
<%= stylesheet_link_tag "buglist-ichart.css" %>
|
<%= stylesheet_link_tag "buglist-ichart.css" %>
|
||||||
<%= stylesheet_link_tag "buglist.css" %>
|
<%= stylesheet_link_tag "buglist.css" %>
|
||||||
|
|
||||||
|
|
||||||
<div class="mask">
|
<div class="mask">
|
||||||
<div class="header2"></div>
|
<div class="header2"></div>
|
||||||
<div class="colleft">
|
<div class="colleft">
|
||||||
|
@ -20,33 +21,63 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col2" style="margin-left:0px">
|
<div class="col2" style="margin-left:0px">
|
||||||
<div style="margin-left:0px" > <span> <h1 style="fontsize:19px;color:orange;font-weight:900">项目安全态势 </h1></span><span style="margin-top: -30px; margin-right:70px;float: right; display: block;"><%= link_to "更多 >>", :controller => "open_source_projects",:action => "showmemo", :id => @open_source_project.id %></span></div>
|
<div style="margin-left:0px" > <span> <h1 style="fontsize:19px;color:orange;font-weight:900">项目安全态势 </h1></span><span style="margin-top: -30px; margin-right:70px;float: right; display: block;"><%= link_to "更多 >>", :controller => "open_source_projects",:action => "showbug", :id => @open_source_project.id %></span></div>
|
||||||
|
|
||||||
|
<% if @open_source_project.id ==42 then %>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
<img src="/images/version_marker.png" alt="Tags">
|
||||||
|
</span>
|
||||||
|
<span class="tag_fouse">聚焦:</span>
|
||||||
|
<div id="tag">栈溢出</div>
|
||||||
|
<div id="tag">远程权限</div>
|
||||||
|
<div id="tag">框架安全</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% elsif @open_source_project.id ==70 then %>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
<img src="/images/version_marker.png" alt="Tags">
|
||||||
|
</span>
|
||||||
|
<span class="tag_fouse">聚焦:</span>
|
||||||
|
<div id="tag">Kernel安全</div>
|
||||||
|
<div id="tag">函数漏洞</div>
|
||||||
|
<div id="tag">ping_init_sock()</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% elsif @open_source_project.id ==17 then %>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
<img src="/images/version_marker.png" alt="Tags">
|
||||||
|
</span>
|
||||||
|
<span class="tag_fouse">聚焦:</span>
|
||||||
|
<div id="tag">Heartbleed</div>
|
||||||
|
<div id="tag">致命漏洞</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% elsif @open_source_project.id ==55 then %>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
<img src="/images/version_marker.png" alt="Tags">
|
||||||
|
</span>
|
||||||
|
<span class="tag_fouse">聚焦:</span>
|
||||||
|
<div id="tag">DDos攻击</div>
|
||||||
|
<div id="tag">信息泄露</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%end%>
|
||||||
|
|
||||||
<div class="fixed"></div>
|
<div class="fixed"></div>
|
||||||
<div class="li_list" style="margin-top:10px;margin-left:10px">
|
<div class="li_list" style="margin-top:10px;margin-left:10px">
|
||||||
<ul style="list-style-type: square;">
|
<ul style="list-style-type: square;">
|
||||||
<% @bugs.each do |bug| %>
|
<% @bugs.each do |bug| %>
|
||||||
<li><span class="li_time">>[<%= show_description(bug, open_source_project) %>]</span><%= link_to bug.subject, bug.url %></li>
|
<li><span class="li_time">>[<%= show_description(bug, open_source_project) %>]</span><%= link_to bug.subject, bug.url, :target => '_blank' %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- <li><span class="li_time">>[DDoS漏洞]</span><a href="/vuldb/ssvid-62261" title="Cobbler 2.4.x - 2.6.x 本地文件包含">Cobbler 2.4.x - 2.6.x 本地文件包含</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">>[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62260" title="Ruby OpenSSL CA私钥伪造漏洞">Ruby OpenSSL CA私钥伪造漏洞</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">>[远程溢出漏洞]</span><a href="/vuldb/ssvid-62259" title="Adobe Flash Player 整数堆栈下溢远程命令执行">Adobe Flash Player 远程命令执行</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">14-05-07</span><a href="/vuldb/ssvid-62258" title="PHPDISK phpdisk_del_process.php SQL注入漏洞">PHPDISK phpdisk_del_process.php SQL注入漏洞</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62257" title="BEESCMS 3.4 order_save.php SQL注入漏洞">BEESCMS 3.4 order_save.php SQL注入漏洞</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li ><span class="li_time">>[SQL注入漏洞]</span><a href="/vuldb/ssvid-62256" title="Apache/NGINX 下 PHP-FPM 或者 PHP-CGI 拒绝服务漏洞">Apache/NGINX 下 PHP-FPM </a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">>[SQL注入漏洞]</span><a href="/vuldb/ssvid-62250" title="AlienVault OSSIM SQL注入以及远程代码执行">AlienVault OSSIM SQL注入</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">>[DDoS漏洞]</span><a href="/vuldb/ssvid-62248" title="Eucalyptus Web Services拒绝服务漏洞">Eucalyptus Web Services</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li ><span class="li_time">>[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62245" title="Watchguard Fireware XTM OpenSSL TLS心跳信息泄漏漏洞"> Fireware XTM OpenSSL TLS</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li ><span class="li_time">>[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62244" title="SAP Sybase SQL Anywhere OpenSSL TLS泄漏漏洞">Sybase SQL Anywhere OpenSSL TLS</a></li> -->
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,8 +92,6 @@
|
||||||
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
|
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var data = [
|
var data = [
|
||||||
{
|
{
|
||||||
name :'',
|
name :'',
|
||||||
|
@ -127,7 +156,7 @@
|
||||||
parseText:function(tip,name,value,text,i){
|
parseText:function(tip,name,value,text,i){
|
||||||
return name+"漏洞数:"+value;
|
return name+"漏洞数:"+value;
|
||||||
}
|
}
|
||||||
} ,
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
tipMocker:function(tips,i){
|
tipMocker:function(tips,i){
|
||||||
|
@ -143,18 +172,7 @@
|
||||||
labels[index]+" "+//日期
|
labels[index]+" "+//日期
|
||||||
((i%12)==0?"1 月":((i%12+1))+"月")+ //时间
|
((i%12)==0?"1 月":((i%12+1))+"月")+ //时间
|
||||||
"</div>"+tips.join("<br/>");
|
"</div>"+tips.join("<br/>");
|
||||||
},
|
},
|
||||||
|
|
||||||
// legend : {
|
|
||||||
// enable : true,
|
|
||||||
// row:1,//设置在一行上显示,与column配合使用
|
|
||||||
// column : 'max',
|
|
||||||
// valign:'top',
|
|
||||||
// sign:'bar',
|
|
||||||
// background_color:null,//设置透明背景
|
|
||||||
// offsetx:-80,//设置x轴偏移,满足位置需要
|
|
||||||
// border : true
|
|
||||||
// },
|
|
||||||
crosshair:{
|
crosshair:{
|
||||||
enable:true, //十字交叉线
|
enable:true, //十字交叉线
|
||||||
line_color:'#62bce9'
|
line_color:'#62bce9'
|
||||||
|
@ -194,8 +212,7 @@
|
||||||
start_scale:0,
|
start_scale:0,
|
||||||
scale_space:50,
|
scale_space:50,
|
||||||
end_scale:70,
|
end_scale:70,
|
||||||
scale_color:'#9f9f9f',
|
scale_color:'#9f9f9f'
|
||||||
// label : {color:'#ffffff',fontsize:11},
|
|
||||||
|
|
||||||
},{
|
},{
|
||||||
position:'bottom',
|
position:'bottom',
|
||||||
|
@ -203,35 +220,10 @@
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//开始画图
|
|
||||||
|
|
||||||
/**
|
|
||||||
*自定义组件,画平均线。
|
|
||||||
*/
|
|
||||||
// line.plugin(new iChart.Custom({
|
|
||||||
// drawFn:function(){
|
|
||||||
// /**
|
|
||||||
// *计算平均值的高度(坐标Y值)
|
|
||||||
// *计算高度还不会! 会划线了!
|
|
||||||
// */
|
|
||||||
// // var avg = line.total/5,
|
|
||||||
// // coo = line.getCoordinate(),
|
|
||||||
// // x = coo.get('originx'),
|
|
||||||
// // W = coo.width,
|
|
||||||
// // S = coo.getScale('left'),
|
|
||||||
// // H = coo.height,
|
|
||||||
// // h = (avg - S.start) * H / S.distance,
|
|
||||||
// // y = line.y + H - h;
|
|
||||||
// line.target.line(28,97,400,97,2,'#b32c0d')
|
|
||||||
// .textAlign('start')
|
|
||||||
// .textBaseline('middle')
|
|
||||||
// .textFont('600 12px Verdana');
|
|
||||||
// }
|
|
||||||
// }));
|
|
||||||
line.draw();
|
line.draw();
|
||||||
});
|
});
|
||||||
|
|
||||||
//]]>
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--我是分割线1===================================================================================================!-->
|
<!--我是分割线1===================================================================================================!-->
|
||||||
|
@ -282,10 +274,7 @@
|
||||||
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
|
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var data = [
|
||||||
|
|
||||||
|
|
||||||
var data = [
|
|
||||||
{
|
{
|
||||||
name : '',
|
name : '',
|
||||||
value:flow,
|
value:flow,
|
||||||
|
@ -297,16 +286,9 @@
|
||||||
|
|
||||||
//创建x轴标签文本
|
//创建x轴标签文本
|
||||||
var date = new Date()
|
var date = new Date()
|
||||||
|
|
||||||
var labels = [];
|
var labels = [];
|
||||||
/* labels.push(date.getFullYear()-2);
|
|
||||||
labels.push(date.getFullYear()-1);
|
|
||||||
labels.push(date.getFullYear());
|
|
||||||
labels.push(date.getFullYear()+1);*/
|
|
||||||
|
|
||||||
labels=["2012","","","","","","","","","","","","2013","","","","","","","","","","","","2014","","","",""];
|
labels=["2012","","","","","","","","","","","","2013","","","","","","","","","","","","2014","","","",""];
|
||||||
|
|
||||||
|
|
||||||
var line = new iChart.LineBasic2D({
|
var line = new iChart.LineBasic2D({
|
||||||
render : 'canvasDiv2',
|
render : 'canvasDiv2',
|
||||||
data: data,
|
data: data,
|
||||||
|
@ -352,7 +334,7 @@
|
||||||
parseText:function(tip,name,value,text,i){
|
parseText:function(tip,name,value,text,i){
|
||||||
return name+"帖子数:"+value+"万";
|
return name+"帖子数:"+value+"万";
|
||||||
}
|
}
|
||||||
} ,
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
tipMocker:function(tips,i){
|
tipMocker:function(tips,i){
|
||||||
|
@ -378,10 +360,9 @@
|
||||||
label:false, //是否显示数值
|
label:false, //是否显示数值
|
||||||
// hollow_inside:false,
|
// hollow_inside:false,
|
||||||
smooth : true,//平滑曲线
|
smooth : true,//平滑曲线
|
||||||
point_size:2, // 焦点大小
|
point_size:2 // 焦点大小
|
||||||
// point_hollow : true,
|
// point_hollow : true,
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
coordinate:{
|
coordinate:{
|
||||||
width:225, // 图表大小
|
width:225, // 图表大小
|
||||||
|
@ -404,7 +385,7 @@
|
||||||
start_scale:0,
|
start_scale:0,
|
||||||
scale_space:50,
|
scale_space:50,
|
||||||
end_scale:70,
|
end_scale:70,
|
||||||
scale_color:'#9f9f9f',
|
scale_color:'#9f9f9f'
|
||||||
// label : {color:'#ffffff',fontsize:11},
|
// label : {color:'#ffffff',fontsize:11},
|
||||||
|
|
||||||
},{
|
},{
|
||||||
|
@ -435,11 +416,11 @@
|
||||||
<td>
|
<td>
|
||||||
<table width="630px" border="0">
|
<table width="630px" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), topic.url %></td>
|
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), topic.url, :target => '_blank' %></td>
|
||||||
<td align="right" rowspan="3">
|
<td align="right" rowspan="3">
|
||||||
<table class="borad-count">
|
<table class="borad-count">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), open_source_project_relative_memo_path(open_source_project, topic) %></td>
|
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), topic.url, :target => '_blank' %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">回帖</td>
|
<td align="center">回帖</td>
|
||||||
|
@ -449,7 +430,7 @@
|
||||||
<td align="right" rowspan="3">
|
<td align="right" rowspan="3">
|
||||||
<table class="borad-count">
|
<table class="borad-count">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %></td>
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">关注</td>
|
<td align="center">关注</td>
|
||||||
|
@ -459,7 +440,7 @@
|
||||||
<td align="right" rowspan="3">
|
<td align="right" rowspan="3">
|
||||||
<table class="borad-count">
|
<table class="borad-count">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), open_source_project_relative_memo_path(open_source_project, topic) %></td>
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">浏览</td>
|
<td align="center">浏览</td>
|
||||||
|
@ -467,17 +448,16 @@
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" ><span class="font_description"> </span></td>
|
<td><span class="font_description"> </span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- <tr>
|
<tr>
|
||||||
<td align="left" colspan="2" ><span class="font_lighter"><%#= authoring topic.created_at, topic.author %>
|
<td align="left"><span class="font_lighter"><%=user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
|
||||||
<br />
|
<br />
|
||||||
</span></td>
|
</span></td>
|
||||||
</tr> -->
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
|
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
|
||||||
</span></td>
|
</span></td>
|
||||||
<td align="left"><%= no_use_link(topic, User.current) %> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
<!-- added by fq -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div style="width: 940px">
|
||||||
|
|
||||||
|
<div class="borad-topic-count" style="margin-top:10px; width: 600px">
|
||||||
|
<span>共有 <%= link_to @bug_count %> 个安全贴子 </span>
|
||||||
|
</div>
|
||||||
|
<div style="padding-top: 10px ;width: 940px">
|
||||||
|
<% if @bugs.any? %>
|
||||||
|
<% @bugs.each do |bug| %>
|
||||||
|
<% topic = bug.bug %>
|
||||||
|
<table style="width: 940px" class="content-text-list">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%>
|
||||||
|
<%= image_tag('../images/avatars/User/0', :class => "avatar") unless topic.author%> </td>
|
||||||
|
<td>
|
||||||
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top" width="700px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
|
||||||
|
<% if topic.url.nil? || topic.url == '' %>
|
||||||
|
<%= link_to h(topic.subject), open_source_project_relative_memo_path(bug.open_source_project, topic) %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to h(topic.subject), topic.url, :target => '_blank' %>
|
||||||
|
<% end %></td>
|
||||||
|
<td align="right" rowspan="3">
|
||||||
|
<table class="borad-count">
|
||||||
|
<tr>
|
||||||
|
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), topic.url, :target => '_blank' %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center">回帖</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
|
||||||
|
<td align="right" rowspan="3">
|
||||||
|
<table class="borad-count">
|
||||||
|
<tr>
|
||||||
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center">关注</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
|
||||||
|
<td align="right" rowspan="3">
|
||||||
|
<table class="borad-count">
|
||||||
|
<tr>
|
||||||
|
<td align="center" class="borad-count-digit"><%= link_to (topic.viewed_count_crawl+topic.viewed_count_local), topic.url, :target => '_blank' %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center">浏览</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="font_description"> <%= topic.short_content(100) %></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left"><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
|
||||||
|
<br />
|
||||||
|
</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to topic.topic_resource, topic.url, :target => '_blank' %>
|
||||||
|
</span></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<div class="pagination">
|
||||||
|
<%= pagination_links_full @bug_pages, @bug_count %>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<p class="nodata">
|
||||||
|
<%= l(:label_no_data) %>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%#= render :partial => 'open_source_projects/show_memo', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
|
||||||
|
</div>
|
|
@ -48,7 +48,7 @@
|
||||||
background-position: -266px 3px;
|
background-position: -266px 3px;
|
||||||
}
|
}
|
||||||
.navigation .icon-search, .navigation .nav-pill-cancle, .navigation .nav-switch-icon, .navigation .nav-topbar .topbar-search .topbar-submit, .navigation .nav-topbar-arror {
|
.navigation .icon-search, .navigation .nav-pill-cancle, .navigation .nav-switch-icon, .navigation .nav-topbar .topbar-search .topbar-submit, .navigation .nav-topbar-arror {
|
||||||
background: url();
|
/*background: url()*/
|
||||||
}
|
}
|
||||||
.nav-switch-icon {
|
.nav-switch-icon {
|
||||||
width: 15px;
|
width: 15px;
|
||||||
|
@ -129,8 +129,6 @@ li {
|
||||||
.nav-search-con{
|
.nav-search-con{
|
||||||
padding-top: 7px;
|
padding-top: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<%= javascript_include_tag "ichart.1.2.min" %>
|
<%= javascript_include_tag "ichart.1.2.min" %>
|
||||||
<%= stylesheet_link_tag "buglist-div-use.css" %>
|
<%= stylesheet_link_tag "buglist-div-use.css" %>
|
||||||
|
@ -146,29 +144,13 @@ li {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col2">
|
<div class="col2">
|
||||||
<div> <span> <h1 style="fontsize:19px">软件安全漏洞 </h1></span><span style="margin-top: -30px; margin-right:70px;float: right; display: block;"><a href="#" hover="text-decoration: underline;" >More >></span></a></div>
|
<div> <span> <h1 style="fontsize:19px">软件安全态势</h1></span><span style="margin-top: -30px; margin-right:70px;float: right; display: block;"><%= link_to '更多 >>', allbug_open_source_projects_path %></span></div>
|
||||||
<div class="fixed"></div>
|
<div class="fixed"></div>
|
||||||
<div id ="buglist" class="li_list" style="margin-top:10px;margin-left:10px">
|
<div class="li_list" style="margin-top:10px;margin-left:10px">
|
||||||
<ul style="list-style-type: square;">
|
<ul style="list-style-type: square;">
|
||||||
<li><span class="li_time">[DDoS漏洞]</span><a href="/vuldb/ssvid-62261" title="Cobbler 2.4.x - 2.6.x 本地文件包含">Cobbler 2.4.x - 2.6.x 本地文件包含</a></li>
|
<% @bugs.each do |bug| %>
|
||||||
|
<li style="width:400px;"><span class="li_time">[<%= show_description_of_bug(bug) %>]</span><%= link_to bug.bug.subject, bug.bug.url, :target => '_blank' %></li>
|
||||||
<li><span class="li_time">[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62260" title="Ruby OpenSSL CA私钥伪造漏洞">Ruby OpenSSL CA私钥伪造漏洞</a></li>
|
<% end %>
|
||||||
|
|
||||||
<li style="color: red"><span class="li_time">[远程溢出漏洞]</span><a href="/vuldb/ssvid-62259" title="Adobe Flash Player 整数堆栈下溢远程命令执行">Adobe Flash Player 整数堆栈下溢远程命令执行</a></li>
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">14-05-07</span><a href="/vuldb/ssvid-62258" title="PHPDISK phpdisk_del_process.php SQL注入漏洞">PHPDISK phpdisk_del_process.php SQL注入漏洞</a></li> -->
|
|
||||||
|
|
||||||
<!-- <li><span class="li_time">[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62257" title="BEESCMS 3.4 order_save.php SQL注入漏洞">BEESCMS 3.4 order_save.php SQL注入漏洞</a></li> -->
|
|
||||||
|
|
||||||
<li ><span class="li_time">[SQL注入漏洞]</span><a href="/vuldb/ssvid-62256" title="Apache/NGINX 下 PHP-FPM 或者 PHP-CGI 拒绝服务漏洞">Apache/NGINX 下 PHP-FPM 拒绝服务漏洞</a></li>
|
|
||||||
|
|
||||||
<li><span class="li_time">[SQL注入漏洞]</span><a href="/vuldb/ssvid-62250" title="AlienVault OSSIM SQL注入以及远程代码执行">AlienVault OSSIM SQL注入以及远程代码执行</a></li>
|
|
||||||
|
|
||||||
<li><span class="li_time">[DDoS漏洞]</span><a href="/vuldb/ssvid-62248" title="Eucalyptus Web Services拒绝服务漏洞">Eucalyptus Web Services拒绝服务漏洞</a></li>
|
|
||||||
|
|
||||||
<li ><span class="li_time">[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62245" title="Watchguard Fireware XTM OpenSSL TLS心跳信息泄漏漏洞">Watchguard Fireware XTM OpenSSL TLS心跳...</a></li>
|
|
||||||
|
|
||||||
<li style="color: red"><span class="li_time">[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62244" title="SAP Sybase SQL Anywhere OpenSSL TLS泄漏漏洞">SAP Sybase SQL Anywhere OpenSSL TLS</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -236,7 +218,7 @@ li {
|
||||||
parseText:function(tip,name,value,text,i){
|
parseText:function(tip,name,value,text,i){
|
||||||
return name+"漏洞数:"+value;
|
return name+"漏洞数:"+value;
|
||||||
}
|
}
|
||||||
} ,
|
}
|
||||||
},
|
},
|
||||||
tipMocker:function(tips,i){
|
tipMocker:function(tips,i){
|
||||||
var index;
|
var index;
|
||||||
|
@ -272,7 +254,7 @@ li {
|
||||||
label:false, //是否显示数值
|
label:false, //是否显示数值
|
||||||
// hollow_inside:false,
|
// hollow_inside:false,
|
||||||
smooth : true,//平滑曲线
|
smooth : true,//平滑曲线
|
||||||
point_size:2, // 焦点大小
|
point_size:2 // 焦点大小
|
||||||
// point_hollow : true,
|
// point_hollow : true,
|
||||||
|
|
||||||
|
|
||||||
|
@ -298,7 +280,7 @@ li {
|
||||||
start_scale:0,
|
start_scale:0,
|
||||||
scale_space:50,
|
scale_space:50,
|
||||||
end_scale:70,
|
end_scale:70,
|
||||||
scale_color:'#9f9f9f',
|
scale_color:'#9f9f9f'
|
||||||
// label : {color:'#ffffff',fontsize:11},
|
// label : {color:'#ffffff',fontsize:11},
|
||||||
|
|
||||||
},{
|
},{
|
||||||
|
@ -417,7 +399,7 @@ line.target.line(28,97,400,97,2,'#b32c0d')
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-flexbox last">
|
<div class="nav-flexbox last">
|
||||||
<div class="nav-category">
|
<div class="nav-category">
|
||||||
<h4 title="上市时间">
|
<h4 title="上市时间"> </h4>
|
||||||
<div class="nav-category-wrap ">
|
<div class="nav-category-wrap ">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<!--modified by huang-->
|
<!--modified by huang-->
|
||||||
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
|
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
|
||||||
<span>
|
<span>
|
||||||
<%= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add',
|
<%#= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add',
|
||||||
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
|
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<!-- added by fq -->
|
||||||
|
<div id="add-memo" class='lz' style="display: none; padding: 20px;">
|
||||||
|
<h3><%=l(:label_memo_new)%></h3>
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<%= labelled_form_for(@memo, :url => open_source_project_relative_memos_path(@open_source_project), :html => {:multipart => true} ) do |f| %>
|
||||||
|
<% if @memo.errors.any? %>
|
||||||
|
<div id="error_explanation">
|
||||||
|
<h2><%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<% @memo.errors.full_messages.each do |msg| %>
|
||||||
|
<li><%= msg %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="actions" style="max-width:680px">
|
||||||
|
<p><%= f.text_field :subject, :required => true%></p>
|
||||||
|
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p>
|
||||||
|
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
|
||||||
|
<br/>
|
||||||
|
<p>
|
||||||
|
<%#= l(:label_attachment_plural) %><br />
|
||||||
|
<%#= render :partial => 'attachments/form', :locals => {:container => @memo} %>
|
||||||
|
</p>
|
||||||
|
<%= f.submit :value => l(:label_memo_create) %>
|
||||||
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="contextual-borad">
|
||||||
|
<%#= link_to(
|
||||||
|
image_tag('edit.png')+l(:label_forum_edit),
|
||||||
|
{:action => 'edit', :id => @forum},
|
||||||
|
:method => 'get',
|
||||||
|
:title => l(:button_edit)
|
||||||
|
) if @forum.editable_by?(User.current) %>
|
||||||
|
<%#= link_to(
|
||||||
|
image_tag('delete.png')+'删除讨论区',
|
||||||
|
{:action => 'destroy', :id => @forum},
|
||||||
|
:method => :delete,
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:title => l(:button_delete)
|
||||||
|
) if @forum.destroyable_by?(User.current) %>
|
||||||
|
</div>
|
||||||
|
<%= render :partial => 'open_source_projects/show_bug', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
|
||||||
|
</div>
|
|
@ -51,5 +51,6 @@
|
||||||
:title => l(:button_delete)
|
:title => l(:button_delete)
|
||||||
) if @forum.destroyable_by?(User.current) %>
|
) if @forum.destroyable_by?(User.current) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
<%= render :partial => 'open_source_projects/show_memo', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
|
<%= render :partial => 'open_source_projects/show_memo', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
|
||||||
</div>
|
</div>
|
|
@ -1,100 +1,100 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// $(this).ready(function(){
|
// $(this).ready(function(){
|
||||||
// $('.tag_show').hover(function() {
|
// $('.tag_show').hover(function() {
|
||||||
// $(this).children("span").show();
|
// $(this).children("span").show();
|
||||||
// }, function() {
|
// }, function() {
|
||||||
// $(this).children("span").hide();
|
// $(this).children("span").hide();
|
||||||
// });
|
// });
|
||||||
// })
|
// })
|
||||||
</script>
|
</script>
|
||||||
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求-->
|
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求-->
|
||||||
<% @tags = obj.reload.tag_list %>
|
<% @tags = obj.reload.tag_list %>
|
||||||
|
|
||||||
<% if non_list_all and (@tags.size > 0) %>
|
<% if non_list_all and (@tags.size > 0) %>
|
||||||
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
|
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
|
||||||
<% if @tags.size > Setting.show_tags_length.to_i then %>
|
<% if @tags.size > Setting.show_tags_length.to_i then %>
|
||||||
<% i = 0 %>
|
<% i = 0 %>
|
||||||
|
|
||||||
<% until i>Setting.show_tags_length.to_i do %>
|
<% until i>Setting.show_tags_length.to_i do %>
|
||||||
<div id="tag">
|
<div id="tag">
|
||||||
<%= link_to @tags[i], :controller => "tags",:action => "index",:q => @tags[i],:object_flag => object_flag,:obj_id => obj.id %>
|
<%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %>
|
||||||
</div>
|
</div>
|
||||||
<% i += 1%>
|
<% i += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= link_to l(:label_more_tags),:action => "show",:id => obj.id %>
|
<%= link_to l(:label_more_tags), :action => "show", :id => obj.id %>
|
||||||
|
|
||||||
|
<% else %>
|
||||||
|
|
||||||
|
<% @tags.each do |tag| %>
|
||||||
|
<div id="tag">
|
||||||
|
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
||||||
<% @tags.each do |tag| %>
|
<% if @tags.size > 0 %>
|
||||||
<div id="tag">
|
<% @tags.each do |tag| %>
|
||||||
<%= link_to tag,:controller => "tags",:action => "index",:q=>tag,:object_flag => object_flag,:obj_id => obj.id %>
|
<div id="tag">
|
||||||
</div>
|
<span class="tag_show"> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||||
<% end %>
|
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
|
||||||
|
<% case object_flag %>
|
||||||
<% end %>
|
<% when '1' %>
|
||||||
|
|
||||||
<% else %>
|
|
||||||
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
|
||||||
<% if @tags.size > 0 %>
|
|
||||||
<% @tags.each do |tag| %>
|
|
||||||
<div id="tag">
|
|
||||||
<span class="tag_show"> <%= link_to tag,:controller => "tags",:action => "index",:q=>tag ,:object_flag => object_flag,:obj_id => obj.id %>
|
|
||||||
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
|
|
||||||
<% case object_flag %>
|
|
||||||
<% when '1'%>
|
|
||||||
|
|
||||||
<% if User.current.eql?(obj) %>
|
<% if User.current.eql?(obj) %>
|
||||||
<span class='del'> <%= link_to 'x',:controller => "tags",:action => "remove_tag",:remote => true,:tag_name => tag,
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
:taggable_id => obj.id,:taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% when '2' %>
|
<% when '2' %>
|
||||||
|
|
||||||
<% if (ProjectInfo.find_by_project_id(obj.id)).user_id == User.current.id %>
|
<% if (ProjectInfo.find_by_project_id(obj.id)).user_id == User.current.id %>
|
||||||
<span class='del'> <%= link_to 'x',:controller => "tags",:action => "remove_tag",:remote => true,:tag_name => tag,
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
:taggable_id => obj.id,:taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% when '3' %>
|
<% when '3' %>
|
||||||
|
|
||||||
<% if (ProjectInfo.find_by_project_id(obj.project_id)).user_id == User.current.id %>
|
<% if (ProjectInfo.find_by_project_id(obj.project_id)).user_id == User.current.id %>
|
||||||
<span class='del'> <%= link_to 'x',:controller => "tags",:action => "remove_tag",:remote => true,:tag_name => tag,
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
:taggable_id => obj.id,:taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% when '4'%>
|
<% when '4' %>
|
||||||
<% if obj.author_id == User.current.id %>
|
<% if obj.author_id == User.current.id %>
|
||||||
|
|
||||||
<span class='del'> <%= link_to 'x',:controller => "tags",:action => "remove_tag",:remote => true,:tag_name => tag,
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
:taggable_id => obj.id,:taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% when '6'%>
|
<% when '6' %>
|
||||||
<% if ( User.current.logged? &&
|
<% if (User.current.logged? &&
|
||||||
User.current.admin?
|
User.current.admin?
|
||||||
# && (@project && User.current.member_of?(@project))
|
# && (@project && User.current.member_of?(@project))
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
<span class='del'> <%= link_to 'x',:controller => "tags",:action => "remove_tag",:remote => true,:tag_name => tag,
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
:taggable_id => obj.id,:taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% when '7'%>
|
<% when '7' %>
|
||||||
<% if obj.author_id == User.current.id %>
|
<% if obj.author_id == User.current.id %>
|
||||||
|
|
||||||
<span class='del'> <%= link_to 'x',:controller => "tags",:action => "remove_tag",:remote => true,:tag_name => tag,
|
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
|
||||||
:taggable_id => obj.id,:taggable_type => object_flag %> </span>
|
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span style="color:#8c8a8a">
|
<span style="color:#8c8a8a">
|
||||||
<%= l(:label_tags_no) %>
|
<%= l(:label_tags_no) %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
|
@ -0,0 +1 @@
|
||||||
|
<%= image_tag "http://image227.poco.cn/mypoco/myphoto/20140516/17/5527437020140516173219035.png", class: "img-responsive" %>
|
|
@ -1,42 +1,54 @@
|
||||||
<style type="text/css">
|
<div class="alert alert-success">
|
||||||
.courses_list{
|
<strong>Well done!</strong> You successfully read this important alert message.
|
||||||
font-size: 18px;
|
</div>
|
||||||
font-weight: 800;
|
<div class="alert alert-info">
|
||||||
margin: 40px 10px;
|
<strong>Heads up!</strong> This alert needs your attention, but it's not super important.
|
||||||
}
|
</div>
|
||||||
.homeworks{
|
<div class="alert alert-warning">
|
||||||
font-size: 16px;
|
<strong>Warning!</strong> Best check yo self, you're not looking too good.
|
||||||
font-weight: 500;
|
</div>
|
||||||
margin: 5px 40px 20px;
|
<div class="alert alert-danger">
|
||||||
}
|
<strong>Oh snap!</strong> Change a few things up and try submitting again.
|
||||||
.attach_item{
|
</div>
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
|
||||||
margin: auto 60px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<% @courses.each do |course| %>
|
|
||||||
<div class="courses_list">
|
|
||||||
<%= course.name %>
|
|
||||||
|
|
||||||
<% course.homeworks.each do |homework| %>
|
<div class="page-header">
|
||||||
<% homeworks_attach_path = [] %>
|
<div class="jumbotron">
|
||||||
<div class="homeworks">
|
<h1>课程作业列表</h1>
|
||||||
<%= link_to homework.name, respond_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
|
<p class="lead">测试页面提供</p>
|
||||||
<div class="attach_item">
|
|
||||||
<%= link_to "package", zipdown_assort_path(obj_class: homework.class, obj_id: homework.id) %><br/>
|
|
||||||
<% homework.homeworks.each do |homeattach|%><%#homework.class == Bid %>
|
|
||||||
<% homeattach.attachments.each do |attach|%>
|
|
||||||
<%= link_to_attachment attach, author: true, :download => true %> (<%=attach.author%>)
|
|
||||||
<br/>
|
|
||||||
<% homeworks_attach_path << attach.storage_path %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<%# 所有作业的文件列表%>
|
|
||||||
<!-- (<%=homeworks_attach_path.count%>):<%= homeworks_attach_path.to_json %> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
<% @courses.each do |course| %>
|
||||||
|
<div class="courses_list row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="page-header">
|
||||||
|
<h3> <%= course.name %> </h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% course.homeworks.each do |homework| %>
|
||||||
|
<% homeworks_attach_path = [] %>
|
||||||
|
<div class="homeworks panel panel-default ">
|
||||||
|
<div class="homeworks panel-heading">
|
||||||
|
<div class="panel-title">
|
||||||
|
<%= link_to homework.name, respond_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
|
||||||
|
<%= link_to "打包下载", zipdown_assort_path(obj_class: homework.class, obj_id: homework.id), :class => "btn btn-primary btn-sm" %><br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="attach_item panel-body ">
|
||||||
|
<div class="col-md-offset-1">
|
||||||
|
<% homework.homeworks.each do |homeattach|%><%#homework.class == Bid %>
|
||||||
|
<% homeattach.attachments.each do |attach|%>
|
||||||
|
<%= link_to_attachment attach, author: true, :download => true %> (<%=attach.author%>)
|
||||||
|
<br/>
|
||||||
|
<% homeworks_attach_path << attach.storage_path %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%# 所有作业的文件列表%>
|
||||||
|
<!-- (<%=homeworks_attach_path.count%>):<%= homeworks_attach_path.to_json %> -->
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
|
||||||
<% end %>
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="user-bottom">
|
<div class="user-bottom">
|
||||||
<% unless user.memberships.empty? %>
|
<% unless user.memberships.empty? %>
|
||||||
<% cond = Project.visible_condition(User.current) + "AND projects.project_type <> 1" %>
|
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
|
||||||
<% memberships = user.memberships.all(:conditions => cond) %>
|
<% memberships = user.memberships.all(:conditions => cond) %>
|
||||||
<%= l(:label_x_contribute_to, :count => memberships.count) %>
|
<%= l(:label_x_contribute_to, :count => memberships.count) %>
|
||||||
<% for member in memberships %>
|
<% for member in memberships %>
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<% unless user.memberships.empty? %>
|
<% unless user.memberships.empty? %>
|
||||||
<% cond = Project.visible_condition(User.current) + "AND projects.project_type = 1" %>
|
<% cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
|
||||||
<% memberships = user.memberships.all(:conditions => cond) %>
|
<% memberships = user.memberships.all(:conditions => cond) %>
|
||||||
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
|
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
|
||||||
<% for member in memberships %>
|
<% for member in memberships %>
|
||||||
|
|
|
@ -1,71 +1,3 @@
|
||||||
<% if User.current.admin? %>
|
|
||||||
<div class="contextual">
|
|
||||||
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3><%= l(:label_user_plural)%></h3>
|
|
||||||
|
|
||||||
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
|
||||||
<fieldset>
|
|
||||||
<legend>
|
|
||||||
<%= l(:label_filter_plural) %>
|
|
||||||
</legend>
|
|
||||||
<label for='status'><%= l(:field_status) %>:</label>
|
|
||||||
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
|
|
||||||
|
|
||||||
<% if @groups.present? %>
|
|
||||||
<label for='group_id'><%= l(:label_group) %>:</label>
|
|
||||||
<%= select_tag 'group_id', content_tag('option') + options_from_collection_for_select(@groups, :id, :name, params[:group_id].to_i), :onchange => "this.form.submit(); return false;" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<label for='name'><%= l(:label_user) %>:</label>
|
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
|
||||||
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
|
|
||||||
</fieldset>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="autoscroll">
|
|
||||||
<table class="list">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<%= sort_header_tag('login', :caption => l(:field_login)) %>
|
|
||||||
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
|
|
||||||
<%= sort_header_tag('lastname', :caption => l(:field_lastname)) %>
|
|
||||||
<%= sort_header_tag('mail', :caption => l(:field_mail)) %>
|
|
||||||
|
|
||||||
<%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %>
|
|
||||||
<%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %>
|
|
||||||
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% for user in @users -%>
|
|
||||||
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
|
|
||||||
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
|
|
||||||
<td class="firstname"><%= h(user.firstname) %></td>
|
|
||||||
<td class="lastname"><%= h(user.lastname) %></td>
|
|
||||||
<td class="email"><%= mail_to(h(user.mail)) %></td>
|
|
||||||
<td align="center"><%= checked_image user.admin? %></td>
|
|
||||||
<td class="created_on" align="center"><%= format_time(user.created_on) %></td>
|
|
||||||
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
|
||||||
<td class="buttons"> <%= change_status_link(user) %>
|
|
||||||
<%= delete_link user_path(user, :back_url => users_path(params)) unless User.current == user %> </td>
|
|
||||||
</tr>
|
|
||||||
<% end -%>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="pagination">
|
|
||||||
<ul>
|
|
||||||
<%= pagination_links_full @user_pages, @user_count %>
|
|
||||||
<ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% html_title(l(:label_user_plural)) -%>
|
|
||||||
|
|
||||||
<% else %>
|
|
||||||
<!-- modified by huang -->
|
<!-- modified by huang -->
|
||||||
<div class="top-content">
|
<div class="top-content">
|
||||||
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
|
||||||
|
@ -115,4 +47,3 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% html_title(l(:label_user_plural)) -%>
|
<% html_title(l(:label_user_plural)) -%>
|
||||||
<% end -%>
|
|
||||||
|
|
|
@ -189,7 +189,7 @@
|
||||||
<% find_new_forum_topics(11).each do |topic|%>
|
<% find_new_forum_topics(11).each do |topic|%>
|
||||||
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px ">
|
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px ">
|
||||||
<div style="display: inline-block; width: 100%;">
|
<div style="display: inline-block; width: 100%;">
|
||||||
<span class="memo_activity" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
||||||
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
|
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
|
||||||
</span>
|
</span>
|
||||||
<div class='memo_activity memo_attr'>
|
<div class='memo_activity memo_attr'>
|
||||||
|
|
|
@ -234,7 +234,7 @@
|
||||||
<% find_new_forum_topics(10).each do |topic|%>
|
<% find_new_forum_topics(10).each do |topic|%>
|
||||||
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
|
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
|
||||||
<div style="display: inline-block; width: 100%;">
|
<div style="display: inline-block; width: 100%;">
|
||||||
<span class="memo_activity" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
||||||
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
|
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
|
||||||
</span>
|
</span>
|
||||||
<div class='memo_activity memo_attr'>
|
<div class='memo_activity memo_attr'>
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
<div class="welcome-box-list-new memo_activity">
|
<div class="welcome-box-list-new memo_activity">
|
||||||
<% find_new_forum_topics(7).each do |topic|%>
|
<% find_new_forum_topics(7).each do |topic|%>
|
||||||
<li class="message-brief-intro">
|
<li class="message-brief-intro">
|
||||||
<div class='memo_title'>
|
<div class='memo_title text_nowrap'>
|
||||||
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
||||||
</div>
|
</div>
|
||||||
<div class='memo_attr'>
|
<div class='memo_attr'>
|
||||||
|
|
|
@ -1443,6 +1443,7 @@ en:
|
||||||
label_identity: Identity
|
label_identity: Identity
|
||||||
label_teacher: Teacher
|
label_teacher: Teacher
|
||||||
label_student: Student
|
label_student: Student
|
||||||
|
label_school_all: Schools
|
||||||
label_other: Other
|
label_other: Other
|
||||||
label_gender: Gender
|
label_gender: Gender
|
||||||
label_gender_male: male
|
label_gender_male: male
|
||||||
|
|
|
@ -39,17 +39,19 @@ RedmineApp::Application.routes.draw do
|
||||||
collection do
|
collection do
|
||||||
match 'search', via: [:get, :post]
|
match 'search', via: [:get, :post]
|
||||||
match 'remove_condition', via: [:get, :post]
|
match 'remove_condition', via: [:get, :post]
|
||||||
|
match 'allbug', via: [:get, :post]
|
||||||
end
|
end
|
||||||
resources :relative_memos
|
resources :relative_memos
|
||||||
member do
|
member do
|
||||||
match 'master_apply', via: [:get, :post]
|
match 'master_apply', via: [:get, :post]
|
||||||
match 'accept_master_apply', via: [:get, :post]
|
match 'accept_master_apply', via: [:get, :post]
|
||||||
match 'refuse_master_apply', via: [:get, :post]
|
match 'refuse_master_apply', via: [:get, :post]
|
||||||
|
match 'showmemo', via: [:get, :post]
|
||||||
|
match 'showbug', via: [:get, :post]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
mount SeemsRateable::Engine => '/rateable', :as => :rateable
|
mount SeemsRateable::Engine => '/rateable', :as => :rateable
|
||||||
|
|
||||||
|
|
||||||
namespace :zipdown do
|
namespace :zipdown do
|
||||||
match 'assort'
|
match 'assort'
|
||||||
end
|
end
|
||||||
|
@ -59,11 +61,11 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
##new added by linchun #以发布应用的形式参与竞赛
|
##new added by linchun #以发布应用的形式参与竞赛
|
||||||
resources :softapplications do
|
resources :softapplications do
|
||||||
|
|
||||||
collection do
|
collection do
|
||||||
match 'new_message', via: :get
|
match 'new_message', via: :get
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
match 'create_message' , via: :post
|
match 'create_message' , via: :post
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -94,11 +96,9 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'add_softapplication' , via: [:get, :post]
|
match 'add_softapplication' , via: [:get, :post]
|
||||||
match 'create' , via: :post
|
match 'create' , via: :post
|
||||||
match 'settings' , via: [:get, :post]
|
match 'settings' , via: [:get, :post]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
|
||||||
|
|
||||||
resources :stores do
|
resources :stores do
|
||||||
collection do
|
collection do
|
||||||
match 'search', via: [:get, :post]
|
match 'search', via: [:get, :post]
|
||||||
|
@ -328,7 +328,7 @@ RedmineApp::Application.routes.draw do
|
||||||
resources :files, :only => [:index, :new, :create] do
|
resources :files, :only => [:index, :new, :create] do
|
||||||
collection do
|
collection do
|
||||||
match "getattachtype" , via: [:get, :post]
|
match "getattachtype" , via: [:get, :post]
|
||||||
#match 'getattachtype/:attachtype', :to => 'files#getattachtype', via: [:get, :post]
|
#match 'getattachtype/:attachtype', :to => 'files#getattachtype', via: [:get, :post]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -487,8 +487,8 @@ RedmineApp::Application.routes.draw do
|
||||||
collection do
|
collection do
|
||||||
match "updateType" , via: [:get, :post]
|
match "updateType" , via: [:get, :post]
|
||||||
match "renderTag" , via: [:get, :post]
|
match "renderTag" , via: [:get, :post]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :groups do
|
resources :groups do
|
||||||
member do
|
member do
|
||||||
|
@ -527,6 +527,7 @@ RedmineApp::Application.routes.draw do
|
||||||
|
|
||||||
match 'admin', :controller => 'admin', :action => 'index', :via => :get
|
match 'admin', :controller => 'admin', :action => 'index', :via => :get
|
||||||
match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
|
match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
|
||||||
|
match 'admin/users', :controller => 'admin', :action => 'users', :via => :get
|
||||||
match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
|
match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
|
||||||
match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
|
match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
|
||||||
match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
|
match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
|
||||||
|
@ -626,24 +627,27 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
|
match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
|
||||||
match 'contest', :controller => 'bids', :action => 'contests', :as => 'contest' #modified @20140403
|
match 'contest', :controller => 'bids', :action => 'contests', :as => 'contest' #modified @20140403
|
||||||
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
##added by wen##########
|
##added by wen##########
|
||||||
#######confusing########
|
#######confusing########
|
||||||
|
get 'welcome/search', to: 'welcome#search'
|
||||||
|
get 'school/index', to: 'school#index'
|
||||||
|
get 'course/:school_id', to: 'welcome#course'
|
||||||
|
get 'course/:school_id', to: 'welcome#course'
|
||||||
post 'school/get_options/:province', :to => 'school#get_options'
|
post 'school/get_options/:province', :to => 'school#get_options'
|
||||||
get 'school/get_options/:province', :to => 'school#get_options'
|
get 'school/get_options/:province', :to => 'school#get_options'
|
||||||
|
|
||||||
post 'school/get_province', :to => 'school#get_province'
|
post 'school/get_province', :to => 'school#get_province'
|
||||||
get 'school/get_province', :to => 'school#get_province'
|
get 'school/get_province', :to => 'school#get_province'
|
||||||
|
|
||||||
post 'school/get_schoollist/:province', :to => 'school#get_schoollist'
|
post 'school/get_schoollist/:province', :to => 'school#get_schoollist'
|
||||||
get 'school/get_schoollist/:province', :to => 'school#get_schoollist'
|
get 'school/get_schoollist/:province', :to => 'school#get_schoollist'
|
||||||
|
|
||||||
post 'school/search_school/', :to => 'school#search_school'
|
post 'school/search_school/', :to => 'school#search_school'
|
||||||
get 'school/search_school/', :to => 'school#search_school'
|
get 'school/search_school/', :to => 'school#search_school'
|
||||||
|
|
||||||
post 'school/upload', :to => 'school#upload'
|
post 'school/upload', :to => 'school#upload'
|
||||||
|
|
||||||
######added by nie
|
######added by nie
|
||||||
match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
|
match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
|
||||||
########### added by liuping
|
########### added by liuping
|
||||||
|
@ -668,5 +672,4 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
get ':controller(/:action(/:id))'
|
|
||||||
end
|
end
|
||||||
|
|
1074
db/schema.rb.orig
1074
db/schema.rb.orig
File diff suppressed because it is too large
Load Diff
|
@ -314,7 +314,7 @@ end
|
||||||
########end
|
########end
|
||||||
Redmine::MenuManager.map :admin_menu do |menu|
|
Redmine::MenuManager.map :admin_menu do |menu|
|
||||||
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
||||||
menu.push :users, {:controller => 'users'}, :caption => :label_user_plural
|
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
|
||||||
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
|
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
|
||||||
menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions
|
menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions
|
||||||
menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural
|
menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural
|
||||||
|
|
|
@ -94,6 +94,18 @@ module Redmine
|
||||||
links.empty? ? nil : content_tag('ul', links.join("\n").html_safe)
|
links.empty? ? nil : content_tag('ul', links.join("\n").html_safe)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bootstrap_render_menu(menu, project=nil)
|
||||||
|
links = []
|
||||||
|
menu_items_for(menu, project) do |node|
|
||||||
|
links << render_menu_node(node, project)
|
||||||
|
end
|
||||||
|
s = ''
|
||||||
|
# s = "<ul class = 'nav navbar-nav navbar-right'> "
|
||||||
|
s << links.join("\n")
|
||||||
|
# s << "</ul>"
|
||||||
|
links.empty? ? nil : s.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
def render_menu_node(node, project=nil)
|
def render_menu_node(node, project=nil)
|
||||||
if node.children.present? || !node.child_menus.nil?
|
if node.children.present? || !node.child_menus.nil?
|
||||||
return render_menu_node_with_children(node, project)
|
return render_menu_node_with_children(node, project)
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
|
@ -0,0 +1,126 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: affix.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#affix
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// AFFIX CLASS DEFINITION
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
var Affix = function (element, options) {
|
||||||
|
this.options = $.extend({}, Affix.DEFAULTS, options)
|
||||||
|
this.$window = $(window)
|
||||||
|
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
||||||
|
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
||||||
|
|
||||||
|
this.$element = $(element)
|
||||||
|
this.affixed =
|
||||||
|
this.unpin = null
|
||||||
|
|
||||||
|
this.checkPosition()
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.RESET = 'affix affix-top affix-bottom'
|
||||||
|
|
||||||
|
Affix.DEFAULTS = {
|
||||||
|
offset: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.prototype.checkPositionWithEventLoop = function () {
|
||||||
|
setTimeout($.proxy(this.checkPosition, this), 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.prototype.checkPosition = function () {
|
||||||
|
if (!this.$element.is(':visible')) return
|
||||||
|
|
||||||
|
var scrollHeight = $(document).height()
|
||||||
|
var scrollTop = this.$window.scrollTop()
|
||||||
|
var position = this.$element.offset()
|
||||||
|
var offset = this.options.offset
|
||||||
|
var offsetTop = offset.top
|
||||||
|
var offsetBottom = offset.bottom
|
||||||
|
|
||||||
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||||
|
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
||||||
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
||||||
|
|
||||||
|
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
||||||
|
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
||||||
|
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
||||||
|
|
||||||
|
if (this.affixed === affix) return
|
||||||
|
if (this.unpin) this.$element.css('top', '')
|
||||||
|
|
||||||
|
this.affixed = affix
|
||||||
|
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
||||||
|
|
||||||
|
this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
|
||||||
|
|
||||||
|
if (affix == 'bottom') {
|
||||||
|
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
var old = $.fn.affix
|
||||||
|
|
||||||
|
$.fn.affix = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.affix')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.affix.Constructor = Affix
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.affix.noConflict = function () {
|
||||||
|
$.fn.affix = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-spy="affix"]').each(function () {
|
||||||
|
var $spy = $(this)
|
||||||
|
var data = $spy.data()
|
||||||
|
|
||||||
|
data.offset = data.offset || {}
|
||||||
|
|
||||||
|
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
||||||
|
if (data.offsetTop) data.offset.top = data.offsetTop
|
||||||
|
|
||||||
|
$spy.affix(data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,98 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: alert.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#alerts
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// ALERT CLASS DEFINITION
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
var dismiss = '[data-dismiss="alert"]'
|
||||||
|
var Alert = function (el) {
|
||||||
|
$(el).on('click', dismiss, this.close)
|
||||||
|
}
|
||||||
|
|
||||||
|
Alert.prototype.close = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
var selector = $this.attr('data-target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
var $parent = $(selector)
|
||||||
|
|
||||||
|
if (e) e.preventDefault()
|
||||||
|
|
||||||
|
if (!$parent.length) {
|
||||||
|
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
||||||
|
}
|
||||||
|
|
||||||
|
$parent.trigger(e = $.Event('close.bs.alert'))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$parent.removeClass('in')
|
||||||
|
|
||||||
|
function removeElement() {
|
||||||
|
$parent.trigger('closed.bs.alert').remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
$.support.transition && $parent.hasClass('fade') ?
|
||||||
|
$parent
|
||||||
|
.one($.support.transition.end, removeElement)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
removeElement()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ALERT PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
var old = $.fn.alert
|
||||||
|
|
||||||
|
$.fn.alert = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.alert')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
||||||
|
if (typeof option == 'string') data[option].call($this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.alert.Constructor = Alert
|
||||||
|
|
||||||
|
|
||||||
|
// ALERT NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.alert.noConflict = function () {
|
||||||
|
$.fn.alert = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ALERT DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
||||||
|
|
||||||
|
}(jQuery);
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,115 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: button.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#buttons
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// BUTTON PUBLIC CLASS DEFINITION
|
||||||
|
// ==============================
|
||||||
|
|
||||||
|
var Button = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = $.extend({}, Button.DEFAULTS, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.DEFAULTS = {
|
||||||
|
loadingText: 'loading...'
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.prototype.setState = function (state) {
|
||||||
|
var d = 'disabled'
|
||||||
|
var $el = this.$element
|
||||||
|
var val = $el.is('input') ? 'val' : 'html'
|
||||||
|
var data = $el.data()
|
||||||
|
|
||||||
|
state = state + 'Text'
|
||||||
|
|
||||||
|
if (!data.resetText) $el.data('resetText', $el[val]())
|
||||||
|
|
||||||
|
$el[val](data[state] || this.options[state])
|
||||||
|
|
||||||
|
// push to event loop to allow forms to submit
|
||||||
|
setTimeout(function () {
|
||||||
|
state == 'loadingText' ?
|
||||||
|
$el.addClass(d).attr(d, d) :
|
||||||
|
$el.removeClass(d).removeAttr(d);
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.prototype.toggle = function () {
|
||||||
|
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
||||||
|
var changed = true
|
||||||
|
|
||||||
|
if ($parent.length) {
|
||||||
|
var $input = this.$element.find('input')
|
||||||
|
if ($input.prop('type') === 'radio') {
|
||||||
|
// see if clicking on current one
|
||||||
|
if ($input.prop('checked') && this.$element.hasClass('active'))
|
||||||
|
changed = false
|
||||||
|
else
|
||||||
|
$parent.find('.active').removeClass('active')
|
||||||
|
}
|
||||||
|
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) this.$element.toggleClass('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON PLUGIN DEFINITION
|
||||||
|
// ========================
|
||||||
|
|
||||||
|
var old = $.fn.button
|
||||||
|
|
||||||
|
$.fn.button = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.button')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
||||||
|
|
||||||
|
if (option == 'toggle') data.toggle()
|
||||||
|
else if (option) data.setState(option)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.button.Constructor = Button
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON NO CONFLICT
|
||||||
|
// ==================
|
||||||
|
|
||||||
|
$.fn.button.noConflict = function () {
|
||||||
|
$.fn.button = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON DATA-API
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
||||||
|
var $btn = $(e.target)
|
||||||
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||||
|
$btn.button('toggle')
|
||||||
|
e.preventDefault()
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,217 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: carousel.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#carousel
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// CAROUSEL CLASS DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var Carousel = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
|
this.$indicators = this.$element.find('.carousel-indicators')
|
||||||
|
this.options = options
|
||||||
|
this.paused =
|
||||||
|
this.sliding =
|
||||||
|
this.interval =
|
||||||
|
this.$active =
|
||||||
|
this.$items = null
|
||||||
|
|
||||||
|
this.options.pause == 'hover' && this.$element
|
||||||
|
.on('mouseenter', $.proxy(this.pause, this))
|
||||||
|
.on('mouseleave', $.proxy(this.cycle, this))
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.DEFAULTS = {
|
||||||
|
interval: 5000
|
||||||
|
, pause: 'hover'
|
||||||
|
, wrap: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.cycle = function (e) {
|
||||||
|
e || (this.paused = false)
|
||||||
|
|
||||||
|
this.interval && clearInterval(this.interval)
|
||||||
|
|
||||||
|
this.options.interval
|
||||||
|
&& !this.paused
|
||||||
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.getActiveIndex = function () {
|
||||||
|
this.$active = this.$element.find('.item.active')
|
||||||
|
this.$items = this.$active.parent().children()
|
||||||
|
|
||||||
|
return this.$items.index(this.$active)
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.to = function (pos) {
|
||||||
|
var that = this
|
||||||
|
var activeIndex = this.getActiveIndex()
|
||||||
|
|
||||||
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||||
|
|
||||||
|
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
||||||
|
if (activeIndex == pos) return this.pause().cycle()
|
||||||
|
|
||||||
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.pause = function (e) {
|
||||||
|
e || (this.paused = true)
|
||||||
|
|
||||||
|
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
||||||
|
this.$element.trigger($.support.transition.end)
|
||||||
|
this.cycle(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.interval = clearInterval(this.interval)
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.next = function () {
|
||||||
|
if (this.sliding) return
|
||||||
|
return this.slide('next')
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.prev = function () {
|
||||||
|
if (this.sliding) return
|
||||||
|
return this.slide('prev')
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.slide = function (type, next) {
|
||||||
|
var $active = this.$element.find('.item.active')
|
||||||
|
var $next = next || $active[type]()
|
||||||
|
var isCycling = this.interval
|
||||||
|
var direction = type == 'next' ? 'left' : 'right'
|
||||||
|
var fallback = type == 'next' ? 'first' : 'last'
|
||||||
|
var that = this
|
||||||
|
|
||||||
|
if (!$next.length) {
|
||||||
|
if (!this.options.wrap) return
|
||||||
|
$next = this.$element.find('.item')[fallback]()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sliding = true
|
||||||
|
|
||||||
|
isCycling && this.pause()
|
||||||
|
|
||||||
|
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
||||||
|
|
||||||
|
if ($next.hasClass('active')) return
|
||||||
|
|
||||||
|
if (this.$indicators.length) {
|
||||||
|
this.$indicators.find('.active').removeClass('active')
|
||||||
|
this.$element.one('slid.bs.carousel', function () {
|
||||||
|
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||||
|
$nextIndicator && $nextIndicator.addClass('active')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
$next.addClass(type)
|
||||||
|
$next[0].offsetWidth // force reflow
|
||||||
|
$active.addClass(direction)
|
||||||
|
$next.addClass(direction)
|
||||||
|
$active
|
||||||
|
.one($.support.transition.end, function () {
|
||||||
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||||
|
$active.removeClass(['active', direction].join(' '))
|
||||||
|
that.sliding = false
|
||||||
|
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(600)
|
||||||
|
} else {
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
$active.removeClass('active')
|
||||||
|
$next.addClass('active')
|
||||||
|
this.sliding = false
|
||||||
|
this.$element.trigger('slid.bs.carousel')
|
||||||
|
}
|
||||||
|
|
||||||
|
isCycling && this.cycle()
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CAROUSEL PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
var old = $.fn.carousel
|
||||||
|
|
||||||
|
$.fn.carousel = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.carousel')
|
||||||
|
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
var action = typeof option == 'string' ? option : options.slide
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
||||||
|
if (typeof option == 'number') data.to(option)
|
||||||
|
else if (action) data[action]()
|
||||||
|
else if (options.interval) data.pause().cycle()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.carousel.Constructor = Carousel
|
||||||
|
|
||||||
|
|
||||||
|
// CAROUSEL NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.carousel.noConflict = function () {
|
||||||
|
$.fn.carousel = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CAROUSEL DATA-API
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
||||||
|
var $this = $(this), href
|
||||||
|
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||||
|
var options = $.extend({}, $target.data(), $this.data())
|
||||||
|
var slideIndex = $this.attr('data-slide-to')
|
||||||
|
if (slideIndex) options.interval = false
|
||||||
|
|
||||||
|
$target.carousel(options)
|
||||||
|
|
||||||
|
if (slideIndex = $this.attr('data-slide-to')) {
|
||||||
|
$target.data('bs.carousel').to(slideIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-ride="carousel"]').each(function () {
|
||||||
|
var $carousel = $(this)
|
||||||
|
$carousel.carousel($carousel.data())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,179 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: collapse.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#collapse
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// COLLAPSE PUBLIC CLASS DEFINITION
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
var Collapse = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||||
|
this.transitioning = null
|
||||||
|
|
||||||
|
if (this.options.parent) this.$parent = $(this.options.parent)
|
||||||
|
if (this.options.toggle) this.toggle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.DEFAULTS = {
|
||||||
|
toggle: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.dimension = function () {
|
||||||
|
var hasWidth = this.$element.hasClass('width')
|
||||||
|
return hasWidth ? 'width' : 'height'
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.show = function () {
|
||||||
|
if (this.transitioning || this.$element.hasClass('in')) return
|
||||||
|
|
||||||
|
var startEvent = $.Event('show.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
||||||
|
|
||||||
|
if (actives && actives.length) {
|
||||||
|
var hasData = actives.data('bs.collapse')
|
||||||
|
if (hasData && hasData.transitioning) return
|
||||||
|
actives.collapse('hide')
|
||||||
|
hasData || actives.data('bs.collapse', null)
|
||||||
|
}
|
||||||
|
|
||||||
|
var dimension = this.dimension()
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.removeClass('collapse')
|
||||||
|
.addClass('collapsing')
|
||||||
|
[dimension](0)
|
||||||
|
|
||||||
|
this.transitioning = 1
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
|
this.$element
|
||||||
|
.removeClass('collapsing')
|
||||||
|
.addClass('in')
|
||||||
|
[dimension]('auto')
|
||||||
|
this.transitioning = 0
|
||||||
|
this.$element.trigger('shown.bs.collapse')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$.support.transition) return complete.call(this)
|
||||||
|
|
||||||
|
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.one($.support.transition.end, $.proxy(complete, this))
|
||||||
|
.emulateTransitionEnd(350)
|
||||||
|
[dimension](this.$element[0][scrollSize])
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.hide = function () {
|
||||||
|
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||||
|
|
||||||
|
var startEvent = $.Event('hide.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var dimension = this.dimension()
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
[dimension](this.$element[dimension]())
|
||||||
|
[0].offsetHeight
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.addClass('collapsing')
|
||||||
|
.removeClass('collapse')
|
||||||
|
.removeClass('in')
|
||||||
|
|
||||||
|
this.transitioning = 1
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
|
this.transitioning = 0
|
||||||
|
this.$element
|
||||||
|
.trigger('hidden.bs.collapse')
|
||||||
|
.removeClass('collapsing')
|
||||||
|
.addClass('collapse')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$.support.transition) return complete.call(this)
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
[dimension](0)
|
||||||
|
.one($.support.transition.end, $.proxy(complete, this))
|
||||||
|
.emulateTransitionEnd(350)
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.toggle = function () {
|
||||||
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
var old = $.fn.collapse
|
||||||
|
|
||||||
|
$.fn.collapse = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.collapse')
|
||||||
|
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.collapse.Constructor = Collapse
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.collapse.noConflict = function () {
|
||||||
|
$.fn.collapse = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE DATA-API
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||||
|
var $this = $(this), href
|
||||||
|
var target = $this.attr('data-target')
|
||||||
|
|| e.preventDefault()
|
||||||
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||||
|
var $target = $(target)
|
||||||
|
var data = $target.data('bs.collapse')
|
||||||
|
var option = data ? 'toggle' : $this.data()
|
||||||
|
var parent = $this.attr('data-parent')
|
||||||
|
var $parent = parent && $(parent)
|
||||||
|
|
||||||
|
if (!data || !data.transitioning) {
|
||||||
|
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
||||||
|
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.collapse(option)
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,154 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: dropdown.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#dropdowns
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// DROPDOWN CLASS DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var backdrop = '.dropdown-backdrop'
|
||||||
|
var toggle = '[data-toggle=dropdown]'
|
||||||
|
var Dropdown = function (element) {
|
||||||
|
$(element).on('click.bs.dropdown', this.toggle)
|
||||||
|
}
|
||||||
|
|
||||||
|
Dropdown.prototype.toggle = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
if ($this.is('.disabled, :disabled')) return
|
||||||
|
|
||||||
|
var $parent = getParent($this)
|
||||||
|
var isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
|
clearMenus()
|
||||||
|
|
||||||
|
if (!isActive) {
|
||||||
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
||||||
|
// if mobile we use a backdrop because click events don't delegate
|
||||||
|
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
||||||
|
}
|
||||||
|
|
||||||
|
$parent.trigger(e = $.Event('show.bs.dropdown'))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$parent
|
||||||
|
.toggleClass('open')
|
||||||
|
.trigger('shown.bs.dropdown')
|
||||||
|
|
||||||
|
$this.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
Dropdown.prototype.keydown = function (e) {
|
||||||
|
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||||
|
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
|
||||||
|
if ($this.is('.disabled, :disabled')) return
|
||||||
|
|
||||||
|
var $parent = getParent($this)
|
||||||
|
var isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
|
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||||
|
if (e.which == 27) $parent.find(toggle).focus()
|
||||||
|
return $this.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||||
|
|
||||||
|
if (!$items.length) return
|
||||||
|
|
||||||
|
var index = $items.index($items.filter(':focus'))
|
||||||
|
|
||||||
|
if (e.keyCode == 38 && index > 0) index-- // up
|
||||||
|
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||||
|
if (!~index) index=0
|
||||||
|
|
||||||
|
$items.eq(index).focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearMenus() {
|
||||||
|
$(backdrop).remove()
|
||||||
|
$(toggle).each(function (e) {
|
||||||
|
var $parent = getParent($(this))
|
||||||
|
if (!$parent.hasClass('open')) return
|
||||||
|
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getParent($this) {
|
||||||
|
var selector = $this.attr('data-target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
var $parent = selector && $(selector)
|
||||||
|
|
||||||
|
return $parent && $parent.length ? $parent : $this.parent()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DROPDOWN PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
var old = $.fn.dropdown
|
||||||
|
|
||||||
|
$.fn.dropdown = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.dropdown')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||||
|
if (typeof option == 'string') data[option].call($this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.dropdown.Constructor = Dropdown
|
||||||
|
|
||||||
|
|
||||||
|
// DROPDOWN NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.dropdown.noConflict = function () {
|
||||||
|
$.fn.dropdown = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||||
|
// ===================================
|
||||||
|
|
||||||
|
$(document)
|
||||||
|
.on('click.bs.dropdown.data-api', clearMenus)
|
||||||
|
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||||
|
.on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||||
|
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||||
|
|
||||||
|
}(jQuery);
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,246 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: modal.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#modals
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// MODAL CLASS DEFINITION
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
var Modal = function (element, options) {
|
||||||
|
this.options = options
|
||||||
|
this.$element = $(element)
|
||||||
|
this.$backdrop =
|
||||||
|
this.isShown = null
|
||||||
|
|
||||||
|
if (this.options.remote) this.$element.load(this.options.remote)
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.DEFAULTS = {
|
||||||
|
backdrop: true
|
||||||
|
, keyboard: true
|
||||||
|
, show: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.toggle = function (_relatedTarget) {
|
||||||
|
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.show = function (_relatedTarget) {
|
||||||
|
var that = this
|
||||||
|
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (this.isShown || e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.isShown = true
|
||||||
|
|
||||||
|
this.escape()
|
||||||
|
|
||||||
|
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
||||||
|
|
||||||
|
this.backdrop(function () {
|
||||||
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||||
|
|
||||||
|
if (!that.$element.parent().length) {
|
||||||
|
that.$element.appendTo(document.body) // don't move modals dom position
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$element.show()
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
that.$element[0].offsetWidth // force reflow
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$element
|
||||||
|
.addClass('in')
|
||||||
|
.attr('aria-hidden', false)
|
||||||
|
|
||||||
|
that.enforceFocus()
|
||||||
|
|
||||||
|
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
||||||
|
|
||||||
|
transition ?
|
||||||
|
that.$element.find('.modal-dialog') // wait for modal to slide in
|
||||||
|
.one($.support.transition.end, function () {
|
||||||
|
that.$element.focus().trigger(e)
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(300) :
|
||||||
|
that.$element.focus().trigger(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.hide = function (e) {
|
||||||
|
if (e) e.preventDefault()
|
||||||
|
|
||||||
|
e = $.Event('hide.bs.modal')
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (!this.isShown || e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.isShown = false
|
||||||
|
|
||||||
|
this.escape()
|
||||||
|
|
||||||
|
$(document).off('focusin.bs.modal')
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.removeClass('in')
|
||||||
|
.attr('aria-hidden', true)
|
||||||
|
.off('click.dismiss.modal')
|
||||||
|
|
||||||
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
|
this.$element
|
||||||
|
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
||||||
|
.emulateTransitionEnd(300) :
|
||||||
|
this.hideModal()
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.enforceFocus = function () {
|
||||||
|
$(document)
|
||||||
|
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||||
|
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||||
|
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||||
|
this.$element.focus()
|
||||||
|
}
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.escape = function () {
|
||||||
|
if (this.isShown && this.options.keyboard) {
|
||||||
|
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
|
e.which == 27 && this.hide()
|
||||||
|
}, this))
|
||||||
|
} else if (!this.isShown) {
|
||||||
|
this.$element.off('keyup.dismiss.bs.modal')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.hideModal = function () {
|
||||||
|
var that = this
|
||||||
|
this.$element.hide()
|
||||||
|
this.backdrop(function () {
|
||||||
|
that.removeBackdrop()
|
||||||
|
that.$element.trigger('hidden.bs.modal')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.removeBackdrop = function () {
|
||||||
|
this.$backdrop && this.$backdrop.remove()
|
||||||
|
this.$backdrop = null
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.backdrop = function (callback) {
|
||||||
|
var that = this
|
||||||
|
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||||
|
|
||||||
|
if (this.isShown && this.options.backdrop) {
|
||||||
|
var doAnimate = $.support.transition && animate
|
||||||
|
|
||||||
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||||
|
.appendTo(document.body)
|
||||||
|
|
||||||
|
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
|
||||||
|
if (e.target !== e.currentTarget) return
|
||||||
|
this.options.backdrop == 'static'
|
||||||
|
? this.$element[0].focus.call(this.$element[0])
|
||||||
|
: this.hide.call(this)
|
||||||
|
}, this))
|
||||||
|
|
||||||
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||||
|
|
||||||
|
this.$backdrop.addClass('in')
|
||||||
|
|
||||||
|
if (!callback) return
|
||||||
|
|
||||||
|
doAnimate ?
|
||||||
|
this.$backdrop
|
||||||
|
.one($.support.transition.end, callback)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
callback()
|
||||||
|
|
||||||
|
} else if (!this.isShown && this.$backdrop) {
|
||||||
|
this.$backdrop.removeClass('in')
|
||||||
|
|
||||||
|
$.support.transition && this.$element.hasClass('fade')?
|
||||||
|
this.$backdrop
|
||||||
|
.one($.support.transition.end, callback)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
callback()
|
||||||
|
|
||||||
|
} else if (callback) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
var old = $.fn.modal
|
||||||
|
|
||||||
|
$.fn.modal = function (option, _relatedTarget) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.modal')
|
||||||
|
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||||
|
if (typeof option == 'string') data[option](_relatedTarget)
|
||||||
|
else if (options.show) data.show(_relatedTarget)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.modal.Constructor = Modal
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.modal.noConflict = function () {
|
||||||
|
$.fn.modal = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
var href = $this.attr('href')
|
||||||
|
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||||
|
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
|
$target
|
||||||
|
.modal(option, this)
|
||||||
|
.one('hide', function () {
|
||||||
|
$this.is(':visible') && $this.focus()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document)
|
||||||
|
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
||||||
|
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,117 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: popover.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#popovers
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// POPOVER PUBLIC CLASS DEFINITION
|
||||||
|
// ===============================
|
||||||
|
|
||||||
|
var Popover = function (element, options) {
|
||||||
|
this.init('popover', element, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||||
|
|
||||||
|
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
|
||||||
|
placement: 'right'
|
||||||
|
, trigger: 'click'
|
||||||
|
, content: ''
|
||||||
|
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// NOTE: POPOVER EXTENDS tooltip.js
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
||||||
|
|
||||||
|
Popover.prototype.constructor = Popover
|
||||||
|
|
||||||
|
Popover.prototype.getDefaults = function () {
|
||||||
|
return Popover.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.setContent = function () {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var title = this.getTitle()
|
||||||
|
var content = this.getContent()
|
||||||
|
|
||||||
|
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||||
|
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
||||||
|
|
||||||
|
$tip.removeClass('fade top bottom left right in')
|
||||||
|
|
||||||
|
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||||
|
// this manually by checking the contents.
|
||||||
|
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.hasContent = function () {
|
||||||
|
return this.getTitle() || this.getContent()
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.getContent = function () {
|
||||||
|
var $e = this.$element
|
||||||
|
var o = this.options
|
||||||
|
|
||||||
|
return $e.attr('data-content')
|
||||||
|
|| (typeof o.content == 'function' ?
|
||||||
|
o.content.call($e[0]) :
|
||||||
|
o.content)
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.arrow = function () {
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find('.arrow')
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.tip = function () {
|
||||||
|
if (!this.$tip) this.$tip = $(this.options.template)
|
||||||
|
return this.$tip
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// POPOVER PLUGIN DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var old = $.fn.popover
|
||||||
|
|
||||||
|
$.fn.popover = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.popover')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.popover.Constructor = Popover
|
||||||
|
|
||||||
|
|
||||||
|
// POPOVER NO CONFLICT
|
||||||
|
// ===================
|
||||||
|
|
||||||
|
$.fn.popover.noConflict = function () {
|
||||||
|
$.fn.popover = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,158 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: scrollspy.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#scrollspy
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// SCROLLSPY CLASS DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
function ScrollSpy(element, options) {
|
||||||
|
var href
|
||||||
|
var process = $.proxy(this.process, this)
|
||||||
|
|
||||||
|
this.$element = $(element).is('body') ? $(window) : $(element)
|
||||||
|
this.$body = $('body')
|
||||||
|
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
|
||||||
|
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
||||||
|
this.selector = (this.options.target
|
||||||
|
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||||
|
|| '') + ' .nav li > a'
|
||||||
|
this.offsets = $([])
|
||||||
|
this.targets = $([])
|
||||||
|
this.activeTarget = null
|
||||||
|
|
||||||
|
this.refresh()
|
||||||
|
this.process()
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.DEFAULTS = {
|
||||||
|
offset: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.refresh = function () {
|
||||||
|
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
||||||
|
|
||||||
|
this.offsets = $([])
|
||||||
|
this.targets = $([])
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
var $targets = this.$body
|
||||||
|
.find(this.selector)
|
||||||
|
.map(function () {
|
||||||
|
var $el = $(this)
|
||||||
|
var href = $el.data('target') || $el.attr('href')
|
||||||
|
var $href = /^#\w/.test(href) && $(href)
|
||||||
|
|
||||||
|
return ($href
|
||||||
|
&& $href.length
|
||||||
|
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
||||||
|
})
|
||||||
|
.sort(function (a, b) { return a[0] - b[0] })
|
||||||
|
.each(function () {
|
||||||
|
self.offsets.push(this[0])
|
||||||
|
self.targets.push(this[1])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.process = function () {
|
||||||
|
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
||||||
|
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
||||||
|
var maxScroll = scrollHeight - this.$scrollElement.height()
|
||||||
|
var offsets = this.offsets
|
||||||
|
var targets = this.targets
|
||||||
|
var activeTarget = this.activeTarget
|
||||||
|
var i
|
||||||
|
|
||||||
|
if (scrollTop >= maxScroll) {
|
||||||
|
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = offsets.length; i--;) {
|
||||||
|
activeTarget != targets[i]
|
||||||
|
&& scrollTop >= offsets[i]
|
||||||
|
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||||
|
&& this.activate( targets[i] )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.activate = function (target) {
|
||||||
|
this.activeTarget = target
|
||||||
|
|
||||||
|
$(this.selector)
|
||||||
|
.parents('.active')
|
||||||
|
.removeClass('active')
|
||||||
|
|
||||||
|
var selector = this.selector
|
||||||
|
+ '[data-target="' + target + '"],'
|
||||||
|
+ this.selector + '[href="' + target + '"]'
|
||||||
|
|
||||||
|
var active = $(selector)
|
||||||
|
.parents('li')
|
||||||
|
.addClass('active')
|
||||||
|
|
||||||
|
if (active.parent('.dropdown-menu').length) {
|
||||||
|
active = active
|
||||||
|
.closest('li.dropdown')
|
||||||
|
.addClass('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
active.trigger('activate.bs.scrollspy')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY PLUGIN DEFINITION
|
||||||
|
// ===========================
|
||||||
|
|
||||||
|
var old = $.fn.scrollspy
|
||||||
|
|
||||||
|
$.fn.scrollspy = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.scrollspy')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.scrollspy.Constructor = ScrollSpy
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY NO CONFLICT
|
||||||
|
// =====================
|
||||||
|
|
||||||
|
$.fn.scrollspy.noConflict = function () {
|
||||||
|
$.fn.scrollspy = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY DATA-API
|
||||||
|
// ==================
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-spy="scroll"]').each(function () {
|
||||||
|
var $spy = $(this)
|
||||||
|
$spy.scrollspy($spy.data())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,135 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: tab.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#tabs
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// TAB CLASS DEFINITION
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
var Tab = function (element) {
|
||||||
|
this.element = $(element)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tab.prototype.show = function () {
|
||||||
|
var $this = this.element
|
||||||
|
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||||
|
var selector = $this.data('target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this.parent('li').hasClass('active')) return
|
||||||
|
|
||||||
|
var previous = $ul.find('.active:last a')[0]
|
||||||
|
var e = $.Event('show.bs.tab', {
|
||||||
|
relatedTarget: previous
|
||||||
|
})
|
||||||
|
|
||||||
|
$this.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var $target = $(selector)
|
||||||
|
|
||||||
|
this.activate($this.parent('li'), $ul)
|
||||||
|
this.activate($target, $target.parent(), function () {
|
||||||
|
$this.trigger({
|
||||||
|
type: 'shown.bs.tab'
|
||||||
|
, relatedTarget: previous
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Tab.prototype.activate = function (element, container, callback) {
|
||||||
|
var $active = container.find('> .active')
|
||||||
|
var transition = callback
|
||||||
|
&& $.support.transition
|
||||||
|
&& $active.hasClass('fade')
|
||||||
|
|
||||||
|
function next() {
|
||||||
|
$active
|
||||||
|
.removeClass('active')
|
||||||
|
.find('> .dropdown-menu > .active')
|
||||||
|
.removeClass('active')
|
||||||
|
|
||||||
|
element.addClass('active')
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
element[0].offsetWidth // reflow for transition
|
||||||
|
element.addClass('in')
|
||||||
|
} else {
|
||||||
|
element.removeClass('fade')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.parent('.dropdown-menu')) {
|
||||||
|
element.closest('li.dropdown').addClass('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
transition ?
|
||||||
|
$active
|
||||||
|
.one($.support.transition.end, next)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
next()
|
||||||
|
|
||||||
|
$active.removeClass('in')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TAB PLUGIN DEFINITION
|
||||||
|
// =====================
|
||||||
|
|
||||||
|
var old = $.fn.tab
|
||||||
|
|
||||||
|
$.fn.tab = function ( option ) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.tab')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.tab.Constructor = Tab
|
||||||
|
|
||||||
|
|
||||||
|
// TAB NO CONFLICT
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
$.fn.tab.noConflict = function () {
|
||||||
|
$.fn.tab = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TAB DATA-API
|
||||||
|
// ============
|
||||||
|
|
||||||
|
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
$(this).tab('show')
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,386 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: tooltip.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#tooltip
|
||||||
|
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||||
|
// ===============================
|
||||||
|
|
||||||
|
var Tooltip = function (element, options) {
|
||||||
|
this.type =
|
||||||
|
this.options =
|
||||||
|
this.enabled =
|
||||||
|
this.timeout =
|
||||||
|
this.hoverState =
|
||||||
|
this.$element = null
|
||||||
|
|
||||||
|
this.init('tooltip', element, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.DEFAULTS = {
|
||||||
|
animation: true
|
||||||
|
, placement: 'top'
|
||||||
|
, selector: false
|
||||||
|
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||||
|
, trigger: 'hover focus'
|
||||||
|
, title: ''
|
||||||
|
, delay: 0
|
||||||
|
, html: false
|
||||||
|
, container: false
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.init = function (type, element, options) {
|
||||||
|
this.enabled = true
|
||||||
|
this.type = type
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = this.getOptions(options)
|
||||||
|
|
||||||
|
var triggers = this.options.trigger.split(' ')
|
||||||
|
|
||||||
|
for (var i = triggers.length; i--;) {
|
||||||
|
var trigger = triggers[i]
|
||||||
|
|
||||||
|
if (trigger == 'click') {
|
||||||
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
|
} else if (trigger != 'manual') {
|
||||||
|
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||||
|
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||||
|
|
||||||
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.options.selector ?
|
||||||
|
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||||
|
this.fixTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getDefaults = function () {
|
||||||
|
return Tooltip.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getOptions = function (options) {
|
||||||
|
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||||
|
|
||||||
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
|
options.delay = {
|
||||||
|
show: options.delay
|
||||||
|
, hide: options.delay
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getDelegateOptions = function () {
|
||||||
|
var options = {}
|
||||||
|
var defaults = this.getDefaults()
|
||||||
|
|
||||||
|
this._options && $.each(this._options, function (key, value) {
|
||||||
|
if (defaults[key] != value) options[key] = value
|
||||||
|
})
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enter = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'in'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'in') self.show()
|
||||||
|
}, self.options.delay.show)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.leave = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'out'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'out') self.hide()
|
||||||
|
}, self.options.delay.hide)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.show = function () {
|
||||||
|
var e = $.Event('show.bs.'+ this.type)
|
||||||
|
|
||||||
|
if (this.hasContent() && this.enabled) {
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var $tip = this.tip()
|
||||||
|
|
||||||
|
this.setContent()
|
||||||
|
|
||||||
|
if (this.options.animation) $tip.addClass('fade')
|
||||||
|
|
||||||
|
var placement = typeof this.options.placement == 'function' ?
|
||||||
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
|
this.options.placement
|
||||||
|
|
||||||
|
var autoToken = /\s?auto?\s?/i
|
||||||
|
var autoPlace = autoToken.test(placement)
|
||||||
|
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.detach()
|
||||||
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
|
.addClass(placement)
|
||||||
|
|
||||||
|
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||||
|
|
||||||
|
var pos = this.getPosition()
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (autoPlace) {
|
||||||
|
var $parent = this.$element.parent()
|
||||||
|
|
||||||
|
var orgPlacement = placement
|
||||||
|
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
|
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
|
||||||
|
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
|
||||||
|
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
|
||||||
|
|
||||||
|
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
|
||||||
|
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
|
||||||
|
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
|
||||||
|
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
|
||||||
|
placement
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.removeClass(orgPlacement)
|
||||||
|
.addClass(placement)
|
||||||
|
}
|
||||||
|
|
||||||
|
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
||||||
|
|
||||||
|
this.applyPlacement(calculatedOffset, placement)
|
||||||
|
this.$element.trigger('shown.bs.' + this.type)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.applyPlacement = function(offset, placement) {
|
||||||
|
var replace
|
||||||
|
var $tip = this.tip()
|
||||||
|
var width = $tip[0].offsetWidth
|
||||||
|
var height = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
// manually read margins because getBoundingClientRect includes difference
|
||||||
|
var marginTop = parseInt($tip.css('margin-top'), 10)
|
||||||
|
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
||||||
|
|
||||||
|
// we must check for NaN for ie 8/9
|
||||||
|
if (isNaN(marginTop)) marginTop = 0
|
||||||
|
if (isNaN(marginLeft)) marginLeft = 0
|
||||||
|
|
||||||
|
offset.top = offset.top + marginTop
|
||||||
|
offset.left = offset.left + marginLeft
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.offset(offset)
|
||||||
|
.addClass('in')
|
||||||
|
|
||||||
|
// check to see if placing tip in new offset caused the tip to resize itself
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
replace = true
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/bottom|top/.test(placement)) {
|
||||||
|
var delta = 0
|
||||||
|
|
||||||
|
if (offset.left < 0) {
|
||||||
|
delta = offset.left * -2
|
||||||
|
offset.left = 0
|
||||||
|
|
||||||
|
$tip.offset(offset)
|
||||||
|
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||||
|
} else {
|
||||||
|
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace) $tip.offset(offset)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
|
||||||
|
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.setContent = function () {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var title = this.getTitle()
|
||||||
|
|
||||||
|
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||||
|
$tip.removeClass('fade in top bottom left right')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.hide = function () {
|
||||||
|
var that = this
|
||||||
|
var $tip = this.tip()
|
||||||
|
var e = $.Event('hide.bs.' + this.type)
|
||||||
|
|
||||||
|
function complete() {
|
||||||
|
if (that.hoverState != 'in') $tip.detach()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$tip.removeClass('in')
|
||||||
|
|
||||||
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
|
$tip
|
||||||
|
.one($.support.transition.end, complete)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
complete()
|
||||||
|
|
||||||
|
this.$element.trigger('hidden.bs.' + this.type)
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.fixTitle = function () {
|
||||||
|
var $e = this.$element
|
||||||
|
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||||
|
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.hasContent = function () {
|
||||||
|
return this.getTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getPosition = function () {
|
||||||
|
var el = this.$element[0]
|
||||||
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||||
|
width: el.offsetWidth
|
||||||
|
, height: el.offsetHeight
|
||||||
|
}, this.$element.offset())
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
||||||
|
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
||||||
|
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getTitle = function () {
|
||||||
|
var title
|
||||||
|
var $e = this.$element
|
||||||
|
var o = this.options
|
||||||
|
|
||||||
|
title = $e.attr('data-original-title')
|
||||||
|
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||||
|
|
||||||
|
return title
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.tip = function () {
|
||||||
|
return this.$tip = this.$tip || $(this.options.template)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.arrow = function () {
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.validate = function () {
|
||||||
|
if (!this.$element[0].parentNode) {
|
||||||
|
this.hide()
|
||||||
|
this.$element = null
|
||||||
|
this.options = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enable = function () {
|
||||||
|
this.enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.disable = function () {
|
||||||
|
this.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.toggleEnabled = function () {
|
||||||
|
this.enabled = !this.enabled
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.toggle = function (e) {
|
||||||
|
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
|
||||||
|
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.destroy = function () {
|
||||||
|
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TOOLTIP PLUGIN DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var old = $.fn.tooltip
|
||||||
|
|
||||||
|
$.fn.tooltip = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.tooltip')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.tooltip.Constructor = Tooltip
|
||||||
|
|
||||||
|
|
||||||
|
// TOOLTIP NO CONFLICT
|
||||||
|
// ===================
|
||||||
|
|
||||||
|
$.fn.tooltip.noConflict = function () {
|
||||||
|
$.fn.tooltip = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,56 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: transition.js v3.0.3
|
||||||
|
* http://getbootstrap.com/javascript/#transitions
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2013 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) { "use strict";
|
||||||
|
|
||||||
|
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
function transitionEnd() {
|
||||||
|
var el = document.createElement('bootstrap')
|
||||||
|
|
||||||
|
var transEndEventNames = {
|
||||||
|
'WebkitTransition' : 'webkitTransitionEnd'
|
||||||
|
, 'MozTransition' : 'transitionend'
|
||||||
|
, 'OTransition' : 'oTransitionEnd otransitionend'
|
||||||
|
, 'transition' : 'transitionend'
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var name in transEndEventNames) {
|
||||||
|
if (el.style[name] !== undefined) {
|
||||||
|
return { end: transEndEventNames[name] }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// http://blog.alexmaccaw.com/css-transitions
|
||||||
|
$.fn.emulateTransitionEnd = function (duration) {
|
||||||
|
var called = false, $el = this
|
||||||
|
$(this).one($.support.transition.end, function () { called = true })
|
||||||
|
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
||||||
|
setTimeout(callback, duration)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$.support.transition = transitionEnd()
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
|
@ -0,0 +1,7 @@
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
ga('create', 'UA-46523987-1', 'trustie.net');
|
||||||
|
ga('send', 'pageview');
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,110 @@
|
||||||
|
/* 应用bootstrap之后,定制化的css, less是个问题
|
||||||
|
*******************************************************************************/
|
||||||
|
* {
|
||||||
|
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif !important;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
padding-top: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-left{ float: left; }
|
||||||
|
.float-right{ float: right; }
|
||||||
|
.clearfix {
|
||||||
|
width: 100%;
|
||||||
|
height: 0px;
|
||||||
|
clear: both;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.ul-style-none{
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block-inline{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-box {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
-box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-inline {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*文字不换行*/
|
||||||
|
.text_nowrap {
|
||||||
|
word-break: keep-all;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*字体 斜体*/
|
||||||
|
.font-italic {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*字体加粗*/
|
||||||
|
.font-bolder {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear-both {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-width-layouts{
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
/* block 未定义宽度时候 居中 */
|
||||||
|
.center {
|
||||||
|
width: auto;
|
||||||
|
display: table;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*颜色*/
|
||||||
|
.muted{
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* footer */
|
||||||
|
#footer{
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
#footer .desc a{
|
||||||
|
margin: 0px 5px;
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
margin: 0px 0 0 0;
|
margin: 0px 0 0 0;
|
||||||
width: 970px;
|
width: 970px;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.header2{
|
.header2{
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -15,6 +16,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
right: 50%;
|
right: 50%;
|
||||||
background-color: #000000
|
background-color: #000000
|
||||||
|
|
||||||
}
|
}
|
||||||
.col1{
|
.col1{
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -28,14 +30,36 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
float: left;
|
float: left;
|
||||||
width: 470px;
|
width: 440px;
|
||||||
left: 3%;
|
left: 2%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover, a:active {
|
a:hover, a:active {
|
||||||
color: #c61a1a;
|
color: #c61a1a;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tag {
|
||||||
|
background: url("../images/issue_tag.png") no-repeat scroll right -19px rgba(0, 0, 0, 0);
|
||||||
|
border-radius: 3px;
|
||||||
|
color: #3A587D !important;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 13px;
|
||||||
|
margin: 3px;
|
||||||
|
padding: 1px 4px 2px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#buglist
|
||||||
|
{
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,19 @@
|
||||||
.li_list {
|
.li_list {
|
||||||
clear:both;
|
clear:both;
|
||||||
padding:0 0 0 0px;
|
padding:0 0 0 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.li_time {
|
.li_time {
|
||||||
padding:0 7px 0 0;
|
padding:0 7px 0 0;
|
||||||
|
list-style-type: square;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ol.linenums {
|
ol.linenums {
|
||||||
margin:0 0 0 20px;
|
margin:0 0 0 20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ol.linenums li {
|
ol.linenums li {
|
||||||
|
@ -31,6 +34,7 @@ padding:0;
|
||||||
background-color:#105DB5;
|
background-color:#105DB5;
|
||||||
color:#FFF;
|
color:#FFF;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.li_list li,.na_list li {
|
.li_list li,.na_list li {
|
||||||
|
@ -38,6 +42,12 @@ clear:both;
|
||||||
height:18px;
|
height:18px;
|
||||||
list-style-type:square;
|
list-style-type:square;
|
||||||
padding:2px;
|
padding:2px;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,3 +63,11 @@ font-size:18px;
|
||||||
div.pages .break,.created a {
|
div.pages .break,.created a {
|
||||||
color:#999;
|
color:#999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tag_fouse {
|
||||||
|
font-family: "Microsoft YaHei";
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
padding-top: 3px;
|
||||||
|
}
|
|
@ -1,5 +1,9 @@
|
||||||
/* TODO: base/common/page 准备封装一些基本样式组合调用 参考YUI
|
/* TODO: base/common/page 准备封装一些基本样式组合调用 参考YUI
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
* {
|
||||||
|
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
span[id^=valid_user] {
|
span[id^=valid_user] {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
|
@ -90,10 +94,6 @@ span[id^=valid_user] {
|
||||||
color: #E8770D;
|
color: #E8770D;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
|
||||||
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 模态窗口
|
/* 模态窗口
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
/** jRating CSS **/
|
/** jRating CSS **/
|
||||||
|
|
|
@ -399,7 +399,7 @@ a.attachments_list_color {
|
||||||
/************************** 贴吧动态 开始 *****************************/
|
/************************** 贴吧动态 开始 *****************************/
|
||||||
/*贴吧活动*/
|
/*贴吧活动*/
|
||||||
.memo_activity{
|
.memo_activity{
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
/*帖子li*/
|
/*帖子li*/
|
||||||
.memo_activity .message-brief-intro{
|
.memo_activity .message-brief-intro{
|
||||||
|
@ -418,6 +418,7 @@ a.attachments_list_color {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
background: url('../images/list-icon.png') no-repeat scroll left center;
|
background: url('../images/list-icon.png') no-repeat scroll left center;
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
|
max-width: 100%
|
||||||
}
|
}
|
||||||
/*帖子标题前吧名*/
|
/*帖子标题前吧名*/
|
||||||
.memo_activity .memo_Bar_title{
|
.memo_activity .memo_Bar_title{
|
||||||
|
|
Loading…
Reference in New Issue