commit
a1395d69ef
@ -0,0 +1,152 @@
|
||||
#coding=utf-8
|
||||
|
||||
class AtController < ApplicationController
|
||||
respond_to :json
|
||||
|
||||
def show
|
||||
@logger = Logger.new(Rails.root.join('log', 'at.log').to_s)
|
||||
users = find_at_users(params[:type], params[:id])
|
||||
@users = users
|
||||
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } if users
|
||||
end
|
||||
|
||||
private
|
||||
def find_at_users(type, id)
|
||||
@logger.info("#{type}, #{id}")
|
||||
case type
|
||||
when "Issue"
|
||||
find_issue(id)
|
||||
when 'Project'
|
||||
find_project(id)
|
||||
when 'Course'
|
||||
find_course(id)
|
||||
when 'Activity', 'CourseActivity', 'ForgeActivity','UserActivity', 'OrgActivity','PrincipalActivity'
|
||||
find_activity(id, type)
|
||||
when 'Attachment'
|
||||
find_attachment(id)
|
||||
when 'Message'
|
||||
find_message(id)
|
||||
when 'HomeworkCommon'
|
||||
find_homework(id)
|
||||
when 'Topic'
|
||||
find_topic(id)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def find_topic(id)
|
||||
|
||||
end
|
||||
|
||||
def find_issue(id)
|
||||
#1. issues list persons
|
||||
#2. project persons
|
||||
issue = Issue.find(id)
|
||||
journals = issue.journals
|
||||
at_persons = journals.map(&:user) + issue.project.users
|
||||
at_persons.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }
|
||||
end
|
||||
|
||||
def find_project(id)
|
||||
at_persons = Project.find(id).users
|
||||
at_persons.delete_if { |u| u.id == User.current.id }
|
||||
end
|
||||
|
||||
def find_course(id)
|
||||
at_persons = Course.find(id).users
|
||||
at_persons.delete_if { |u| u.id == User.current.id }
|
||||
end
|
||||
|
||||
def find_activity(id, type)
|
||||
|
||||
## 基本上是本类型中的 加上所属类型的用户
|
||||
case type
|
||||
when 'Activity'
|
||||
activity = Activity.find(id)
|
||||
(find_at_users(activity.act_type, activity.act_id) ||[]) +
|
||||
(find_at_users(activity.activity_container_type, activity.activity_container_id) || [])
|
||||
when 'CourseActivity'
|
||||
activity = CourseActivity.find(id)
|
||||
(find_at_users(activity.course_act_type, activity.course_act_id) || []) + (find_course(activity.course.id) || [])
|
||||
when 'ForgeActivity'
|
||||
activity = ForgeActivity.find(id)
|
||||
(find_at_users(activity.forge_act_type, activity.forge_act_id) ||[]) +
|
||||
(find_project(activity.project_id) || [])
|
||||
when 'UserActivity'
|
||||
activity = UserActivity.find(id)
|
||||
(find_at_users(activity.act_type, activity.act_id) || []) +
|
||||
(find_at_users(activity.container_type, activity.container_id) || [])
|
||||
when 'OrgActivity'
|
||||
activity = OrgActivity.find(id)
|
||||
(find_at_users(activity.org_act_type, activity.org_act_id) || []) +
|
||||
(find_at_users(activity.container_type, activity.container_id) || [])
|
||||
when 'PrincipalActivity'
|
||||
activity = PrincipalActivity.find(id)
|
||||
find_at_users(activity.principal_act_type, activity.principal_act_id)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
#作业应该是关联课程,取课程的用户列表
|
||||
def find_homework(id)
|
||||
homework = HomeworkCommon.find(id)
|
||||
find_course(homework.course_id)
|
||||
end
|
||||
|
||||
def find_attachment(id)
|
||||
attachment = Attachment.find(id)
|
||||
find_at_users(attachment.container_type, attachment.container_id)
|
||||
end
|
||||
|
||||
#Message
|
||||
def find_message(id)
|
||||
message = Message.find(id)
|
||||
at_persons = message.board.messages.map(&:author)
|
||||
(at_persons || []) + (find_project(message.board.project_id)||[])
|
||||
end
|
||||
|
||||
#News
|
||||
def find_news(id)
|
||||
find_project(News.find(id).project_id)
|
||||
end
|
||||
|
||||
#JournalsForMessage
|
||||
def find_journals_for_message(id)
|
||||
jounrnal = JournalsForMessage.find(id)
|
||||
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
|
||||
end
|
||||
|
||||
#Poll
|
||||
def find_poll(id)
|
||||
end
|
||||
|
||||
#Journal
|
||||
def find_journal(id)
|
||||
journal = Journal.find(id)
|
||||
find_at_users(journal.journalized_type, journal.journalized_id)
|
||||
end
|
||||
|
||||
#Document
|
||||
def find_document(id)
|
||||
find_project(Document.find(id).project_id)
|
||||
end
|
||||
|
||||
#ProjectCreateInfo
|
||||
def find_project_create_info(id)
|
||||
|
||||
end
|
||||
|
||||
#Principal
|
||||
def find_principal(id)
|
||||
|
||||
end
|
||||
|
||||
#BlogComment
|
||||
def find_blog_comment(id)
|
||||
blog = BlogComment.find(id).blog
|
||||
blog.users
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,102 @@
|
||||
#coding=utf-8
|
||||
|
||||
class AtMessage < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :sender, class_name: "User", foreign_key: "sender_id"
|
||||
attr_accessible :at_message, :container, :viewed, :user_id, :sender_id
|
||||
belongs_to :at_message, polymorphic: true
|
||||
belongs_to :container, polymorphic: true
|
||||
|
||||
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
|
||||
validates :user_id, :sender_id, :at_message_id, :at_message_type, presence: true
|
||||
|
||||
after_create :add_user_message
|
||||
|
||||
scope :unviewed, ->(type, id){
|
||||
where(at_message_type: type, at_message_id:id, viewed: false)
|
||||
}
|
||||
|
||||
def viewed!
|
||||
update_attribute :viewed, true
|
||||
end
|
||||
|
||||
def at_valid?
|
||||
return true if at_message_type == 'Issue'
|
||||
return true if 'Journal' == at_message_type
|
||||
return true if 'JournalsForMessage' == at_message_type
|
||||
return true if 'Message' == at_message_type
|
||||
false
|
||||
end
|
||||
|
||||
def add_user_message
|
||||
if MessageAll.where(message_type: self.class.name,message_id: self.id).empty?
|
||||
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
||||
end
|
||||
end
|
||||
|
||||
def subject
|
||||
case at_message_type
|
||||
when "Issue"
|
||||
"新建问题: " + at_message.subject
|
||||
when "Journal"
|
||||
"问题留言: " + at_message.journalized.subject
|
||||
when 'Message'
|
||||
if(at_message.topic?)
|
||||
"发布新帖: "
|
||||
else
|
||||
"回复帖子: "
|
||||
end + at_message.subject
|
||||
when 'JournalsForMessage'
|
||||
"作业: #{at_message.jour.name} 中留言"
|
||||
else
|
||||
logger.error "error type: #{at_message_type}"
|
||||
end
|
||||
end
|
||||
|
||||
def description
|
||||
case at_message_type
|
||||
when "Issue"
|
||||
at_message.description
|
||||
when "Journal"
|
||||
at_message.notes
|
||||
when 'Message'
|
||||
at_message.content
|
||||
when "JournalsForMessage"
|
||||
at_message.notes
|
||||
else
|
||||
logger.error "error type: #{at_message_type}"
|
||||
end
|
||||
end
|
||||
|
||||
def author
|
||||
case at_message_type
|
||||
when "Issue"
|
||||
at_message.author
|
||||
when "Journal"
|
||||
at_message.user
|
||||
when 'Message'
|
||||
at_message.author
|
||||
when 'JournalsForMessage'
|
||||
at_message.user
|
||||
else
|
||||
logger.error "error type: #{at_message_type}"
|
||||
end
|
||||
end
|
||||
|
||||
def url
|
||||
case at_message_type
|
||||
when "Issue"
|
||||
{controller: :issues, action: :show, id: at_message}
|
||||
when "Journal"
|
||||
{controller: :issues, action: :show, id: at_message.journalized}
|
||||
when 'Message'
|
||||
{controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board}
|
||||
when 'JournalsForMessage'
|
||||
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
|
||||
else
|
||||
logger.error "error type: #{at_message_type}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
[
|
||||
<% @users && @users.each_with_index do |person,index| %>
|
||||
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% end %>
|
||||
]
|
@ -0,0 +1,8 @@
|
||||
<% if !@save_flag && @save_message %>
|
||||
$("#error_show").html("<%= @save_message.join(', ') %>");
|
||||
<% elsif @message && @message != "" %>
|
||||
$("#error_show").html("<%= @message.html_safe %>");
|
||||
<% else %>
|
||||
closeModal();
|
||||
location.reload();
|
||||
<% end %>
|
@ -1,7 +1,7 @@
|
||||
<% if @in_user_center%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% else%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% end %>
|
@ -0,0 +1,31 @@
|
||||
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
|
||||
<div class="upload_con">
|
||||
<h2>将此资源引入组织资源栏目</h2>
|
||||
<% if error == '403' %>
|
||||
<div class="upload_box">
|
||||
<div style="color: red;">您没有权限引用此资源</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="upload_box">
|
||||
<div id="error_show" style="color: red;"></div>
|
||||
<%= form_tag attachments_add_exist_file_to_org_subfield_path,
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "relation_file_form" do %>
|
||||
<%= hidden_field_tag(:file_id, file.id) %>
|
||||
<%= content_tag('div', org_subfields_check_box_tags('org_subfields[org_subfield][]',org_subfield.organization.org_subfields.where("field_type='Resource'"),file), :id => 'org_subfields')%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submit_quote()
|
||||
{
|
||||
$('#submit_quote').parent().submit();
|
||||
}
|
||||
</script>
|
@ -0,0 +1,45 @@
|
||||
<% if org_subfield %>
|
||||
<span class="files_tag_icon" >
|
||||
<a title=""
|
||||
onclick="search_org_subfield_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','','<%= @q%>','<%= org_subfield.id%>');"
|
||||
>全部</a></span>
|
||||
<% end %>
|
||||
<% unless tag_list.nil?%>
|
||||
<% tag_list.each do |k,v|%>
|
||||
<% if tag_name && tag_name == k%>
|
||||
<!-- 鼠标不能移动是因为 href="javascript:void(0);"导致的 -->
|
||||
<span> <a class="files_tag_select" ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>(<%= v%>)</a></span>
|
||||
<% else%>
|
||||
<span class="files_tag_icon" >
|
||||
<a title="双击可编辑"
|
||||
onclick="search_org_subfield_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','<%= k %>','<%= @q %>','<%= org_subfield.id %>');"
|
||||
ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>(<%= v%>)</a></span>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
||||
<script>
|
||||
var clickFunction = null; //单击事件函数
|
||||
var isdb = false; //是否双击
|
||||
function search_org_subfield_tag_attachment(url,tag_name,q,org_subfield_id,sort) {
|
||||
//alert("111");
|
||||
//clearTimeout(clickFunction);
|
||||
clickFunction = setTimeout(function () {
|
||||
search_func();
|
||||
}, 500);
|
||||
function search_func() {
|
||||
if (isdb != false) return;
|
||||
$.get(
|
||||
url,
|
||||
{
|
||||
tag_name: tag_name,
|
||||
q: q,
|
||||
org_subfield_id: org_subfield_id
|
||||
},
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,11 @@
|
||||
<% if @can_quote %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>');
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>');
|
||||
<% end %>
|
||||
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
@ -0,0 +1,2 @@
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
||||
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
@ -0,0 +1,2 @@
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
||||
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
@ -0,0 +1,6 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
@ -1 +1,8 @@
|
||||
clickCanel();
|
||||
<% if @user_activity_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||
<% else %>
|
||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||
<% end %>
|
@ -1,10 +1,12 @@
|
||||
alert('关闭成功');
|
||||
<% if @user_activity_id == -1 %>
|
||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
|
||||
$("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||
<% else %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||
$("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% end %>
|
||||
/*
|
||||
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/
|
||||
|
@ -0,0 +1,51 @@
|
||||
<div id="issue_detail" style="display: block">
|
||||
<div class="ping_dispic">
|
||||
<%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
|
||||
</div>
|
||||
<div class="talk_txt fl">
|
||||
<p class="pro_page_tit" style="word-break:break-all;">
|
||||
<% case @issue.tracker_id %>
|
||||
<% when 1%>
|
||||
<span class="issues fl" title="缺陷"></span>
|
||||
<% when 2%>
|
||||
<span class="function fl" title="功能"></span>
|
||||
<% when 3%>
|
||||
<span class="support fl" title="支持"></span>
|
||||
<% when 4%>
|
||||
<span class="duty fl" title="任务"></span>
|
||||
<% when 5%>
|
||||
<span class="weekly fl" title="周报"></span>
|
||||
<% end %>
|
||||
</span> <span style="padding-left: 5px;"><%= @issue.subject %></span>
|
||||
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>
|
||||
<br>
|
||||
<div class="cl"></div>
|
||||
由<a href="javascript:void(0)" class="problem_name"><%= @issue.author %></a>添加于 <%= format_time(@issue.created_on).html_safe %>
|
||||
</div>
|
||||
|
||||
<!--talk_txt end-->
|
||||
<a href="javascript:void(0)" class="talk_edit fr"> </a>
|
||||
<%= render :partial => 'action_menu' %>
|
||||
<div class="cl"></div>
|
||||
<% if @issue.description? || @issue.attachments.any? -%>
|
||||
<div class="talk_info mb10 issue_desc" style="word-break:break-all;">
|
||||
<% if @issue.description? %>
|
||||
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
|
||||
<%= textAreailizable @issue, :description, :attachments => @issue.attachments %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end -%>
|
||||
<% if @issue.attachments.any? %>
|
||||
<div class="pro_pic_box mb10">
|
||||
<a href="javascript:void(0)" class="link_img fl">
|
||||
<!--显示附件、图片-->
|
||||
<%= link_to_attachment_project @issue, :thumbnails => true %></a><br/>
|
||||
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
|
||||
</div><!--pro_pic_box end-->
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
||||
<!--属性-->
|
||||
<%= render :partial => 'issues/attributes_show' %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -0,0 +1,82 @@
|
||||
<ul>
|
||||
<% issue.journals.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();" >
|
||||
<div class="homepagePostReplyPortrait" >
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%#= 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? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<p><%= string %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<P><%= reply.notes.html_safe %></P>
|
||||
</div>
|
||||
<div style="margin-top: 7px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'issues',:action => 'reply',:user_id=>reply.user_id, :id => issue.id,:journal_id=>reply.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue',
|
||||
:title => l(:button_reply)) if User.current.logged? %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
|
||||
:method => :get,
|
||||
:remote=>true,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.user_id == User.current.id %>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= @issue.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
|
||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||
<!--<div class="cl"></div>-->
|
||||
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
||||
<div nhname='toolbar_container_<%= @issue.id%>' ></div>
|
||||
<div class="cl"></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
|
||||
<div class="cl"></div>
|
||||
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,27 @@
|
||||
<div class="ReplyToMessageContainer borderBottomNone " id="reply_to_message_<%= @issue.id%>">
|
||||
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @issue.id%>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
|
||||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<div nhname='new_message_<%= @issue.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
|
||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||
<!--<div class="cl"></div>-->
|
||||
<input type="hidden" name="quote" value=""/>
|
||||
<input type="hidden" name="issue_id" value="<%=@issue.id%>"/>
|
||||
<div nhname='toolbar_container_<%= @issue.id%>' ></div>
|
||||
<div class="cl"></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id%>' name="notes"></textarea>
|
||||
<div class="cl"></div>
|
||||
<span nhname='contentmsg_<%= @issue.id%>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @issue.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--<a href="javascript:void(0);" onclick="issues_reply_editor.sync();$(this).parent().submit();" class="homepagePostReplySubmit postReplySubmit fl mt5">发送</a>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -1,3 +1,9 @@
|
||||
<% if @issue_id%> //issue详情中回复
|
||||
$("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
||||
<%else%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
||||
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%");
|
||||
<%end %>
|
||||
|
@ -1,3 +1,3 @@
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
||||
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
@ -0,0 +1,3 @@
|
||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
@ -0,0 +1,3 @@
|
||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
@ -0,0 +1,9 @@
|
||||
if($("#reply_message_<%= @jour.id%>").length > 0) {
|
||||
$("#reply_message_<%= @jour.id%>").replaceWith("<%= escape_javascript(render :partial => 'issues/issue_reply_ke_form') %>");
|
||||
$(function(){
|
||||
$('input[name=quote]').val("<%= raw escape_javascript(@tempContent.html_safe) %>");
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @issue.id%>").length >0) {
|
||||
$("#reply_to_message_<%= @issue.id%>").replaceWith("<p id='reply_message_<%= @jour.id%>'></p>");
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||
|
@ -1,3 +1,2 @@
|
||||
|
||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
|
||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue