president
nwb 11 years ago
commit f51873d98b

@ -57,7 +57,7 @@ class OpenSourceProjectsController < ApplicationController
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
@topic_count = @open_source_project.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@topic_pages = Paginator.new @topic_count, 10, params['page']
@memos = @open_source_project.topics.
reorder("#{RelativeMemo.table_name}.sticky DESC").
includes(:last_reply).
@ -73,11 +73,40 @@ class OpenSourceProjectsController < ApplicationController
format.json { render json: @open_source_project }
end
end
def search
def search
end
# added by yiang 暴力添加,请绕道
def showmemo
@open_source_project = OpenSourceProject.find(params[:id])
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
'replies' => "#{RelativeMemo.table_name}.replies_count",
'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
@topic_count = @open_source_project.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @open_source_project.topics.
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
# GET /open_source_projects/new
# GET /open_source_projects/new.json
def new

@ -37,7 +37,7 @@ class RelativeMemosController < ApplicationController
def show
pre_count = REPLIES_PER_PAGE
@memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示
# @memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示
@memo.update_column(:viewed_count_local, (@memo.viewed_count_local.to_i + 1))
page = params[:page]
@ -92,13 +92,14 @@ class RelativeMemosController < ApplicationController
def create
@memo = RelativeMemo.new(params[:relative_memo])
# @memo.url = "http://forge.trustie.net/open_source_projects"
@memo.osp_id = params[:open_source_project_id]
# @memo.osp_id = params[:open_source_project_id]
@memo.author_id = User.current.id
@memo.save_attachments(params[:attachments] || (params[:relative_memo] && params[:relative_memo][:uploads]))
respond_to do |format|
if @memo.save
RelativeMemoToOpenSourceProject.create(:osp_id => params[:open_source_project_id], :relative_memo_id => @memo.id)
format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
format.json { render json: @memo, status: :created, location: @memo }
else
@ -142,7 +143,7 @@ class RelativeMemosController < ApplicationController
def find_memo
return unless find_osp
@memo = @open_source_project.relative_memos.find(params[:id])
@memo = @open_source_project.topics.find(RelativeMemo.find(params[:id]).root.id)
rescue ActiveRecord::RecordNotFound
render_404
nil

@ -472,6 +472,14 @@ module ApplicationHelper
def added_time(created)
l(:label_added_time, :age => time_tag(created)).html_safe
end
def user_url_and_time(user_name, user_url, created)
unless user_name.nil?
l(:label_added_time_by, :author => link_to(user_name, user_url), :age => time_tag(created)).html_safe
else
l(:label_added_time, :age => time_tag(created)).html_safe
end
end
#huang
def betweentime(enddate)
@ -1320,6 +1328,15 @@ module ApplicationHelper
tags
end
def hubspot_head
tags = javascript_include_tag('hubspot/messenger.min', 'hubspot/messenger-theme-future')
tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future')
unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
end
tags
end
def favicon
"<link rel='shortcut icon' href='#{image_path('/favicon.ico')}' />".html_safe
end

@ -3,8 +3,10 @@ class OpenSourceProject < ActiveRecord::Base
include Redmine::SafeAttributes
has_many :applies, :class_name => "ApplyProjectMaster", :as => :apply, :dependent => :delete_all
has_many :topics, :class_name => 'RelativeMemo', :foreign_key => 'osp_id', :conditions => "#{RelativeMemo.table_name}.parent_id IS NULL", :order => "#{RelativeMemo.table_name}.created_at DESC", :dependent => :destroy
has_many :relative_memos, :class_name => 'RelativeMemo', :foreign_key => 'osp_id', :dependent => :destroy
has_many :relation_topics, :class_name => 'RelativeMemoToOpenSourceProject', :foreign_key => 'osp_id', :order => "#{RelativeMemo.table_name}.created_at DESC", :dependent => :destroy
# has_many :topics, :class_name => 'RelativeMemo', :foreign_key => 'osp_id', :conditions => "#{RelativeMemo.table_name}.parent_id IS NULL", :order => "#{RelativeMemo.table_name}.created_at DESC", :dependent => :destroy
has_many :topics, :through => :relation_topics, :class_name => 'RelativeMemo'
# has_many :relative_memos, :class_name => 'RelativeMemo', :foreign_key => 'osp_id', :dependent => :destroy
has_many :tags, :through => :project_tags, :class_name => 'Tag'
has_many :project_tags, :class_name => 'ProjectTags'
has_many :masters, :class_name => 'ApplyProjectMaster', :as => :apply, :dependent => :delete_all, :conditions => "#{ApplyProjectMaster.table_name}.status = 2"
@ -126,9 +128,14 @@ class OpenSourceProject < ActiveRecord::Base
def self.reset_counters!(id)
osp_id = id.to_i
update_all("topic_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NULL)," +
" memo_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NOT NULL)," +
" last_memo_id = (SELECT MAX(id) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id})",
# update_all("topic_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NULL)," +
# " memo_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NOT NULL)," +
# " last_memo_id = (SELECT MAX(id) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id})",
# ["id = ?", osp_id])
update_all("topic_count = (SELECT COUNT(*) FROM #{RelativeMemoToOpenSourceProject.table_name} WHERE osp_id=#{osp_id})",
# +
# " memo_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NOT NULL)," +
# " last_memo_id = (SELECT MAX(id) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id})",
["id = ?", osp_id])
end
end

@ -7,12 +7,13 @@ class RelativeMemo < ActiveRecord::Base
has_many :tags, :through => :project_tags, :class_name => 'Tag'
has_many :project_tags, :class_name => 'ProjectTags'
has_many :relation_topics, :class_name => 'RelativeMemoToOpenSourceProject'
has_many :no_uses, :as => :no_use, :dependent => :delete_all
acts_as_taggable
acts_as_attachable
validates_presence_of :osp_id, :subject
validates_presence_of :subject
#validates :content, presence: true
# validates_length_of :subject, maximum: 50
#validates_length_of :content, maximum: 3072
@ -80,6 +81,11 @@ class RelativeMemo < ActiveRecord::Base
{ :include => :no_uses,
:conditions => ["#{NoUse.table_name}.user_id = ?", user_id] }
}
# 获取帖子的回复
def replies
memos = RelativeMemo.where("parent_id = ?", id)
end
def no_use_for?(user)
self.no_uses.each do |no_use|

@ -0,0 +1,14 @@
class RelativeMemoToOpenSourceProject < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :open_source_project, :foreign_key => "osp_id"
belongs_to :topic, :class_name => 'RelativeMemo', :foreign_key => 'relative_memo_id'
has_many :no_uses, :as => :no_use, :dependent => :delete_all
validates_presence_of :osp_id, :relative_memo_id
scope :no_use_for, lambda { |user_id|
{:include => :no_uses,
:conditions => ["#{NoUse.table_name}.user_id = ?", user_id] }
}
end

@ -1,110 +1,73 @@
<!-- fq -->
<% if @bid.homework_type == Bid::HomeworkFile %>
<%= render :partial => 'homework' %>
<%= render :partial => 'homework' %>
<% else %>
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 60px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
/*margin-right: -4px;*/
}
input[type="button"].bid_btn {
width: 60px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -2px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
</style>
<script type="text/javascript" language="javascript">
function clearInfo(id,content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
<script type="text/javascript" language="javascript">
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
function showInfo(id,content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
function cancel() {
$("#put-bid-form").hide();
}
</script>
<% if User.current.logged? %>
<!--我要竞标弹出框-->
<div id='flash' style="float:left; width: 100%; display: none"></div>
<div id="put-bid-form" style="display: none">
<%= form_for "bid_for_save", :remote => true, :url => {:controller => 'bids', :action => 'add'},
:update => "bidding_project_list",
:complete => '$("#put-bid-form").hide();' do |f| %>
<table id="bidding_table" border="0" width="100%" style="margin-left: 40px;">
<tr>
<td><%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %></td>
<div id="prompt_create_pro"><!-- nyan -->
<td>
<p>
function cancel() {
$("#put-bid-form").hide();
}
</script>
<% if User.current.logged? %>
<!--我要竞标弹出框-->
<div id = 'flash' style="float:left; width: 100%; display: none" ></div>
<div id="put-bid-form" style="display: none">
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
:update => "bidding_project_list",
:complete => '$("#put-bid-form").hide();' do |f| %>
<table id="bidding_table" border="0" width="100%" style="margin-left: 40px;">
<tr>
<td><%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %></td>
<div id="prompt_create_pro"><!-- nyan -->
<td>
<p>
<div class="font_lighter" style="font-size: 13px;">
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target=>'_blank'%>
</div>
</p>
</td>
</div>
</tr>
<% if @bid.reward_type == 3 %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason_homework), :style => "resize: none;", :class => 'noline'%></td>
</tr>
<% else %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline'%></td>
</tr>
<% end %>
<tr>
<td align="right">
<%= submit_tag l(:button_add), :name => nil , :class => "enterprise",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
</td>
</tr>
</table>
<% end %>
</div>
<% end %>
<div id='bidding_project_list'>
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project,:bid => @bid} %>
</div>
<div class="font_lighter" style="font-size: 13px;">
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
</div>
</p>
</td>
</div>
</tr>
<% if @bid.reward_type == 3 %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason_homework), :style => "resize: none;", :class => 'noline' %></td>
</tr>
<% else %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason), :style => "resize: none;", :class => 'noline' %></td>
</tr>
<% end %>
<tr>
<td align="right">
<%= submit_tag l(:button_add), :name => nil, :class => "enterprise",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
:type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
</td>
</tr>
</table>
<% end %>
</div>
<% end %>
<div id='bidding_project_list'>
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project, :bid => @bid} %>
</div>
<% end %>

@ -0,0 +1,77 @@
<!--added by yiang -->
<!--display the board-->
<div class="borad-topic-count" style="margin-top:10px">
<span>共有 <%= link_to memos.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' : '' %>"><%= link_to h(topic.subject), open_source_project_relative_memo_path(open_source_project, topic) %></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>
</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), open_source_project_relative_memo_path(open_source_project, topic) %></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), open_source_project_relative_memo_path(open_source_project, topic) %></td>
</tr>
<tr>
<td align="center">浏览</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
</tr>
<!-- <tr>
<td align="left" colspan="2" ><span class="font_lighter"><%#= authoring topic.created_at, topic.author %>
<br />
</span></td>
</tr> -->
<tr>
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
</span></td>
<td align="left"><%= no_use_link(topic, User.current) %> </td>
</tr>
</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>

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
<div class="top-content">
<div class="top-content" >
<%= form_tag(:controller => 'open_source_projects', :action => "search", :method => :get) do %>
<table width="940px">
<tr>
@ -18,15 +18,16 @@
</table>
<% end %>
</div>
<style type="text/css">
.tb-navigation {
position: relative;
z-index: 400;
}
blockquote, body, button, code, dd, div, dl, dt, fieldset, form, h1, h2, h3, h4, h5, h6, input, legend, li, ol, p, pre, td, textarea, th, ul {
/*blockquote, body, button, code, dd, div, dl, dt, fieldset, form, h1, h2, h3, h4, h5, h6, input, legend, li, ol, p, pre, td, textarea, th, ul {
margin: 0;
padding: 0;
}
}*/
.navigation {
color: #666;
@ -128,9 +129,190 @@ li {
.nav-search-con{
padding-top: 7px;
}
</style>
<%= javascript_include_tag "ichart.1.2.min" %>
<%= stylesheet_link_tag "buglist-div-use.css" %>
<%= stylesheet_link_tag "buglist-ichart.css" %>
<%= stylesheet_link_tag "buglist.css" %>
<div class="mask">
<div class="header2"></div>
<div class="colleft">
<div class="col1" >
<h1>安全态势分析 </h1>
<div id='canvasDiv' style="border-style:none"></div>
</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 class="fixed"></div>
<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>
</ul>
</div>
</div>
</div>
</div>
<div style="clear:both; margin:0 0 10 0"></div>
<script type="text/javascript">
$(function(){
var flow=[];
for(var i=0;i<35;i++){
flow.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
// t.push(Math.floor(Math.random()*(30+((i%12)*5)))+10);
}
var data = [
{
name : 'commit',
value:flow,
color:'#0d8ecf',
line_width:2
}
];
var labels = ["","2010","2011","2012","2013","2014"];
var line = new iChart.LineBasic2D({
render : 'canvasDiv',
data: data,
align:'center',
title : '',
subtitle : '',
footnote : '',
width : 430, // 面板大小
height : 210,
shadow:true,
//shadow_color : '#20262f',
shadow_blur : 1,
shadow_offsetx : 0,
shadow_offsety : 2,
//background_color:null //'#383e46'设置透明背景
tip:{
enable:true,
shadow:true,
move_duration:400,
border:{
enable:true,
radius : 5,
width:2,
color:'#3f8695'
},
},
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'
},
sub_option : {
label:false, //是否显示数值
// hollow_inside:false,
smooth : true,//平滑曲线
point_size:2, // 焦点大小
// point_hollow : true,
},
coordinate:{
width:370, // 图表大小
//valid_width:330,
height:150,
axis:{
// color:'#9f9f9f',
color:'#dcdcdc',
width:[0,0,2,2]
},
grids:{
vertical:{
way:'share_alike',
value:1
// 改垂直线
}
},
scale:[{
position:'left',
start_scale:0,
scale_space:50,
end_scale:70,
scale_color:'#9f9f9f',
// label : {color:'#ffffff',fontsize:11},
},{
position:'bottom',
labels:labels
}]
}
});
//开始画图
/**
*自定义组件,画平均线。
*/
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>
<%#======================================================================box before%>
<div class="tb-navigation" data-spm="a230r.1.3">
<div class="tb-navigation" data-spm="a230r.1.3" style="margin-top:20px">
<div class="navigation">
<div class="nav-switch">
<a href="javascript:(function (){$('.nav-content').toggle();})();">

@ -51,4 +51,4 @@
:title => l(:button_delete)
) if @forum.destroyable_by?(User.current) %>
</div>
<%= render :partial => 'open_source_projects/show_topics', :locals => {:memos => @memos} %>
<%= render :partial => 'open_source_projects/show_topics', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>

@ -0,0 +1,55 @@
<!-- 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>
<!--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',
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
</span>
<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_memo', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
</div>

@ -62,7 +62,7 @@
<% if @memo.author %>
<%= authoring @memo.created_at, @memo.author.name %>
<% else %>
<%= added_time @memo.created_at %>
<%= user_url_and_time @memo.username, @memo.userhomeurl, @memo.created_at %>
<% end %></div>
<div class="tags">
<div id="tags">
@ -142,7 +142,7 @@
<% if reply.author %>
<%= authoring reply.created_at, reply.author.name %>
<% else %>
<%= added_time reply.created_at %>
<%= user_url_and_time reply.username, reply.userhomeurl, reply.created_at %>
<% end %></td>
</tr>
</table>

@ -1,10 +1,10 @@
class CreateRelativeMemos < ActiveRecord::Migration
def change
create_table :relative_memos do |t|
t.integer :osp_id, :null => false
t.integer :osp_id, :null => true
t.integer :parent_id, null: true
t.string :subject, null: false
t.text :content, null: false
t.mediumtext :content, null: false
t.integer :author_id
t.integer :replies_count, default: 0
t.integer :last_reply_id

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

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140521072851) do
ActiveRecord::Schema.define(:version => 20140519074133) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -23,9 +23,9 @@ ActiveRecord::Schema.define(:version => 20140521072851) do
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
create_table "applied_projects", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
create_table "andoidcontests", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "apply_project_masters", :force => true do |t|
@ -57,14 +57,11 @@ ActiveRecord::Schema.define(:version => 20140521072851) do
add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
create_table "attachmentstypes", :id => false, :force => true do |t|
t.integer "id", :null => false
t.integer "typeId"
create_table "attachmentstypes", :force => true do |t|
t.integer "typeId", :null => false
t.string "typeName", :limit => 50
end
add_index "attachmentstypes", ["id"], :name => "id"
create_table "auth_sources", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 60, :default => "", :null => false
@ -623,6 +620,14 @@ ActiveRecord::Schema.define(:version => 20140521072851) do
add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade"
create_table "projecting_softapplictions", :force => true do |t|
t.integer "user_id"
t.integer "softapplication_id"
t.integer "project_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "projects", :force => true do |t|
t.string "name", :default => "", :null => false
t.text "description"
@ -638,6 +643,7 @@ ActiveRecord::Schema.define(:version => 20140521072851) do
t.boolean "inherit_members", :default => false, :null => false
t.integer "project_type"
t.boolean "hidden_repo", :default => false, :null => false
t.integer "user_id"
t.integer "attachmenttype", :default => 1
end
@ -667,6 +673,13 @@ ActiveRecord::Schema.define(:version => 20140521072851) do
add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
create_table "relative_memo_to_open_source_projects", :force => true do |t|
t.integer "osp_id"
t.integer "relative_memo_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "relative_memos", :force => true do |t|
t.integer "osp_id", :null => false
t.integer "parent_id"
@ -774,7 +787,7 @@ ActiveRecord::Schema.define(:version => 20140521072851) do
t.integer "softapplication_id"
t.integer "is_public"
t.string "application_developers"
t.string "deposit_project_url"
t.string "deposit_project"
end
create_table "students_for_courses", :force => true do |t|

@ -0,0 +1,33 @@
(function() {
var $, FutureMessage, spinner_template,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
$ = jQuery;
spinner_template = '<div class="messenger-spinner">\n <span class="messenger-spinner-side messenger-spinner-side-left">\n <span class="messenger-spinner-fill"></span>\n </span>\n <span class="messenger-spinner-side messenger-spinner-side-right">\n <span class="messenger-spinner-fill"></span>\n </span>\n</div>';
FutureMessage = (function(_super) {
__extends(FutureMessage, _super);
function FutureMessage() {
return FutureMessage.__super__.constructor.apply(this, arguments);
}
FutureMessage.prototype.template = function(opts) {
var $message;
$message = FutureMessage.__super__.template.apply(this, arguments);
$message.append($(spinner_template));
return $message;
};
return FutureMessage;
})(window.Messenger.Message);
window.Messenger.themes.future = {
Message: FutureMessage
};
}).call(this);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,41 @@
.mask{
position: relative;
overflow: hidden;
margin: 0px 0 0 0;
width: 970px;
}
.header2{
float: left;
width: 100%;
background-color: #f4f4f4
}
.colleft{
position: relative;
width: 100%;
right: 50%;
background-color: #000000
}
.col1{
position: relative;
overflow: hidden;
float: left;
width: 470px;
left: 100%;
}
.col2{
position: relative;
overflow: hidden;
float: left;
width: 470px;
left: 3%;
}
a:hover, a:active {
color: #c61a1a;
text-decoration: underline;
}

@ -0,0 +1,74 @@
@CHARSET "utf-8";
/*body {
padding:0px;
margin:0px;
margin-top:10px;
text-align: left;
font-family:'微软雅黑',Trebuchet MS,Verdana,Helvetica,Arial,sans-serif;
}*/
.ichartjs_btn{
padding:2px 5px;
line-height:25px;
color:#0b2946;
cursor: pointer;
text-align:center;
font-size:12px;
/*border:1px solid #98adc1;*/
-webkit-box-shadow:0px 0px 2px #375073;
-moz-box-shadow:0px 0px 2px #375073;
box-shadow:0px 0px 2px #375073;
/*-moz-border-radius:5px;*/
/*-webkit-border-radius:5px;*/
/*-khtml-border-radius:5px;*/
/*border-radius:0px*/
}
.ichartjs_author{
position: absolute;
font-size:12px;
right: 20px;
top: 0px;
}
.ichartjs_author a{
color:#113659;
}
.ichartjs_info{
position:relative;
margin:10px;
padding:5px;
color:#1b4267;
}
.ichartjs_sm{
margin:10px 0px;
font-size: 13px;
font-weight: 60;
}
.ichartjs_details{
padding:0px;
text-indent:2em;
font-size: 12px;
line-height:20px;
}
#ichartjs_code{
display:none;
}
#ichartjs_result{
position: absolute;
left: 20px;
bottom: 20px;
padding:8px;
color:#fefefe;
font-size:20px;
font-weight:600;
background-color:#6d869f;
cursor: pointer;
text-align:center;
/*border:1px solid #6a869d;*/
-webkit-box-shadow:0px 0px 2px #375073;
-moz-box-shadow:0px 0px 2px #375073;
box-shadow:0px 0px 2px #375073;
/*-moz-border-radius:10px;*/
/*-webkit-border-radius:10px;*/
/*-khtml-border-radius:0px;*/
/*border-radius:10px*/
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,101 @@
/* line 4, ../../src/sass/messenger.sass */
ul.messenger {
margin: 0;
padding: 0;
}
/* line 8, ../../src/sass/messenger.sass */
ul.messenger > li {
list-style: none;
margin: 0;
padding: 0;
}
/* line 14, ../../src/sass/messenger.sass */
ul.messenger.messenger-empty {
display: none;
}
/* line 17, ../../src/sass/messenger.sass */
ul.messenger .messenger-message {
overflow: hidden;
*zoom: 1;
}
/* line 20, ../../src/sass/messenger.sass */
ul.messenger .messenger-message.messenger-hidden {
display: none;
}
/* line 23, ../../src/sass/messenger.sass */
ul.messenger .messenger-message .messenger-phrase, ul.messenger .messenger-message .messenger-actions a {
padding-right: 5px;
}
/* line 26, ../../src/sass/messenger.sass */
ul.messenger .messenger-message .messenger-actions {
float: right;
}
/* line 29, ../../src/sass/messenger.sass */
ul.messenger .messenger-message .messenger-actions a {
cursor: pointer;
text-decoration: underline;
}
/* line 33, ../../src/sass/messenger.sass */
ul.messenger .messenger-message ul, ul.messenger .messenger-message ol {
margin: 10px 18px 0;
}
/* line 36, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed {
position: fixed;
z-index: 10000;
}
/* line 40, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed .messenger-message {
min-width: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* line 45, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed .message .messenger-actions {
float: left;
}
/* line 48, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-top {
top: 20px;
}
/* line 51, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-bottom {
bottom: 20px;
}
/* line 54, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-top, ul.messenger.messenger-fixed.messenger-on-bottom {
left: 50%;
width: 800px;
margin-left: -400px;
}
@media (max-width: 960px) {
/* line 54, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-top, ul.messenger.messenger-fixed.messenger-on-bottom {
left: 10%;
width: 80%;
margin-left: 0px;
}
}
/* line 64, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-top.messenger-on-right, ul.messenger.messenger-fixed.messenger-on-bottom.messenger-on-right {
right: 20px;
left: auto;
}
/* line 68, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-top.messenger-on-left, ul.messenger.messenger-fixed.messenger-on-bottom.messenger-on-left {
left: 20px;
margin-left: 0px;
}
/* line 72, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-right, ul.messenger.messenger-fixed.messenger-on-left {
width: 350px;
}
/* line 75, ../../src/sass/messenger.sass */
ul.messenger.messenger-fixed.messenger-on-right .messenger-actions, ul.messenger.messenger-fixed.messenger-on-left .messenger-actions {
float: left;
}
/* line 78, ../../src/sass/messenger.sass */
ul.messenger .messenger-spinner {
display: none;
}

@ -0,0 +1,41 @@
.mask{
position: relative;
overflow: hidden;
margin: 0px 0 0 0;
width: 690px;
}
.header2{
float: left;
width: 100%;
background-color: #f4f4f4
}
.colleft{
position: relative;
width: 100%;
right: 50%;
background-color: #000000
}
.col1{
position: relative;
overflow: hidden;
float: left;
width: 50%;
left: 100%;
}
.col2{
position: relative;
overflow: hidden;
float: left;
width: 50%;
left: 1%;
}
a:hover, a:active {
color: #c61a1a;
text-decoration: underline;
}

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

Loading…
Cancel
Save