Merge branch 'develop' into competition

Conflicts:
	config/routes.rb
	lib/redmine.rb
president
wanglinchun 11 years ago
commit 6a8d697582

@ -15,6 +15,18 @@ gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0"
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
group :ldap do
gem "net-ldap", "~> 0.3.1"

@ -40,7 +40,16 @@ GEM
arel (3.0.2)
builder (3.0.0)
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)
execjs (1.4.0)
multi_json (~> 1.0)
fastercsv (1.5.0)
hike (1.2.3)
i18n (0.6.1)
@ -86,6 +95,11 @@ GEM
rdoc (3.12.2)
json (~> 1.4)
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)
hike (~> 1.2)
multi_json (~> 1.0)
@ -97,6 +111,9 @@ GEM
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
uglifier (1.0.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
PLATFORMS
x86-mingw32
@ -107,6 +124,7 @@ DEPENDENCIES
acts-as-taggable-on
builder (= 3.0.0)
coderay (~> 1.0.6)
coffee-rails (~> 3.2.1)
fastercsv (~> 1.5.0)
i18n (~> 0.6.0)
jquery-rails (~> 2.0.2)
@ -116,4 +134,6 @@ DEPENDENCIES
rails (= 3.2.13)
rdoc (>= 2.4.2)
ruby-openid (~> 2.1.4)
sass-rails (~> 3.2.3)
seems_rateable!
uglifier (>= 1.0.3)

@ -23,6 +23,7 @@ class AdminController < ApplicationController
before_filter :require_admin
helper :sort
helper :Users
include SortHelper
def index
@ -39,6 +40,121 @@ class AdminController < ApplicationController
render :action => "projects", :layout => false if request.xhr?
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
@plugins = Redmine::Plugin.all
end

@ -1,8 +1,8 @@
class OpenSourceProjectsController < ApplicationController
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]
helper :sort
include SortHelper
helper :apply_project_masters
@ -12,6 +12,7 @@ class OpenSourceProjectsController < ApplicationController
# GET /open_source_projects
# GET /open_source_projects.json
def index
@app_dir = params[:app_dir]
@language = params[:language]
@created_at = params[:created_at]
@ -22,8 +23,10 @@ class OpenSourceProjectsController < ApplicationController
@os_project_count = @open_source_projects.count
@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)
@bugs = BugToOsp.order('created_at desc').limit(8)
# @open_source_projects = OpenSourceProject.all
@ -32,11 +35,11 @@ class OpenSourceProjectsController < ApplicationController
format.json { render json: @open_source_projects }
end
end
def master_apply
@apply = @open_source_project.apply_tips
@applicants = @open_source_project.applicants
respond_to do |format|
format.html {
render :layout => "base_opensource_p"
@ -49,7 +52,7 @@ class OpenSourceProjectsController < ApplicationController
# GET /open_source_projects/1.json
def show
@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",
@ -63,9 +66,9 @@ class OpenSourceProjectsController < ApplicationController
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
order(sort_clause).
all
@bugs = @open_source_project.bugs.limit(6)
respond_to do |format|
@ -75,26 +78,64 @@ class OpenSourceProjectsController < ApplicationController
format.json { render json: @open_source_project }
end
end
def allbug
@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
def search
def search
end
def showbug
@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)"
# added by yiang 暴力添加,请绕道
def showmemo
@open_source_project = OpenSourceProject.find(params[:id])
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
@topic_count = @open_source_project.bugs.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @open_source_project.bugs.
reorder("#{RelativeMemo.table_name}.sticky DESC").
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
all
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
respond_to do |format|
format.html {
render :layout => "base_opensource_p"
}
format.json { render json: @open_source_project }
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.
@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).
@ -102,13 +143,14 @@ def showmemo
order(sort_clause).
all
respond_to do |format|
format.html {
render :layout => "base_opensource_p"
}
format.json { render json: @open_source_project }
respond_to do |format|
format.html {
render :layout => "base_opensource_p"
}
format.json { render json: @open_source_project }
end
end
end
# GET /open_source_projects/new
# GET /open_source_projects/new.json
def new
@ -168,52 +210,51 @@ end
format.json { head :no_content }
end
end
def remove_condition
@app_dir = params[:app_dir]
@language = params[:language]
@created_at = params[:created_at]
redirect_to open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => @created_at, :name => params[:name])
end
def search
# per_page_option = 10
#
#
# @open_source_projects = OpenSourceProject.filter(@app_dir, @language, @created_at)
# @open_source_projects = @open_source_projects.like(params[:name]) if params[:name].present?
#
#
# @os_project_count = @open_source_projects.count
# @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)
redirect_to open_source_projects_path(:name => params[:name])
end
def refuse_master_apply
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
@apply.first.destory
redirect_to master_apply_open_source_project_path
end
def accept_master_apply
@apply = ApplyProjectMaster.where("user_id = ? and apply_id = ? and apply_type = 'OpenSourceProject'", params[:user_id], @open_source_project.id)
if @apply.count == 1
@apply.first.update_attributes(:status => 2)
@apply.first.update_attributes(:status => 2)
end
redirect_to master_apply_open_source_project_path
end
private
def require_master
render_403 unless @open_source_project.admin?(User.current)
end
def find_osp
@open_source_project = OpenSourceProject.find(params[:id])
render_404 unless @open_source_project.present?

@ -1,6 +1,9 @@
class TestController < ApplicationController
helper :UserScore
layout 'bootstrap_base'
def bootstrap; end
def zip
homeworks_attach_path = []

@ -67,7 +67,7 @@ class UsersController < ApplicationController
if User.current.admin?
@memberships = @user.memberships.all
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)
end
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
@ -565,7 +565,7 @@ class UsersController < ApplicationController
end
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
respond_to do |format|
format.html {
@ -782,7 +782,7 @@ class UsersController < ApplicationController
end
def setting_layout(default_base='base_users')
User.current.admin? ? 'base_admin' : default_base
User.current.admin? ? default_base : default_base
end
# 必填自己的工作单位,其实就是学校

@ -1338,9 +1338,22 @@ module ApplicationHelper
def hubspot_head
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')
unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
end
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
end
@ -1610,6 +1623,13 @@ module ApplicationHelper
def render_dynamic_nav
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_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}
@ -1630,7 +1650,6 @@ module ApplicationHelper
#@nav_dispaly_project_label
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(course_all_course_link) if @nav_dispaly_course_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|
content_li << content_tag(:li, nav_item)
end
content_tag :ul, content_li.html_safe
content_li.html_safe
end
def current_user
@ -1666,5 +1685,20 @@ module ApplicationHelper
# 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

@ -59,12 +59,11 @@ module IssuesHelper
def issue_heading(issue)
#h("#{issue.tracker} ##{issue.id}")
#h("#{issue.tracker} #{issue.source_from}")
# h("#{issue.tracker} #{issue.source_from}")
s = ''
s << ">>"
s << link_to(@issue.project.name+l(:issue_list), project_issues_path(@issue.project))
s << " >"
s << @issue.source_from
s << link_to(@issue.project.name, project_issues_path(@issue.project))
s << " > #"
s << @issue.project_index
s.html_safe
end

@ -46,4 +46,12 @@ module OpenSourceProjectsHelper
end
description
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

@ -5,4 +5,8 @@ class BugToOsp < ActiveRecord::Base
validates_presence_of :osp_id, :relative_memo_id
scope :visible, lambda {|*args|
nil
}
end

@ -1156,7 +1156,11 @@ class Issue < ActiveRecord::Base
# back string obj which is belong to project.
def source_from
"" << 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
private

@ -70,6 +70,11 @@ class RelativeMemo < ActiveRecord::Base
def cannot_reply_to_locked_topic
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
end
def short_content(length = 25)
str = "^(.{,#{length}})[^\n\r]*.*$"
content.gsub(Regexp.new(str), '\1...').strip if content
end
# def update_memos_forum
# 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 %>
&nbsp;
<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;") +
link_to('&nbsp;'.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}" %>
</span>
<% 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-->
<div class="borad-topic-count" style="margin-top:10px">
<span>共有 <%= link_to memos.count %> 个贴子 </span
<span>共有 <%= link_to @topic_count %> 个贴子 </span>
</div>
<div style="padding-top: 10px">
<% if memos.any? %>
@ -18,12 +18,12 @@
<% 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 %>
<%= 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), 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>
<td align="center">回帖</td>
@ -33,7 +33,7 @@
<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), 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>
<td align="center">关注</td>
@ -43,7 +43,7 @@
<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), 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>
<td align="center">浏览</td>
@ -51,17 +51,16 @@
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
<td><span class="font_description"> </span></td>
</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 />
</span></td>
</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>
<td align="left"><%= no_use_link(topic, User.current) %> </td>
</tr>

File diff suppressed because it is too large Load Diff

@ -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;
}
.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 {
width: 15px;
@ -129,8 +129,6 @@ li {
.nav-search-con{
padding-top: 7px;
}
</style>
<%= javascript_include_tag "ichart.1.2.min" %>
<%= stylesheet_link_tag "buglist-div-use.css" %>
@ -146,29 +144,13 @@ li {
</div>
<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 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;">
<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 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>
<% @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>
<% end %>
</ul>
</div>
</div>
@ -236,7 +218,7 @@ li {
parseText:function(tip,name,value,text,i){
return name+"漏洞数:"+value;
}
} ,
}
},
tipMocker:function(tips,i){
var index;
@ -272,7 +254,7 @@ li {
label:false, //是否显示数值
// hollow_inside:false,
smooth : true,//平滑曲线
point_size:2, // 焦点大小
point_size:2 // 焦点大小
// point_hollow : true,
@ -298,7 +280,7 @@ li {
start_scale:0,
scale_space:50,
end_scale:70,
scale_color:'#9f9f9f',
scale_color:'#9f9f9f'
// label : {color:'#ffffff',fontsize:11},
},{
@ -417,7 +399,7 @@ line.target.line(28,97,400,97,2,'#b32c0d')
</div>
<div class="nav-flexbox last">
<div class="nav-category">
<h4 title="上市时间">
<h4 title="上市时间"> </h4>
<div class="nav-category-wrap ">
</div>
</div>

@ -32,7 +32,7 @@
<!--modified by huang-->
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
<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? %>
</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)
) if @forum.destroyable_by?(User.current) %>
</div>
<div>
<%= render :partial => 'open_source_projects/show_memo', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
</div>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save