Merge branch 'szzh' of https://git.trustie.net/jacknudt/trustieforge into szzh
commit
b3b5bc7ffd
@ -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 %>
|
||||
]
|
@ -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 %>
|
@ -1,10 +1,10 @@
|
||||
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%");
|
||||
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%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% end %>
|
||||
/*
|
||||
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/
|
||||
|
@ -0,0 +1,38 @@
|
||||
<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;"> <span class="issues fl fl" title="缺陷"></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 @@
|
||||
$("#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%");
|
||||
<% 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%", '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%");
|
@ -1,27 +1,35 @@
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
</script>
|
||||
<div class="homepageRight mt0 ml10" >
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">新建问题</div>
|
||||
</div>
|
||||
<div class="resources mt10" style="min-height:619px;">
|
||||
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
|
||||
<%= labelled_form_for @issue, :url => project_issues_path(@project),
|
||||
:html => {:id => 'issue-form', :multipart => true} do |f| %>
|
||||
<%= error_messages_for 'issue' %>
|
||||
<%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %>
|
||||
<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>-->
|
||||
<%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
||||
|
||||
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
|
||||
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
|
||||
</div>
|
||||
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
|
||||
<%= labelled_form_for @issue, :url => project_issues_path(@project),
|
||||
:html => {:id => 'issue-form', :multipart => true} do |f| %>
|
||||
<%= error_messages_for 'issue' %>
|
||||
<%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %>
|
||||
<div>
|
||||
<%= render :partial => 'issues/form', :locals => {:f => f} %>
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
</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>
|
||||
<%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
</div>
|
@ -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%>");
|
||||
|
@ -1,7 +1,7 @@
|
||||
<% 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%");
|
||||
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%");
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||
<% end %>
|
@ -1,8 +1,8 @@
|
||||
clickCanel();
|
||||
<% if @user_activity_id %>
|
||||
$("#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%");
|
||||
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%");
|
||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||
<% end %>
|
@ -0,0 +1,21 @@
|
||||
<% if AtMessage === ma && ma.at_valid? %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher"><%= ma.author.login %></span><span class="homepageNewsType fl">提到了你:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.subject.html_safe, ma.url,
|
||||
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))" %></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.subject %></p>
|
||||
<% unless ma.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue