Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

exceptionHandle
xianbo 11 years ago
commit cda9942723

@ -65,6 +65,8 @@ class OpenSourceProjectsController < ApplicationController
offset(@topic_pages.offset).
order(sort_clause).
all
@bugs = @open_source_project.bugs.limit(6)
respond_to do |format|
format.html {

@ -473,7 +473,7 @@ module ApplicationHelper
end
def user_url_and_time(user_name, user_url, created)
unless user_name.nil?
unless user_name.nil? || user_name == ''
l(:label_added_time_by, :author => link_to(user_name, user_url), :age => time_tag(created)).html_safe
else
l(:label_added_time, :age => time_tag(created)).html_safe

@ -38,4 +38,12 @@ module OpenSourceProjectsHelper
def show_origin(url)
end
def show_description(bug, open_source_project)
description = BugToOsp.where("osp_id = ? and relative_memo_id = ?", open_source_project.id, bug.id).first.description
if description.nil? || description == ''
description = open_source_project.name + l(:label_bug)
end
description
end
end

@ -0,0 +1,8 @@
class BugToOsp < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :open_source_project, :foreign_key => "osp_id"
belongs_to :bug, :class_name => 'RelativeMemo', :foreign_key => "relative_memo_id"
validates_presence_of :osp_id, :relative_memo_id
end

@ -13,6 +13,10 @@ class OpenSourceProject < ActiveRecord::Base
has_many :admin, :through => :masters, :class_name => 'User'
has_many :apply_tips, :class_name => 'ApplyProjectMaster', :as => :apply, :dependent => :delete_all, :conditions => "#{ApplyProjectMaster.table_name}.status = 1"
has_many :applicants, :class_name => 'User', :through => :apply_tips, :source => :user
has_many :bugs_to_osp, :class_name => 'BugToOsp', :foreign_key => 'osp_id', :dependent => :destroy
has_many :bugs, :through => :bugs_to_osp, :class_name => "RelativeMemo", :order => "#{RelativeMemo.table_name}.created_at DESC"
validates_uniqueness_of :name

@ -11,6 +11,9 @@ class RelativeMemo < ActiveRecord::Base
has_many :no_uses, :as => :no_use, :dependent => :delete_all
has_many :bugs_to_osp, :class_name => 'BugToOsp', :foreign_key => 'relative_memo_id', :dependent => :destroy
acts_as_taggable
validates_presence_of :subject

@ -14,7 +14,12 @@
<td>
<table width="630px" border="0">
<tr>
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %></td>
<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 %>
<% end %></td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>
@ -48,11 +53,11 @@
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
</tr>
<!-- <tr>
<td align="left" colspan="2" ><span class="font_lighter"><%#= authoring topic.created_at, topic.author %>
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<br />
</span></td>
</tr> -->
</tr>
<tr>
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
</span></td>

@ -24,25 +24,29 @@
<div class="fixed"></div>
<div class="li_list" style="margin-top:10px;margin-left:10px">
<ul style="list-style-type: square;">
<% @bugs.each do |bug| %>
<li><span class="li_time">>[<%= show_description(bug, open_source_project) %>]</span><%= link_to bug.subject, bug.url %></li>
<% 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">>[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">>[远程溢出漏洞]</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-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">>[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">>[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-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>
<!-- <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>
</div>
</div>
@ -52,23 +56,32 @@
<script type="text/javascript">
$(function(){
var flow=[];
for(var i=0;i<35;i++){
for(var i=0;i<24+5;i++){
flow.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
}
var data = [
{
name : 'commit',
name :'',
value:flow,
color:'#0d8ecf',
line_width:2
}
];
var labels = ["","2010","2011","2012","2013","2014"];
//创建x轴标签文本
var date = new Date()
var labels = [];
/* labels.push(date.getFullYear()-2);
labels.push(date.getFullYear()-1);
labels.push(date.getFullYear());*/
labels=["2012","","","","","","","","","","","","2013","","","","","","","","","","","","2014","","","",""];
var line = new iChart.LineBasic2D({
render : 'canvasDiv',
data: data,
@ -109,9 +122,30 @@
width:2,
color:'#3f8695'
},
},
// legend : {
listeners:{
//tip:提示框对象、name:数据名称、value:数据值、text:当前文本、i:数据点的索引
parseText:function(tip,name,value,text,i){
return name+"漏洞数:"+value;
}
} ,
},
tipMocker:function(tips,i){
var index;
if (Math.floor(i/12)==0) {
index=0;
}else if (Math.floor(i/12)==1) {
index=12;
}else{
index=24;
};
return "<div style='font-weight:400'>"+
labels[index]+" "+//日期
((i%12)==0?"1 月":((i%12+1))+"月")+ //时间
"</div>"+tips.join("<br/>");
},
// legend : {
// enable : true,
// row:1,//设置在一行上显示与column配合使用
// column : 'max',
@ -226,7 +260,7 @@
<!-- <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-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>
@ -243,22 +277,35 @@
<script type="text/javascript">
$(function(){
var flow=[];
for(var i=0;i<35;i++){
for(var i=0;i<24+5;i++){
flow.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
}
var data = [
{
name : 'commit',
name : '',
value:flow,
color:'#0d8ecf',
line_width:2
}
];
var labels = ["","2010","2011","2012","2013","2014"];
//创建x轴标签文本
var date = new Date()
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","","","",""];
var line = new iChart.LineBasic2D({
render : 'canvasDiv2',
@ -300,7 +347,29 @@
width:2,
color:'#3f8695'
},
listeners:{
//tip:提示框对象、name:数据名称、value:数据值、text:当前文本、i:数据点的索引
parseText:function(tip,name,value,text,i){
return name+"帖子数:"+value+"万";
}
} ,
},
tipMocker:function(tips,i){
var index;
if (Math.floor(i/12)==0) {
index=0;
}else if (Math.floor(i/12)==1) {
index=12;
}else{
index=24;
};
return "<div style='font-weight:400'>"+
labels[index]+" "+//日期
((i%12)==0?"1 月":((i%12+1))+"月")+ //时间
"</div>"+tips.join("<br/>");
},
crosshair:{
enable:true, //十字交叉线
line_color:'#62bce9'
@ -352,7 +421,7 @@
</script>
<!--我是分割线2===================================================================================================-->
<div class="borad-topic-count" style="margin-top:10px">
<!-- 共有 <%= link_to memos.count %> 个贴子 -->
<!-- 共有 <%#= link_to memos.count %> 个贴子 -->
<span><h1 style="color:#7591cc;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>
@ -366,7 +435,7 @@
<td>
<table width="630px" border="0">
<tr>
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %></td>
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), topic.url %></td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>

@ -148,7 +148,7 @@ li {
<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 class="fixed"></div>
<div class="li_list" style="margin-top:10px;margin-left:10px">
<div id ="buglist" 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>
@ -178,22 +178,32 @@ li {
<script type="text/javascript">
$(function(){
var flow=[];
for(var i=0;i<35;i++){
for(var i=0;i<24+5;i++){
flow.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
}
var data = [
{
name : 'commit',
name : '',
value:flow,
color:'#0d8ecf',
line_width:2
}
];
//创建x轴标签文本
var date = new Date()
var labels = [];
/* labels.push(date.getFullYear()-2);
labels.push(date.getFullYear()-1);
labels.push(date.getFullYear());*/
labels=["2012","","","","","","","","","","","","2013","","","","","","","","","","","","2014","","","",""];
var labels = ["","2010","2011","2012","2013","2014"];
//var labels = ["","2010","2011","2012","2013","2014"];
var line = new iChart.LineBasic2D({
render : 'canvasDiv',
@ -220,8 +230,29 @@ li {
radius : 5,
width:2,
color:'#3f8695'
},
},
listeners:{
//tip:提示框对象、name:数据名称、value:数据值、text:当前文本、i:数据点的索引
parseText:function(tip,name,value,text,i){
return name+"漏洞数:"+value;
}
} ,
},
tipMocker:function(tips,i){
var index;
if (Math.floor(i/12)==0) {
index=0;
}else if (Math.floor(i/12)==1) {
index=12;
}else{
index=24;
};
return "<div style='font-weight:400'>"+
labels[index]+" "+//日期
((i%12)==0?"1 月":((i%12+1))+"月")+ //时间
"</div>"+tips.join("<br/>");
},
legend : {
enable : true,

@ -1916,4 +1916,5 @@ zh:
# ajax异步验证
modal_valid_passing: 可以使用
label_bug: 漏洞

@ -0,0 +1,5 @@
class AddTopicResourceToRelativeMemo < ActiveRecord::Migration
def change
add_column :relative_memos, :topic_resource, :string
end
end

@ -0,0 +1,10 @@
class CreateBugToOsps < ActiveRecord::Migration
def change
create_table :bug_to_osps do |t|
t.integer :osp_id
t.integer :relative_memo_id
t.string :description
t.timestamps
end
end
end

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140519074133) do
ActiveRecord::Schema.define(:version => 20140522025721) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -121,6 +121,14 @@ ActiveRecord::Schema.define(:version => 20140519074133) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id"
create_table "bug_to_osps", :force => true do |t|
t.integer "osp_id"
t.integer "relative_memo_id"
t.string "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "changes", :force => true do |t|
t.integer "changeset_id", :null => false
t.string "action", :limit => 1, :default => "", :null => false
@ -699,6 +707,7 @@ ActiveRecord::Schema.define(:version => 20140519074133) do
t.string "username"
t.string "userhomeurl"
t.date "date_collected"
t.string "topic_resource"
end
create_table "repositories", :force => true do |t|
@ -787,6 +796,7 @@ ActiveRecord::Schema.define(:version => 20140519074133) do
t.integer "softapplication_id"
t.integer "is_public"
t.string "application_developers"
t.string "deposit_project_url"
t.string "deposit_project"
end

File diff suppressed because it is too large Load Diff

@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value

@ -0,0 +1,7 @@
require 'test_helper'
class BugToOspTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
Loading…
Cancel
Save