This commit is contained in:
guange 2015-12-18 10:41:06 +08:00
commit 39ad191dd0
7 changed files with 24 additions and 28 deletions

View File

@ -24,7 +24,7 @@ class IssuesController < ApplicationController
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
before_filter :find_project, :only => [:new, :create, :update_form]
#before_filter :authorize, :except => [:index, :show]
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org]
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply]
before_filter :find_optional_project, :only => [:index]
before_filter :check_for_default_issue_status, :only => [:new, :create]

View File

@ -28,7 +28,7 @@ class Journal < ActiveRecord::Base
has_one :journal_reply
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# 被ForgeActivity虚拟关联
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
#has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy 评论不应该算入
# 被ForgeMessage虚拟关联
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy
@ -52,7 +52,7 @@ class Journal < ActiveRecord::Base
before_create :split_private_notes
# fq
after_save :act_as_activity,:be_user_score,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message
after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message
# end
#after_destroy :down_user_score
#before_save :be_user_score
@ -162,14 +162,14 @@ class Journal < ActiveRecord::Base
end
# end
# Time 2015-02-27 13:30:19
# Author lizanle
# Description 公共表中需要保存一份该记录
def act_as_forge_activity
self.forge_acts << ForgeActivity.new(:user_id => self.user_id,
:project_id => self.issue.project.id)
end
# # Time 2015-02-27 13:30:19
# # Author lizanle
# # Description 公共表中需要保存一份该记录
# def act_as_forge_activity
# self.forge_acts << ForgeActivity.new(:user_id => self.user_id,
# :project_id => self.issue.project.id)
#
# end
# 缺陷状态更改,消息提醒
def act_as_forge_message

View File

@ -20,9 +20,9 @@
</div>
<input name="issue_quote_new" type="hidden" value="<%= %>" />
<fieldset><legend>回复</legend>
<%= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply', at_id: @issue.id, at_type: @issue.class.to_s %>
</fieldset>
<!--<fieldset><legend>回复</legend>-->
<%#= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply', at_id: @issue.id, at_type: @issue.class.to_s %>
<!--</fieldset>-->
<!--<%# if @issue.safe_attribute? 'private_notes' %>-->
<!--<label for="issue_private_notes"><%#= f.check_box :private_notes, :no_label => true %> <%#= l(:field_private_notes) %></label>-->
<!--<%# end %>-->

View File

@ -17,7 +17,7 @@
<% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<%#= format_time(reply.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %>

View File

@ -20,10 +20,10 @@
<div>
<%= render :partial => 'issues/form', :locals => {:f => f} %>
</div>
<!--<%= javascript_tag "$('#issue_subject').focus();" %>-->
<a href="#" class="blue_btn fl ml80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">
<%= l(:button_create) %>
</a>
<!--<%#= javascript_tag "$('#issue_subject').focus();" %>-->
<!--<a href="#" class="blue_btn fl ml80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">-->
<!--<%#= l(:button_create) %>-->
<!--</a>-->
<%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -22,12 +22,12 @@
<% else %>
<%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%=@repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn"%>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :confirm=>"确认要fork该项目吗" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div>
<% end %>

View File

@ -70,11 +70,11 @@ ActiveRecord::Schema.define(:version => 20151217051447) do
t.integer "user_id"
t.integer "at_message_id"
t.string "at_message_type"
t.boolean "viewed"
t.boolean "viewed", :default => false
t.string "container_type"
t.integer "container_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sender_id"
end
@ -1640,10 +1640,6 @@ ActiveRecord::Schema.define(:version => 20151217051447) do
t.string "extra"
end
create_table "temp", :id => false, :force => true do |t|
t.integer "id", :default => 0, :null => false
end
create_table "time_entries", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false