Conflicts: db/schema.rbexceptionHandle
commit
4b063a2c69
@ -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
|
@ -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
@ -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>
|
@ -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
|
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
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the '{}' from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class RelativeMemoToOpenSourceProjectTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
Loading…
Reference in new issue