This commit is contained in:
z9hang 2014-05-30 13:41:04 +08:00
commit 4747375499
50 changed files with 1015 additions and 1631 deletions

12
Gemfile
View File

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

View File

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

View File

@ -5,7 +5,8 @@ class ContestsController < ApplicationController
menu_item :project, :only => :show_project
menu_item :application, :only => :show_softapplication
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]
# added by fq
@ -356,6 +357,17 @@ class ContestsController < ApplicationController
###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
@c_p = nil
@contesting_project_id = nil

View File

@ -70,7 +70,7 @@ class FilesController < ApplicationController
Mailer.attachments_added(attachments[:files]).deliver
end
# 临时用
# TODO: 临时用 nyan
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
'filename' => "#{Attachment.table_name}.filename",

View File

@ -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]
@ -25,6 +26,8 @@ class OpenSourceProjectsController < ApplicationController
@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
respond_to do |format|
@ -76,14 +79,52 @@ class OpenSourceProjectsController < ApplicationController
end
end
def allbug
@bugs = BugToOsp.visible
def search
@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
end
def showbug
@open_source_project = OpenSourceProject.find(params[:id])
# added by yiang 暴力添加,请绕道
def showmemo
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.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
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'
@ -108,7 +149,8 @@ def showmemo
}
format.json { render json: @open_source_project }
end
end
end
# GET /open_source_projects/new
# GET /open_source_projects/new.json
def new
@ -178,13 +220,13 @@ 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])
@ -207,7 +249,6 @@ end
redirect_to master_apply_open_source_project_path
end
private
def require_master

View File

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

View File

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

View File

@ -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

View File

@ -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

View File

@ -69,28 +69,30 @@ module UsersHelper
# <li><%= link_to("所有反馈", {:controller => 'users', :action => 'show', :type => 2}) %></li>
# </ul></div>
def show_activity(state)
content = ''.html_safe
case state
when 0
s = content_tag('span', l(:label_user_all_activity), :class => "current-page")
content << content_tag('li', s)
content << content_tag('li', link_to(l(:label_user_activity_myself), {:controller => 'users', :action => 'show', :type => 1}))
content << content_tag('li', link_to(l(:label_user_all_respond), {:controller => 'users', :action => 'show', :type => 2}))
when 1
s = content_tag('span', l(:label_user_activity_myself), :class => "current-page")
content << content_tag('li', link_to(l(:label_user_all_activity), {:controller => 'users', :action => 'show'}))
content << content_tag('li', s, :class => "current-page")
content << content_tag('li', link_to(l(:label_user_all_respond), {:controller => 'users', :action => 'show', :type => 2}))
when 2
s = content_tag('span', l(:label_user_all_respond), :class => "current-page")
content << content_tag('li', link_to(l(:label_user_all_activity), {:controller => 'users', :action => 'show'}))
content << content_tag('li', link_to(l(:label_user_activity_myself), {:controller => 'users', :action => 'show', :type => 1}))
content << content_tag('li', s, :class => "current-page")
end
content_tag('div', content, :class => "pagination")
end
# TODO: 待删
# def show_activity(state)
# content = ''.html_safe
# case state
# when 0
# s = content_tag('span', l(:label_user_all_activity), :class => "current-page")
# content << content_tag('li', s)
# content << content_tag('li', link_to(l(:label_user_activity_myself), {:controller => 'users', :action => 'show', :type => 1}))
# content << content_tag('li', link_to(l(:label_user_all_respond), {:controller => 'users', :action => 'show', :type => 2}))
# when 1
# s = content_tag('span', l(:label_user_activity_myself), :class => "current-page")
# content << content_tag('li', link_to(l(:label_user_all_activity), {:controller => 'users', :action => 'show'}))
# content << content_tag('li', s, :class => "current-page")
# content << content_tag('li', link_to(l(:label_user_all_respond), {:controller => 'users', :action => 'show', :type => 2}))
# when 2
# s = content_tag('span', l(:label_user_all_respond), :class => "current-page")
# content << content_tag('li', link_to(l(:label_user_all_activity), {:controller => 'users', :action => 'show'}))
# content << content_tag('li', link_to(l(:label_user_activity_myself), {:controller => 'users', :action => 'show', :type => 1}))
# content << content_tag('li', s, :class => "current-page")
# end
# content_tag('div', content, :class => "pagination")
# end
#TODO: 待删
def watch_projects(state)
content = ''.html_safe
case state

View File

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

View File

@ -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

View File

@ -71,6 +71,11 @@ class RelativeMemo < ActiveRecord::Base
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?
# Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id ])

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
$('#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) %>" );
$("#put-bid-form").hide();

View File

@ -1,4 +1,4 @@
$('#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) %>" );
$("#put-bid-form").hide();

View File

@ -15,6 +15,7 @@
margin-top: -10px;
/*margin-right: -4px;*/
}
input[type="button"].contest_btn {
width: 60px;
height: 30px;
@ -30,6 +31,7 @@
margin-top: -10px;
margin-right: -2px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
@ -62,24 +64,17 @@
<%= render_flash_messages %>
<!--参赛步骤-->
<div style="padding-left: 23px; padding-bottom: 10px; color: grey; font-size: 12px">
<div>温馨提示:如果您准备参加竞赛,请点击下面的"新建参赛作品"</div>
<div style="margin-left: 59px; padding-top: 2px">1) 若您已完成开发,且只希望发布您的作品,“托管项目”一项可以不选;</div>
<div style="margin-left: 59px; padding-top: 2px">2) 若您希望托管竞赛数据和代码以及保留开发和提交代码的轨迹,请从“托管项目”中选择一项您已创建好的项目作为该参赛作品的托管项目,若您还没有创建项目,请点击右边的“创建项目”,然后回到本页再选择。</div>
<div><%= l(:label_wellmeaning_intimation_contentone) %></div>
<div style="margin-left: 59px; padding-top: 2px">1) <%= l(:label_wellmeaning_intimation_contenttwo) %></div>
<div style="margin-left: 59px; padding-top: 2px">2) <%= l(:label_wellmeaning_intimation_contentthree) %></div>
</div>
<% if User.current.logged? %>
<div style="padding-bottom: 10px; line-height: 15px">
<div style="padding-left: 82px; font-size: 14px">
<span><strong>参加竞赛</strong></span>
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
<span><strong><%= l(:label_attending_contest) %></strong></span>
<span><%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
</div>
<!-- <div style="padding-left: 82px; ">
<span style="padding-top: 50px">步骤1</span>
<span><%#= link_to '新建参赛作品', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %></span>
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
<span style="font-size: 12px; color: grey">先点击“新建参赛作品”然后刷新页面再继续步骤2。</span>
</div> -->
</div>
<% else %>
<div style="font-size: 14px;margin:10px;padding-left: 73px">
@ -91,69 +86,81 @@
<!--点击新建参赛作品弹出框新建参赛作品并关联到竞赛中-->
<div id="put-project-form" style="display: none; padding-left: 83px; width: 88%">
<%= form_for Softapplication.new, :url => softapplications_path do |f| %>
<fieldset class="contes-new-box", style="padding-left: 36px; line-height: 8px; margin-left: 1px">
<fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" >
<%= hidden_field_tag 'contest_id', @contest.id %>
<tr style="width:700px; margin-left: -10px;">
<span><%= l(:label_work_name) %></span>
<span class="contest-star"> * </span>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(25个汉字以内)</span>
</tr><br/>
<br />
<br />
<span class="contest-star"> * </span>:
<td><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span>
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<span><%= l(:label_running_platform) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
<span class="contest-star"> * </span>:
<td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr><br/>
<br />
<br />
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<span><%= l(:label_work_type) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span class="contest-star"> * </span>:
<td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr><br/>
<br />
<br />
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<span><%= l(:label_work_description) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(125个汉字以内)</span>
</tr><br/>
<br />
<br />
<span class="contest-star"> * </span>:
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<span><%= l(:label_softapplication_developers) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
<span class="contest-star"> * </span>:
<td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr><br/>
<br />
<br />
</tr>
<br/>
<br/>
<br/>
<tr style="width:800px;">
<span><%= l(:label_work_deposit_project) %></span>
<span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2' %></span>
<span><%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target=>'_blank'%></span>
</tr><br/>
<br />
<br />
<span><%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target => '_blank' %></span>
</tr>
<br/>
<br/>
<br/>
<fieldset style="width: 500px; padding-top: 10px">
<legend>
上传作品软件包和作品截图
<%= l(:label_upload_softworkpacket_photo) %>
</legend>
<%#= render_flash_messages %>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
<p style="font-size: 11px">
1、<%= l(:label_upload_softapplication_packets_mustpacketed)%> <br />
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
<br>
2、<%= l(:label_upload_softapplication_photo_condition)%>
2、<%= l(:label_upload_softapplication_photo_condition) %>
</p>
</fieldset>
@ -176,38 +183,40 @@
<% if @contest.id == 2 or @contest.id == 3 or @contest.id == 6 %>
<% @contesting_project.sort.reverse.each do |c_project|%>
<% if c_project.project %>
<div style="padding-left: 18px">
<% @contesting_project.sort.reverse.each do |c_project| %>
<% if c_project.project %>
<div style="padding-left: 18px">
<div style="font-size: 15px">
<div>
<div><strong>参赛作品: <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </strong>
<div><strong><%= l(:label_contest_work) %>
: <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> </strong>
<div style="float: right">
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
<strong>
<span id="reward_result_<%=c_project.id%>"> <!-- 调用js进行刷新 -->
<span id="reward_result_<%= c_project.id %>"> <!-- 调用js进行刷新 -->
<% if get_prize(c_project).nil? or get_prize(c_project) == "" %>
<% if @contest.deadline < Date.today %>
<span style="color: red"><%= l(:label_noawards)%></span>
<% else%>
<span style="color: red"><%= l(:label_noawards_current)%></span>
<span style="color: red"><%= l(:label_noawards) %></span>
<% else %>
<span style="color: red"><%= l(:label_noawards_current) %></span>
<% end %>
<% else %>
<% case get_prize(c_project) %>
<% when '-1' %>
<%= image_tag("/images/bid/special_reward.png")%>
<%= image_tag("/images/bid/special_reward.png") %>
<% when '0' %>
<%= image_tag("/images/bid/first_reward.png")%>
<%= image_tag("/images/bid/first_reward.png") %>
<% when '1' %>
<%= image_tag("/images/bid/second_reward.png")%>
<%= image_tag("/images/bid/second_reward.png") %>
<% when '2' %>
<%= image_tag("/images/bid/third_reward.png")%>
<%= image_tag("/images/bid/third_reward.png") %>
<% when '3' %>
<%= image_tag("/images/bid/forth_reward.png")%>
<%= image_tag("/images/bid/forth_reward.png") %>
<% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png")%>
<%= image_tag("/images/bid/fifth_reward.png") %>
<% when '5' %>
<%= image_tag("/images/bid/qualified.png")%>
<%= image_tag("/images/bid/qualified.png") %>
<% end %>
<% end %>
</span>
@ -217,97 +226,107 @@
<!-- 评价显隐控制按钮-->
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
<td valign="top" align="right" width="10%">
<span> <%= toggle_link '评奖', c_project.id.to_s %></span>
<span> <%= toggle_link l(:label_reward), c_project.id.to_s %></span>
<!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id = '<%= c_project.id %>'>
<%= form_for "set_reward_project",:remote=>true,:url=>set_reward_project_contest_path do |f| %>
<%= f.text_field :c_id,:style => "display:none",:value => c_project.id,:size=>"0" %>
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option>
<span style="display: none; vertical-align: top " id='<%= c_project.id %>'>
<%= form_for "set_reward_project", :remote => true, :url => set_reward_project_contest_path do |f| %>
<%= f.text_field :c_id, :style => "display:none", :value => c_project.id, :size => "0" %>
<%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option>
<option value = '0'>#{l(:label_first_reward)}</option>
<option value = '1'>#{l(:label_second_reward)}</option>
<option value = '2'>三等奖</option>
<option value = '3'>四等奖</option>
<option value = '4'>五等奖</option>
<option value = '2'>#{l(:label_third_reward)}</option>
<option value = '3'>#{l(:label_fourth_reward)}</option>
<option value = '4'>#{l(:label_fifth_reward)}</option>
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
<%= f.submit "提交",:class=>"submit" %>
<%= f.submit :value => l(:button_submit), :class => "submit" %>
<% end %>
</span>
</td>
<% end %>
</div>
</div>
</div></br>
</div>
</br>
</div>
<div style="padding-left: 68px">
<tr>
<td>简介:</td>
<td><%= l(:label_profile) %>:</td>
<td> <%= c_project.project.description.truncate(90, omission: '...') %> </td>
</tr></br>
</tr>
</br>
</div>
<div style="padding-left: 68px; padding-bottom: 8px">
<span><strong>参赛时间:</strong><%= format_time c_project.created_at%></span>
<span style="padding-left: 240px"><strong>参赛代表:</strong><%= c_project.user.name %></span>
<span><strong><%= l(:label_attendingcontest_time) %>
</strong><%= format_time c_project.created_at %></span>
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
</strong><%= c_project.user.name %></span>
</div>
<div style="padding-left: 68px">
</div>
</div>
<% end %>
<div class="underline-contests_three"></div>
<% end %>
</div>
<% end %>
<div class="underline-contests_three"></div>
<% end %>
<% else %>
<% @contesting_softapplication.each do |c_softapplication|%>
<% if c_softapplication.softapplication %>
<div style="padding-left: 18px">
<% @contesting_softapplication.each do |c_softapplication| %>
<% if c_softapplication.softapplication %>
<div style="padding-left: 18px">
<div style="font-size: 15px">
<tr>
<td><strong>参赛作品: </strong></td>
<td><strong><%= l(:label_contest_work) %>: </strong></td>
<td> <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> </td>
</tr></br>
</tr>
</br>
</div>
<div style="padding-left: 68px; padding-top: 5px">
<tr>
<td><strong>简介:</strong></td>
<td><strong><%= l(:label_profile) %>:</strong></td>
<td> <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> </td>
</tr></br>
</tr>
</br>
</div>
<div style="padding-left: 68px; pading-bottom: 8px">
<span><strong>参赛时间:</strong><%= format_time c_softapplication.created_at %></span>
<span style="padding-left: 240px"><strong>参赛代表:</strong><%= c_softapplication.softapplication.user.name %></span>
<span><strong><%= l(:label_attendingcontest_time) %>
</strong><%= format_time c_softapplication.created_at %></span>
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
</strong><%= c_softapplication.softapplication.user.name %></span>
</div>
<!--获奖及教师评奖-->
<div style="padding-left: 18px; padding-bottom: 5px">
<span style="padding-left: 50px"><strong>最终得分:</strong></span><span style="color: red"><%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分</span>
<span style="padding-left: 50px"><strong><%= l(:label_final_scores) %>
</strong></span><span style="color: red"><%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>
分</span>
<span style="padding-left: 334px">
<td>
<strong>
<span id="reward_result_<%=c_softapplication.id%>" > <!-- 调用js进行刷新 -->
<span id="reward_result_<%= c_softapplication.id %>"> <!-- 调用js进行刷新 -->
<% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %>
<% if @contest.deadline < Date.today %>
<span style="color: red"><%= l(:label_noawards)%></span>
<% else%>
<span style="color: red"><%= l(:label_noawards_current)%></span>
<span style="color: red"><%= l(:label_noawards) %></span>
<% else %>
<span style="color: red"><%= l(:label_noawards_current) %></span>
<% end %>
<% else %>
<% case get_prize(c_softapplication) %>
<% when '-1' %>
<%= image_tag("/images/bid/special_reward.png")%>
<%= image_tag("/images/bid/special_reward.png") %>
<% when '0' %>
<%= image_tag("/images/bid/first_reward.png")%>
<%= image_tag("/images/bid/first_reward.png") %>
<% when '1' %>
<%= image_tag("/images/bid/second_reward.png")%>
<%= image_tag("/images/bid/second_reward.png") %>
<% when '2' %>
<%= image_tag("/images/bid/third_reward.png")%>
<%= image_tag("/images/bid/third_reward.png") %>
<% when '3' %>
<%= image_tag("/images/bid/forth_reward.png")%>
<%= image_tag("/images/bid/forth_reward.png") %>
<% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png")%>
<%= image_tag("/images/bid/fifth_reward.png") %>
<% when '5' %>
<%= image_tag("/images/bid/qualified.png")%>
<%= image_tag("/images/bid/qualified.png") %>
<% end %>
<% end %>
</span>
@ -316,30 +335,30 @@
<!-- 评价显隐控制按钮-->
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
<div style="valign="top" align="right" width="10%"">
<div style="valign=" top" align="right" width="10%"">
<span style="padding-right: 5px; padding-top: 1px"> <%= toggle_link '评奖', c_softapplication.id.to_s %></span>
<!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id = '<%= c_softapplication.id %>'>
<%= form_for "set_reward_softapplication",:remote=>true,:url=>set_reward_softapplication_contest_path do |f| %>
<%= f.text_field :c_id,:style => "display:none",:value => c_softapplication.id,:size=>"0" %>
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option>
<span style="display: none; vertical-align: top " id='<%= c_softapplication.id %>'>
<%= form_for "set_reward_softapplication", :remote => true, :url => set_reward_softapplication_contest_path do |f| %>
<%= f.text_field :c_id, :style => "display:none", :value => c_softapplication.id, :size => "0" %>
<%= f.select :reward, "<option value = '-1'>#{l(:label_special_reward)}</option>
<option value = '0'>#{l(:label_first_reward)}</option>
<option value = '1'>#{l(:label_second_reward)}</option>
<option value = '2'>三等奖</option>
<option value = '3'>四等奖</option>
<option value = '4'>五等奖</option>
<option value = '2'>#{l(:label_third_reward)}</option>
<option value = '3'>#{l(:label_fourth_reward)}</option>
<option value = '4'>#{l(:label_fifth_reward)}</option>
<option value = '5'>#{l(:label_comfort_reward)}</option>".html_safe %>
<%= f.submit "提交",:class=>"submit" %>
<%= f.submit :value => l(:button_submit), :class => "submit" %>
<% end %>
</span>
</div>
<% end %>
</span>
</div>
</div>
<% end %>
<div class="underline-contests_three"></div>
<% end %>
</div>
<% end %>
<div class="underline-contests_three"></div>
<% end %>
<% end %>
<div class="pagination">

View File

@ -68,7 +68,7 @@
<td>
<p>
<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>
</p>
</td>

View File

@ -68,7 +68,7 @@
<td>
<p>
<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>
</p>
</td>

View File

@ -2,7 +2,7 @@
<% versions = project.versions.sort %>
<% attachmenttypes = project.attachmenttypes %>
<%= error_messages_for 'attachment' %>
<%= form_tag(project_files_path(project), :multipart => true,:remote => true,:method => :post,:name=>"upload_form", :class => "tabular") do %>
<%= form_tag(project_files_path(project), :multipart => true,:remote => false,:method => :post,:name=>"upload_form", :class => "tabular") do %>
<div class="box">
<p>
<table>

View File

@ -114,7 +114,7 @@
;
});
function eval_ajax (xhr, textStatus) {
function eval_ajax(xhr, textStatus) {
if (textStatus == 'success') {
eval(xhr.responseText);
} else if (textStatus == 'error') {
@ -128,7 +128,7 @@
type: "POST",
data: {
type: encodeURIComponent(value),
contentType:$('#attach_sufix_browse').val()
contentType: $('#attach_sufix_browse').val()
}
}).complete(eval_ajax);
@ -190,18 +190,17 @@
<script type='text/javascript'>
function tagAddClick(divid,objId,objTag)
{
function tagAddClick(divid, objId, objTag) {
alert("OK");
$.ajax({
type :"POST",
url :'/users/tag_saveEx',
type: "POST",
url: '/users/tag_saveEx',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag:encodeURIComponent(objTag)
obj_flag: encodeURIComponent(objTag)
},
success: function(data, textStatus){
success: function (data, textStatus) {
alert("OK");
$(divid).empty();
$(divid).html('123');

View File

@ -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>

View File

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

View File

@ -5,12 +5,13 @@
</style>
<%= javascript_include_tag "ichart.1.2.min" %>
<%= stylesheet_link_tag "sec-analysis.css" %>
<%= stylesheet_link_tag "buglist-ichart.css" %>
<%= stylesheet_link_tag "buglist.css" %>
<div class="mask">
<div class="header2"></div>
<div class="colleft">
@ -20,33 +21,63 @@
</div>
<div class="col2" style="margin-left:0px">
<div style="margin-left:0px" > <span> <h1 style="fontsize:19px;color:orange;font-weight:900">项目安全态势 </h1></span><span style="margin-top: -30px; margin-right:70px;float: right; display: block;"><%= link_to "更多 >>", :controller => "open_source_projects",:action => "showmemo", :id => @open_source_project.id %></span></div>
<div style="margin-left:0px" > <span> <h1 style="fontsize:19px;color:orange;font-weight:900">项目安全态势 </h1></span><span style="margin-top: -30px; margin-right:70px;float: right; display: block;"><%= link_to "更多 >>", :controller => "open_source_projects",:action => "showbug", :id => @open_source_project.id %></span></div>
<% if @open_source_project.id ==42 then %>
<div>
<span>
<img src="/images/version_marker.png" alt="Tags">
</span>
<span class="tag_fouse">聚焦:</span>
<div id="tag">栈溢出</div>
<div id="tag">远程权限</div>
<div id="tag">框架安全</div>
</div>
<% elsif @open_source_project.id ==70 then %>
<div>
<span>
<img src="/images/version_marker.png" alt="Tags">
</span>
<span class="tag_fouse">聚焦:</span>
<div id="tag">Kernel安全</div>
<div id="tag">函数漏洞</div>
<div id="tag">ping_init_sock()</div>
</div>
<% elsif @open_source_project.id ==17 then %>
<div>
<span>
<img src="/images/version_marker.png" alt="Tags">
</span>
<span class="tag_fouse">聚焦:</span>
<div id="tag">Heartbleed</div>
<div id="tag">致命漏洞</div>
</div>
<% elsif @open_source_project.id ==55 then %>
<div>
<span>
<img src="/images/version_marker.png" alt="Tags">
</span>
<span class="tag_fouse">聚焦:</span>
<div id="tag">DDos攻击</div>
<div id="tag">信息泄露</div>
</div>
<%end%>
<div class="fixed"></div>
<div class="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>
<li><span class="li_time">>[<%= show_description(bug, open_source_project) %>]</span><%= link_to bug.subject, bug.url, :target => '_blank' %></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">>[远程溢出漏洞]</span><a href="/vuldb/ssvid-62259" title="Adobe Flash Player 整数堆栈下溢远程命令执行">Adobe Flash Player 远程命令执行</a></li> -->
<!-- <li><span class="li_time">14-05-07</span><a href="/vuldb/ssvid-62258" title="PHPDISK phpdisk_del_process.php SQL注入漏洞">PHPDISK phpdisk_del_process.php SQL注入漏洞</a></li> -->
<!-- <li><span class="li_time">[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62257" title="BEESCMS 3.4 order_save.php SQL注入漏洞">BEESCMS 3.4 order_save.php SQL注入漏洞</a></li> -->
<!-- <li ><span class="li_time">>[SQL注入漏洞]</span><a href="/vuldb/ssvid-62256" title="Apache/NGINX 下 PHP-FPM 或者 PHP-CGI 拒绝服务漏洞">Apache/NGINX 下 PHP-FPM </a></li> -->
<!-- <li><span class="li_time">>[SQL注入漏洞]</span><a href="/vuldb/ssvid-62250" title="AlienVault OSSIM SQL注入以及远程代码执行">AlienVault OSSIM SQL注入</a></li> -->
<!-- <li><span class="li_time">>[DDoS漏洞]</span><a href="/vuldb/ssvid-62248" title="Eucalyptus Web Services拒绝服务漏洞">Eucalyptus Web Services</a></li> -->
<!-- <li ><span class="li_time">>[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62245" title="Watchguard Fireware XTM OpenSSL TLS心跳信息泄漏漏洞"> Fireware XTM OpenSSL TLS</a></li> -->
<!-- <li ><span class="li_time">>[OpenSSL漏洞]</span><a href="/vuldb/ssvid-62244" title="SAP Sybase SQL Anywhere OpenSSL TLS泄漏漏洞">Sybase SQL Anywhere OpenSSL TLS</a></li> -->
</ul>
</div>
</div>
@ -61,8 +92,6 @@
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
}
var data = [
{
name :'',
@ -127,7 +156,7 @@
parseText:function(tip,name,value,text,i){
return name+"漏洞数:"+value;
}
} ,
}
},
tipMocker:function(tips,i){
@ -144,17 +173,6 @@
((i%12)==0?"1 月":((i%12+1))+"月")+ //时间
"</div>"+tips.join("<br/>");
},
// legend : {
// enable : true,
// row:1,//设置在一行上显示与column配合使用
// column : 'max',
// valign:'top',
// sign:'bar',
// background_color:null,//设置透明背景
// offsetx:-80,//设置x轴偏移满足位置需要
// border : true
// },
crosshair:{
enable:true, //十字交叉线
line_color:'#62bce9'
@ -194,8 +212,7 @@
start_scale:0,
scale_space:50,
end_scale:70,
scale_color:'#9f9f9f',
// label : {color:'#ffffff',fontsize:11},
scale_color:'#9f9f9f'
},{
position:'bottom',
@ -203,35 +220,10 @@
}]
}
});
//开始画图
/**
*自定义组件,画平均线。
*/
// line.plugin(new iChart.Custom({
// drawFn:function(){
// /**
// *计算平均值的高度(坐标Y值)
// *计算高度还不会! 会划线了!
// */
// // var avg = line.total/5,
// // coo = line.getCoordinate(),
// // x = coo.get('originx'),
// // W = coo.width,
// // S = coo.getScale('left'),
// // H = coo.height,
// // h = (avg - S.start) * H / S.distance,
// // y = line.y + H - h;
// line.target.line(28,97,400,97,2,'#b32c0d')
// .textAlign('start')
// .textBaseline('middle')
// .textFont('600 12px Verdana');
// }
// }));
line.draw();
});
//]]>
</script>
<!--我是分割线1===================================================================================================-->
@ -282,9 +274,6 @@
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
}
var data = [
{
name : '',
@ -297,16 +286,9 @@
//创建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',
data: data,
@ -352,7 +334,7 @@
parseText:function(tip,name,value,text,i){
return name+"帖子数:"+value+"万";
}
} ,
}
},
tipMocker:function(tips,i){
@ -378,10 +360,9 @@
label:false, //是否显示数值
// hollow_inside:false,
smooth : true,//平滑曲线
point_size:2, // 焦点大小
point_size:2 // 焦点大小
// point_hollow : true,
},
coordinate:{
width:225, // 图表大小
@ -404,7 +385,7 @@
start_scale:0,
scale_space:50,
end_scale:70,
scale_color:'#9f9f9f',
scale_color:'#9f9f9f'
// label : {color:'#ffffff',fontsize:11},
},{
@ -435,11 +416,11 @@
<td>
<table width="630px" border="0">
<tr>
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), topic.url %></td>
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), topic.url, :target => '_blank' %></td>
<td align="right" rowspan="3">
<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>
@ -449,7 +430,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>
@ -459,7 +440,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>
@ -467,17 +448,17 @@
</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"><%#= authoring topic.created_at, topic.author %>
<tr>
<td align="left"><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 %>
<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>
<td colspan="3" align="center"><%= no_use_link(topic, User.current) %> </td>
</tr>
</table></td>
</tr>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -65,7 +65,7 @@
<fieldset style="width: 500px">
<legend>上传作品软件包和作品截图</legend>
<legend><%=l(:label_upload_softworkpacket_photo)%></legend>
<%= render_flash_messages %>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>

View File

@ -16,13 +16,13 @@
<div style="float: left; width: 600px; padding-top: 6px; margin-left: 8px"><%= softapplication.description.truncate(95, omission: '...') %></div>
<div style="float: left; width: 200px; margin-left: 70px; margin-top: -3px; line-height: 0.5em ">
<%contest = softapplication.contests.first%>
<p>所属竞赛<%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%></p>
<p>所属类别<%= softapplication.app_type_name.truncate(10, omission: '...') %></p>
<p>系统支持<%= softapplication.android_min_version_available %></p>
<p><%=l(:label_attendingcontestwork_belongs_contest)%><%= contest ? link_to(contest.name.truncate(14, omission: '...'), show_attendingcontest_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%></p>
<p><%=l(:label_attendingcontestwork_belongs_type)%><%= softapplication.app_type_name.truncate(10, omission: '...') %></p>
<p><%=l(:label_attendingcontestwork_adaptive_system)%><%= softapplication.android_min_version_available %></p>
</div>
<div style="padding-left: 53px">
<span>开发人员<%= softapplication.application_developers %></span>
<span style="padding-left: 50px">发布时间<%=format_time softapplication.created_at %></span>
<span><%=l(:label_attendingcontestwork_developers)%><%= softapplication.application_developers %></span>
<span style="padding-left: 50px"><%=l(:label_attendingcontestwork_release_time)%><%=format_time softapplication.created_at %></span>
</div>
<div style="border-left: 1px solid #d9d8d8; border-bottom: 1px solid #d9d8d8; margin-left: 50px; padding-bottom: 10px; margin-bottom: 20px; width: 66%"></div>
<div class="underline-contests_one" style="margin-top: -7px"></div>

View File

@ -16,38 +16,35 @@
</td>
</tr>
<tr>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all">所属类别<%= @softapplication.app_type_name %></td>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_type)%><%= @softapplication.app_type_name %></td>
<% contest = @softapplication.contests.first %>
<td style="width: 240px; word-wrap: break-word; word-break: break-all">所属竞赛<%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td>
<td style="width: 240px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_contest)%><%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td>
</tr>
<tr>
<td style="padding-left: 40px">发布人员<%= @softapplication.user.name %></td>
<td>系统支持<%= @softapplication.android_min_version_available %></td>
<td style="padding-left: 40px"><%=l(:label_attendingcontestwork_release_person)%><%= @softapplication.user.name %></td>
<td><%=l(:label_attendingcontestwork_adaptive_system)%><%= @softapplication.android_min_version_available %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<span>作品下载</span>
<span><%=l(:label_attendingcontestwork_download)%></span>
<span>
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
</span>
</td>
<td>开发人员<%= @softapplication.application_developers %></td>
<td><%=l(:label_attendingcontestwork_developers)%><%= @softapplication.application_developers %></td>
</tr>
<tr>
<td style="padding-left: 40px">平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td>发布时间<%=format_time @softapplication.created_at %></td>
<td style="padding-left: 40px"><%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td><%=l(:label_attendingcontestwork_release_time)%><%=format_time @softapplication.created_at %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<% if (@softapplication.deposit_project != "nil" && @softapplication.deposit_project != "") %>
<%#= textilizable ("托管项目: " + @project.name) %>
托管项目:<%= link_to "#@project", project_path(@project.id) %>
<% if @project %>
<%=l(:label_attendingcontestwork_deposit_project)%><%= link_to "#@project", project_path(@project) %>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
@ -56,7 +53,7 @@
<div style="height: auto; padding-bottom: 10px">
<strong>
<div style="font-size: 15px;">作品简介</div>
<div style="font-size: 15px;"><%=l(:label_work_description)%></div>
</strong>
<div style="padding-top: 5px"><%= @softapplication.description %></div>
@ -64,11 +61,11 @@
<div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px">
<div style="font-size: 15px;"><strong>作品得分</strong></div>
<div style="font-size: 15px;"><strong><%=l(:label_work_scores)%></strong></div>
<!-- <div>打分总人数:<%= @softapplication.raters(:quality).count %></div> -->
<div style="overflow: hidden">
<div style="margin-left: 15%; float: left">
<div style="padding-left: 45px; padding-bottom: 5px">得分比例</div>
<div style="padding-left: 45px; padding-bottom: 5px"><%=l(:label_work_scores_proportion)%></div>
<div>
<% 100.step(20, -20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
@ -83,14 +80,12 @@
</div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px " align="center">
<div>最终得分</div>
<div style="padding-top: 1px; font-size: 15px; color: blue"><%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>
</div>
<div><%=l(:label_final_scores)%></div>
<div style="padding-top: 1px; font-size: 15px; color: blue"><%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分</div>
<div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px;" align="center">
<div>打分总人数</div>
<div><%=l(:label_rating_person_amount)%></div>
<div style="padding-top: 1px; font-size: 25px; color: blue;">
<strong><%= @softapplication.raters(:quality).count %></strong></div>
</div>
@ -100,7 +95,7 @@
<div style="height: auto; padding-bottom: 10px">
<strong>
<div style="font-size: 15px">作品截图</div>
<div style="font-size: 15px"><%=l(:label_work_photo)%></div>
</strong>
<div class="softapplication-img" >
@ -119,10 +114,10 @@
<div class="underline-contests_one"></div>
<div style="height: 50px">
<div style="font-size: 15px"><strong>作品评论</strong></div>
<div style="font-size: 15px"><strong><%=l(:label_work_comment)%></strong></div>
<% if (User.current.logged? and User.current.id != @softapplication.user_id) %>
<div style="padding-left: 210px">评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>
<span style="font-size: 11px">(您可以重新打分,打分结果以最后一次打分为主!)</span></div>
<div style="padding-left: 210px"><%=l(:label_work_rating)%>: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>
<span style="font-size: 11px">(<%=l(:label_attendingcontestwork_sorting_intimation)%>)</span></div>
<% end %>
</div>

View File

@ -1,4 +1,4 @@
<div class="user_course_list">
<div class="user_course_list menu-div">
<div class="menu">
<%= link_to "#{l(:label_course_new)}", new_project_path(course: 1, project_type: 1), class: 'icon icon-add' if @user == User.current %>
<ul>

View File

@ -11,7 +11,7 @@
</p>
<% end %>
<% else %>
<div class="user_course_list">
<div class="user_course_list menu-div">
<div class="menu">
<%= link_to"#{l(:label_course_view_student)}",course_path(course: 1), :class => 'icon icon-add' %>
<ul>

View File

@ -1,5 +1,24 @@
<% if User.current.id == @user.id%>
<%= show_activity @state%>
<div class="menu-div">
<div class="menu">
<span style="color: #000; font-weight: ;"><%= "#{@user.name}的动态" %></span>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='all' class="<%= "on" if @state.eql?(0)%>"><%=l :label_user_all_activity%></li>
<li mode='myself' class="<%= "on" if @state.eql?(1)%>"><%=l :label_user_activity_myself%></li>
<li mode='respond' class="<%= "on" if @state.eql?(2)%>"><%=l :label_user_all_respond%></li>
</ul>
</div>
<script type="text/javascript">
</script>
</div>
<%#= show_activity @state%>
<div style="height:20px"></div>
<%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px">
<table width="100%" valign="center">
@ -281,6 +300,9 @@
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#content .pagination:first~ div").first().find("a").attr("target", "_blank");
$("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
$('[mode=all]').click(function(event) {window.location.href='<%=user_activities_url%>'; });
$('[mode=myself]').click(function(event) {window.location.href='<%=user_activities_url(type: 1)%>'; });
$('[mode=respond]').click(function(event) {window.location.href='<%=user_activities_url(type: 2)%>'; });
});
</script>

View File

@ -1,7 +1,18 @@
<!--add by huang-->
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<!--span class="font_lighter" >温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~</span-->
<%= watch_projects @state %>
<div class="menu-div">
<div class="menu">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='take' class="<%= "on" if @state.eql?(0)%>"><%=l :label_project_take%></li>
<li mode='watched' class="<%= "on" if @state.eql?(1)%>"><%=l :label_has_watched_project%></li>
</ul>
</div>
</div>
<div style="height:20px"></div>
<%#= watch_projects @state %>
<% unless @memberships.empty? %>
<div class="content_frame">
<ul class="user_project_sort">
@ -48,5 +59,7 @@
$(document).ready(function($) {
$("#content .tabs_new~").find("a").attr("target", "_blank");
$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
$('[mode=take]').click(function(event) {window.location.href='<%=user_projects_user_url%>'; });
$('[mode=watched]').click(function(event) {window.location.href='<%=watch_projects_user_url(type: 1)%>'; });
});
</script>

View File

@ -1,6 +1,17 @@
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<!--span class="font_lighter" >温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~</span-->
<%= watch_projects @state%>
<div class="menu-div">
<div class="menu">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='take' class="<%= "on" if @state.eql?(0)%>"><%=l :label_project_take%></li>
<li mode='watched' class="<%= "on" if @state.eql?(1)%>"><%=l :label_has_watched_project%></li>
</ul>
</div>
</div>
<%#= watch_projects @state%>
<% if @watch_projects.count > 0 %>
<% for watch_project in @watch_projects %>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
@ -30,3 +41,10 @@
<% else %>
<%= l(:label_watch_no_projects)%>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$('[mode=take]').click(function(event) {window.location.href='<%=user_projects_user_url%>'; });
$('[mode=watched]').click(function(event) {window.location.href='<%=watch_projects_user_url(type: 1)%>'; });
});
</script>

View File

@ -187,7 +187,7 @@
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_new_forum_topics(11).each do |topic|%>
<li class="message-brief-intro" style="min-height: 60px; line-height:2em; ">
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px ">
<div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>

View File

@ -1728,6 +1728,8 @@ zh:
label_first_reward: 一等奖
label_second_reward: 二等奖
label_third_reward: 三等奖
label_fourth_reward: 四等奖
label_fifth_reward: 五等奖
label_excellence_reward: 优秀奖
label_comfort_reward: 入围奖
label_course_settings: 课程设置
@ -1884,8 +1886,14 @@ zh:
label_work_name: 作品名称
label_softapplication_description: 应用简介
label_work_description: 作品简介
label_work_scores: 作品得分
label_work_rating: 评分
label_work_tishi: 您可以重新打分,打分结果以最后一次打分为主!
label_work_scores_proportion: 得分比例
label_softapplication_type: 应用分类
label_work_type: 作品分类
label_work_photo: 作品截图
label_work_comment: 作品评论
label_softapplication_version_available: 适配版本
label_running_platform: 运行平台
label_softapplication_developer: 上传人员
@ -1900,6 +1908,8 @@ zh:
label_button_ok: 确定
label_tags_contest: 竞赛标签
label_tags_contest: 竞赛名称
label_final_scores: 最终得分
label_rating_person_amount: 打分总人数
label_tags_contest_description: 竞赛描述
label_release_add_contest_succeed: 该应用发布并添加成功.
label_add_contest_succeed_fail: 添加失败,该应用已参赛.
@ -1910,6 +1920,7 @@ zh:
label_softapplication_list: 应用列表
label_contest_work_list: 参赛作品列表
label_attending_contest: 我要参赛
label_contest_notification: 竞赛通知
label_coursefile_sharingarea: 课程资源共享区
label_sort_by_activity: 按动态数排序
@ -1925,9 +1936,39 @@ zh:
label_contest_delete: 删除竞赛
label_noawards_current: 暂未评奖
label_softapplication: 应用软件
label_attending_contest: 参加竞赛
label_new_attendingcontest_work: 新建参赛作品
label_workname_lengthlimit: 25个汉字以内
label_workdescription_lengthlimit: 125个汉字以内
label_please_input_password: 请输入竞赛密码
label_please_select_project: 请选择项目
label_upload_softworkpacket_photo: 上传作品软件包和作品截图
label_reward: 评奖
label_please_select_contestingsoftapplication: 请选择参赛应用
label_attendingcontest_time: 参赛时间
label_attendingcontest_spoksman: 参赛代表
label_wellmeaning_intimation_contentone: 温馨提示:如果您准备参加竞赛,请点击下面的"新建参赛作品"
label_wellmeaning_intimation_contenttwo: 若您已完成开发,且只希望发布您的作品,“托管项目”一项可以不选;
label_wellmeaning_intimation_contentthree: 若您希望托管竞赛数据和代码以及保留开发和提交代码的轨迹,请从“托管项目”中选择一项您已创建好的项目作为该参赛作品的托管项目,若您还没有创建项目,请点击右边的“创建项目”,然后回到本页再选择。
notice_account_updated: 帐号更新成功
notice_attendingcontest_work_successfully_created: 恭喜您,参赛作品创建成功!
notice_softapplication_was_successfully_updated: 恭喜您,参赛作品更新成功!
label_attendingcontestwork_belongs_contest: 所属竞赛
label_attendingcontestwork_belongs_type: 所属类别
label_attendingcontestwork_release_person: 发布人员
label_attendingcontestwork_adaptive_system: 系统支持
label_attendingcontestwork_download: 作品下载
label_attendingcontestwork_developers: 开发人员
label_attendingcontestwork_average_scores: 平均评分
label_attendingcontestwork_release_time: 发布时间
label_attendingcontestwork_deposit_project: 托管项目
label_attendingcontestwork_sorting_intimation: 您可以重新打分,打分结果以最后一次打分为主!
#end
# ajax异步验证
modal_valid_passing: 可以使用
label_bug: 漏洞

View File

@ -18,7 +18,6 @@
RedmineApp::Application.routes.draw do
resources :homework_users
resources :no_uses
delete 'no_uses', :to => 'no_uses#delete'
@ -36,17 +35,19 @@ RedmineApp::Application.routes.draw do
collection do
match 'search', via: [:get, :post]
match 'remove_condition', via: [:get, :post]
match 'allbug', via: [:get, :post]
end
resources :relative_memos
member do
match 'master_apply', via: [:get, :post]
match 'accept_master_apply', via: [:get, :post]
match 'refuse_master_apply', via: [:get, :post]
match 'showmemo', via: [:get, :post]
match 'showbug', via: [:get, :post]
end
end
mount SeemsRateable::Engine => '/rateable', :as => :rateable
namespace :zipdown do
match 'assort'
end
@ -82,6 +83,7 @@ RedmineApp::Application.routes.draw do
match 'show_project' , via: :get
match 'show_softapplication' , via: :get
match 'show_attendingcontest' , via: :get
match 'show_notification' , via: :get
match 'show_participator' , via: :get
match 'set_reward_project' , via: [:get, :post]
match 'set_reward_softapplication' , via: [:get, :post]
@ -624,10 +626,13 @@ RedmineApp::Application.routes.draw do
match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
match 'contest', :controller => 'bids', :action => 'contests', :as => 'contest' #modified @20140403
########################
##added by wen##########
#######confusing########
get 'welcome/search', to: 'welcome#search'
get 'school/index', to: 'school#index'
get 'course/:school_id', to: 'welcome#course'
get 'course/:school_id', to: 'welcome#course'
post 'school/get_options/:province', :to => 'school#get_options'
get 'school/get_options/:province', :to => 'school#get_options'
@ -666,5 +671,4 @@ RedmineApp::Application.routes.draw do
end
end
end
get ':controller(/:action(/:id))'
end

View File

@ -0,0 +1,7 @@
class CreateProjectingSoftapplications < ActiveRecord::Migration
def up
end
def down
end
end

View File

@ -0,0 +1,5 @@
class AddProjectToSoftapplication < ActiveRecord::Migration
def change
add_column :softapplications, :project_id, :integer
end
end

File diff suppressed because it is too large Load Diff

View File

@ -292,6 +292,7 @@ Redmine::MenuManager.map :contest_menu do |menu|
#menu.push :project, :show_project_contest_path, :caption => :label_contest_project
#menu.push :application, :show_softapplication_contest_path, :caption => :label_contest_application
menu.push :attendingcontest, {:controller => 'contests', :action => 'show_attendingcontest'}, :caption => :label_attending_contest
# menu.push :contestnotification, {:controller => 'contests', :action => 'show_notification'}, :caption => :label_contest_notification
# menu.push :attendingcontest, :show_attendingcontest_contest_path, :caption => :label_attendin,g_contest
# menu.push :result, { :controller => 'bids', :action => 'show_results' },
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }

View File

@ -4,6 +4,7 @@
margin: 0px 0 0 0;
width: 970px;
}
.header2{
float: left;
@ -15,6 +16,7 @@
width: 100%;
right: 50%;
background-color: #000000
}
.col1{
position: relative;
@ -28,14 +30,36 @@
position: relative;
overflow: hidden;
float: left;
width: 470px;
width: 440px;
left: 3%;
}
a:hover, a:active {
color: #c61a1a;
text-decoration: underline;
}
#tag {
background: url("../images/issue_tag.png") no-repeat scroll right -19px rgba(0, 0, 0, 0);
border-radius: 3px;
color: #3A587D !important;
cursor: pointer;
display: inline-block;
font-size: 13px;
margin: 3px;
padding: 1px 4px 2px;
text-decoration: none;
}
#buglist
{
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}

View File

@ -3,6 +3,7 @@
.li_list {
clear:both;
padding:0 0 0 0px;
}
@ -13,6 +14,7 @@ padding:0 7px 0 0;
ol.linenums {
margin:0 0 0 20px;
}
ol.linenums li {
@ -31,6 +33,7 @@ padding:0;
background-color:#105DB5;
color:#FFF;
text-decoration:none;
}
.li_list li,.na_list li {
@ -38,6 +41,12 @@ clear:both;
height:18px;
list-style-type:square;
padding:2px;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
@ -53,3 +62,11 @@ font-size:18px;
div.pages .break,.created a {
color:#999;
}
.tag_fouse {
font-family: "Microsoft YaHei";
font-size: 15px;
font-weight: bold;
padding-bottom: 3px;
padding-top: 3px;
}

View File

@ -1205,14 +1205,14 @@ div.pagination {
/* user_courses
*******************************************************************************/
.user_course_list {
.menu-div {
margin: 0;
padding: 0;
position: relative;
margin-top: -15px;
}
.user_course_list .menu{
.menu-div .menu{
display: block;
background-color: #f9f9f9;
border-radius: 2px 2px 0 0;
@ -1225,7 +1225,7 @@ div.pagination {
padding-left: 15px;
}
.user_course_list .menu:after {
.menu-div .menu:after {
content: ".";
visibility: hidden;
display: block;
@ -1233,16 +1233,16 @@ div.pagination {
clear: both;
}
.user_course_list .menu ul {
.menu-div .menu ul {
margin: 0;
padding: 0;
float: right;
margin-right: 30px;
}
.user_course_list .menu ul {
.menu-div .menu ul {
}
.user_course_list .menu li {
.menu-div .menu li {
display: inline-block;
position: relative;
height: 40px;
@ -1250,17 +1250,17 @@ div.pagination {
cursor: pointer;
}
.user_course_list .menu li:hover {
.menu-div .menu li:hover {
color: #00a1d6;
}
.user_course_list .menu li.on {
.menu-div .menu li.on {
color: #00a1d6;
font-weight: bold;
}
.user_course_list .list_top {
.menu-div .list_top {
margin: 20px auto 0px;
}