Merge remote-tracking branch 'remotes/origin/develop' into szzh

Conflicts:
	Gemfile
	app/controllers/users_controller.rb
	db/schema.rb
exceptionHandle
yanxd 11 years ago
commit b33ee17343

@ -21,6 +21,18 @@ group :development do
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler' gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
end end
# 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"

@ -53,7 +53,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)
@ -99,6 +108,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)
@ -110,6 +124,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
@ -121,6 +138,7 @@ DEPENDENCIES
better_errors! better_errors!
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)
@ -130,4 +148,6 @@ DEPENDENCIES
rack-openid rack-openid
rails (= 3.2.13) rails (= 3.2.13)
ruby-openid (~> 2.1.4) ruby-openid (~> 2.1.4)
sass-rails (~> 3.2.3)
seems_rateable! seems_rateable!
uglifier (>= 1.0.3)

@ -5,7 +5,8 @@ class ContestsController < ApplicationController
menu_item :project, :only => :show_project menu_item :project, :only => :show_project
menu_item :application, :only => :show_softapplication menu_item :application, :only => :show_softapplication
menu_item :attendingcontest, :only => :show_attendingcontest menu_item :attendingcontest, :only => :show_attendingcontest
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward, menu_item :contestnotification, :only => :show_notification
before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :show_notification, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward,
:show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings] :show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings]
# added by fq # added by fq
@ -355,6 +356,17 @@ class ContestsController < ApplicationController
end end
###end ###end
def show_notification
@contest = Contest.find_by_id(params[:id])
respond_to do |format|
format.html {
render :layout => 'base_newcontest'
}
format.api
end
end
def set_reward_project def set_reward_project
@c_p = nil @c_p = nil

@ -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,64 @@ class OpenSourceProjectsController < ApplicationController
format.json { render json: @open_source_project } format.json { render json: @open_source_project }
end end
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 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 暴力添加,请绕道 @memo = RelativeMemo.new(:open_source_project => @open_source_project)
def showmemo @topic_count = @open_source_project.bugs.count
@open_source_project = OpenSourceProject.find(params[:id]) @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' respond_to do |format|
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at", 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", '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.topics.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.topics.
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 +143,14 @@ 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
# 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?

@ -47,7 +47,7 @@ class SoftapplicationsController < ApplicationController
def show def show
@softapplication = Softapplication.find(params[:id]) @softapplication = Softapplication.find(params[:id])
@project = Project.find_by_identifier(@softapplication.deposit_project) @project = @softapplication.project
# 打分统计 # 打分统计
stars_reates = @softapplication. stars_reates = @softapplication.
rates(:quality) rates(:quality)
@ -142,13 +142,16 @@ class SoftapplicationsController < ApplicationController
def create def create
@softapplication = Softapplication.new(params[:softapplication]) @softapplication = Softapplication.new(params[:softapplication])
@softapplication.user = User.current @softapplication.user = User.current
@softapplication.deposit_project = params[:project] #@softapplication.deposit_project = params[:project]
@softapplication.project = Project.find_by_id(params[:project])
@softapplication.save_attachments(params[:attachments]) @softapplication.save_attachments(params[:attachments])
respond_to do |format| respond_to do |format|
if @softapplication.save if @softapplication.save
ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id) ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id)
#ProjectingSoftapplication.create_softapplication_projecting(:project_id => params[:project_id], :softapplication_id => @softapplication.id)
#ProjectingSoftapplication.create_softapplication_projecting(@project.id, softapplication.id)
format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) } format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) }
# format.json { render json: @softapplication, status: :created, location: @softapplication } # format.json { render json: @softapplication, status: :created, location: @softapplication }
else else
@ -170,7 +173,8 @@ class SoftapplicationsController < ApplicationController
# @softapplication = Softapplication.find(params[:id]) # @softapplication = Softapplication.find(params[:id])
@softapplication.attachments.map{|attach| attach.destroy } @softapplication.attachments.map{|attach| attach.destroy }
@softapplication.save_attachments(params[:attachments]) @softapplication.save_attachments(params[:attachments])
@softapplication.deposit_project = params[:project] #@softapplication.deposit_project = params[:project]
@softapplication.project = Project.find_by_id(params[:project])
respond_to do |format| respond_to do |format|
if @softapplication.update_attributes(params[:softapplication]) if @softapplication.update_attributes(params[:softapplication])
format.html { redirect_to @softapplication, notice: l(:notice_softapplication_was_successfully_updated) } format.html { redirect_to @softapplication, notice: l(:notice_softapplication_was_successfully_updated) }

@ -750,7 +750,7 @@ module ApplicationHelper
tmp = Hash.new tmp = Hash.new
tmp={"" => ""} tmp={"" => ""}
option.each do |project| option.each do |project|
tmp[project.name] = project.identifier tmp[project.name] = project.id
end end
tmp tmp
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?

@ -6,10 +6,11 @@ class Softapplication < ActiveRecord::Base
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :contesting_softapplications, :dependent => :destroy has_many :contesting_softapplications, :dependent => :destroy
has_many :projecting_softapplications, :dependent => :destroy #has_many :projecting_softapplications, :dependent => :destroy
belongs_to :user belongs_to :user
belongs_to :project belongs_to :project
has_many :contests, :through => :contesting_softapplications has_many :contests, :through => :contesting_softapplications
belongs_to :project
def add_jour(user, notes, reference_user_id = 0, options = {}) def add_jour(user, notes, reference_user_id = 0, options = {})
if options.count == 0 if options.count == 0

@ -4,7 +4,7 @@
<div style="padding-left: 18px"> <div style="padding-left: 18px">
<div style="font-size: 15px"> <div style="font-size: 15px">
<tr> <tr>
<td><strong>应用软件:</strong></td> <td><strong><%=l(:label_softapplication)%>:</strong></td>
<td> <td>
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %>
</td> </td>
@ -12,7 +12,7 @@
</div> </div>
<div style="padding-left: 68px"> <div style="padding-left: 68px">
<tr> <tr>
<td>简介:</td> <td><%=l(:label_profile)%>:</td>
<td> <td>
<%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
</td> </td>
@ -20,7 +20,7 @@
</div> </div>
<div style="padding-left: 68px; padding-bottom: 8px"> <div style="padding-left: 68px; padding-bottom: 8px">
<tr> <tr>
<td>发布时间</td> <td><%=l(:label_activity_time)%></td>
<td> <td>
<%=format_time c_softapplication.created_at %> <%=format_time c_softapplication.created_at %>
</td> </td>

@ -45,7 +45,7 @@
</table> </table>
<!-- end --> <!-- end -->
<% else %> <% else %>
<div style="font-size: 14px;margin:10px;"> <div style="font-size: 14px;margin:10px;padding-left: 13px">
<%= l(:label_user_login_tips) %> <%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %> <%= link_to l(:label_user_login_new), signin_path %>
</div> </div>

@ -36,7 +36,7 @@
} }
</style> </style>
<h3 class="title">请输入竞赛密码</h3> <h3 class="title"><%=l(:label_please_input_password)%></h3>
<%= form_tag( join_in_contest_contests_path(id: contest.id), <%= form_tag( join_in_contest_contests_path(id: contest.id),
:remote => true, :remote => true,

@ -1,4 +1,4 @@
$('#contesting_project_list').html('<%= escape_javascript(render(:partial => 'project_list', :locals => {:contesting_project => @contesting_project})) %>'); $('#contesting_project_list').html('<%= escape_javascript(render(:partial => 'project_list', :locals => {:contesting_project => @contesting_project})) %>');
$("#project_id").val("请选择项目"); $("#project_id").val("<%= l(:label_please_select_project) %>");
$("#contest_message").val( "<%= l(:label_bid_reason) %>" ); $("#contest_message").val( "<%= l(:label_bid_reason) %>" );
$("#put-bid-form").hide(); $("#put-bid-form").hide();

@ -1,4 +1,4 @@
$('#contesting_softapplication_list').html('<%= escape_javascript(render(:partial => 'softapplication_list', :locals => {:contesting_softapplication => @contesting_softapplication})) %>'); $('#contesting_softapplication_list').html('<%= escape_javascript(render(:partial => 'softapplication_list', :locals => {:contesting_softapplication => @contesting_softapplication})) %>');
$("#softapplication_id").val("请选择参赛应用"); $("#softapplication_id").val("<%= l(:label_please_select_contestingsoftapplication) %>");
$("#contest_message").val( "<%= l(:label_bid_reason) %>" ); $("#contest_message").val( "<%= l(:label_bid_reason) %>" );
$("#put-bid-form").hide(); $("#put-bid-form").hide();

File diff suppressed because it is too large Load Diff

@ -68,7 +68,7 @@
<td> <td>
<p> <p>
<div class="font_lighter" style="font-size: 13px;"> <div class="font_lighter" style="font-size: 13px;">
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target=>'_blank'%> <!--跳转到project的new.html.erb--> <%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target=>'_blank'%> <!--跳转到project的new.html.erb-->
</div> </div>
</p> </p>
</td> </td>

@ -68,7 +68,7 @@
<td> <td>
<p> <p>
<div class="font_lighter" style="font-size: 13px;"> <div class="font_lighter" style="font-size: 13px;">
<%= link_to '发布应用', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %> <%= link_to l(:label_release_softapplication), new_softapplication_path(:target=>'_blank'), :target=>'_blank' %>
</div> </div>
</p> </p>
</td> </td>

@ -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,17 @@
</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> <td colspan="3" align="center"><%= no_use_link(topic, User.current) %> </td>
</tr> </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>

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

Loading…
Cancel
Save