From 10aa8eee8109cab7c2dbf9aabd913f5cd4132e79 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Thu, 22 May 2014 09:50:37 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E5=B8=83=E8=80=85=E5=92=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- app/views/open_source_projects/_show_memo.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f6966e146..98b0eb31e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -474,7 +474,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 diff --git a/app/views/open_source_projects/_show_memo.html.erb b/app/views/open_source_projects/_show_memo.html.erb index 8c1cbc819..f7027c7f2 100644 --- a/app/views/open_source_projects/_show_memo.html.erb +++ b/app/views/open_source_projects/_show_memo.html.erb @@ -48,11 +48,11 @@ - + 帖子来源:<%=link_to 'OSChina', topic.url %> From 0b79cbac32419b32ed7a832f821174b73136d49b Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Thu, 22 May 2014 10:28:09 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=B8=96=E5=AD=90=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E8=87=AA=E5=B7=B1=E7=A4=BE=E5=8C=BA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E6=98=AF=E7=9B=B4=E6=8E=A5=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=88=B0=E5=85=B6=E4=BB=96=E7=9A=84=E7=BD=91=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/open_source_projects/_show_memo.html.erb | 7 ++++++- app/views/open_source_projects/_show_topics.html.erb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/open_source_projects/_show_memo.html.erb b/app/views/open_source_projects/_show_memo.html.erb index f7027c7f2..63de42132 100644 --- a/app/views/open_source_projects/_show_memo.html.erb +++ b/app/views/open_source_projects/_show_memo.html.erb @@ -14,7 +14,12 @@ - +
<%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %> + <% 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 %> diff --git a/app/views/open_source_projects/_show_topics.html.erb b/app/views/open_source_projects/_show_topics.html.erb index c6df07c8e..c58f0ce22 100644 --- a/app/views/open_source_projects/_show_topics.html.erb +++ b/app/views/open_source_projects/_show_topics.html.erb @@ -366,7 +366,7 @@
- +
<%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %><%= link_to h(topic.subject), topic.url %> From daa531268ae57af036ae4b9297e4a31ffd9dc455 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Thu, 22 May 2014 11:05:15 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=BC=8F=E6=B4=9E=E7=9A=84=E5=85=B3=E8=81=94=E8=A1=A8=20?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/bug_to_osp.rb | 3 +++ ...0522025137_add_topic_resource_to_relative_memo.rb | 5 +++++ db/migrate/20140522025721_create_bug_to_osps.rb | 10 ++++++++++ db/schema.rb | 12 +++++++++++- test/fixtures/bug_to_osps.yml | 11 +++++++++++ test/unit/bug_to_osp_test.rb | 7 +++++++ 6 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 app/models/bug_to_osp.rb create mode 100644 db/migrate/20140522025137_add_topic_resource_to_relative_memo.rb create mode 100644 db/migrate/20140522025721_create_bug_to_osps.rb create mode 100644 test/fixtures/bug_to_osps.yml create mode 100644 test/unit/bug_to_osp_test.rb diff --git a/app/models/bug_to_osp.rb b/app/models/bug_to_osp.rb new file mode 100644 index 000000000..7cfca2aa6 --- /dev/null +++ b/app/models/bug_to_osp.rb @@ -0,0 +1,3 @@ +class BugToOsp < ActiveRecord::Base + # attr_accessible :title, :body +end diff --git a/db/migrate/20140522025137_add_topic_resource_to_relative_memo.rb b/db/migrate/20140522025137_add_topic_resource_to_relative_memo.rb new file mode 100644 index 000000000..67081d482 --- /dev/null +++ b/db/migrate/20140522025137_add_topic_resource_to_relative_memo.rb @@ -0,0 +1,5 @@ +class AddTopicResourceToRelativeMemo < ActiveRecord::Migration + def change + add_column :relative_memos, :topic_resource, :string + end +end diff --git a/db/migrate/20140522025721_create_bug_to_osps.rb b/db/migrate/20140522025721_create_bug_to_osps.rb new file mode 100644 index 000000000..3a562fa14 --- /dev/null +++ b/db/migrate/20140522025721_create_bug_to_osps.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 51246fb0b..de3a68d08 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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 diff --git a/test/fixtures/bug_to_osps.yml b/test/fixtures/bug_to_osps.yml new file mode 100644 index 000000000..c63aac0b6 --- /dev/null +++ b/test/fixtures/bug_to_osps.yml @@ -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 diff --git a/test/unit/bug_to_osp_test.rb b/test/unit/bug_to_osp_test.rb new file mode 100644 index 000000000..5e466f081 --- /dev/null +++ b/test/unit/bug_to_osp_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class BugToOspTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From f0f807b2dea6df60d29f41d864120762ff55167e Mon Sep 17 00:00:00 2001 From: ganyiang Date: Thu, 22 May 2014 15:14:26 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9OSP=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E7=9A=84=E6=80=81=E5=8A=BF=E5=88=86=E6=9E=90=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=9B=20=E4=BB=85=E4=BE=9B=E6=BC=94?= =?UTF-8?q?=E7=A4=BA=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_show_topics.html.erb | 93 ++++++++++++++++--- app/views/open_source_projects/index.html.erb | 39 +++++++- 2 files changed, 114 insertions(+), 18 deletions(-) diff --git a/app/views/open_source_projects/_show_topics.html.erb b/app/views/open_source_projects/_show_topics.html.erb index c6df07c8e..b78497011 100644 --- a/app/views/open_source_projects/_show_topics.html.erb +++ b/app/views/open_source_projects/_show_topics.html.erb @@ -34,7 +34,7 @@ - +
  • >[SQL注入漏洞]Apache/NGINX 下 PHP-FPM
  • >[SQL注入漏洞]AlienVault OSSIM SQL注入
  • @@ -52,23 +52,32 @@
    - +

    全球热帖

    <%= link_to "更多>>", :controller => "open_source_projects",:action => "showmemo", :id => @open_source_project.id %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4ff4b0c55..190fc7d0e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1906,4 +1906,5 @@ zh: # ajax异步验证 modal_valid_passing: 可以使用 + label_bug: 漏洞 \ No newline at end of file