Merge branch 'szzh' of https://git.trustie.net/jacknudt/trustieforge into szzh
commit
0ed58d4898
@ -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 %>
|
@ -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");
|
@ -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>
|
@ -1,46 +1,29 @@
|
|||||||
|
<div id="issue_edit" style="display: none">
|
||||||
<%= content_for(:header_tags) do %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
|
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true,:remote=>true} do |f| %>
|
||||||
<%= error_messages_for 'issue', 'time_entry' %>
|
<%= error_messages_for 'issue', 'time_entry' %>
|
||||||
<%= render :partial => 'conflict' if @conflict %>
|
<%= render :partial => 'conflict' if @conflict %>
|
||||||
<!--编辑的整个属性-->
|
<!--编辑的整个属性-->
|
||||||
<% if @edit_allowed || !@allowed_statuses.empty? %>
|
<div id="all_attributes" >
|
||||||
<div id="all_attributes" style="display:none;">
|
<%= render :partial => 'issues/form', :locals => {:f => f} %>
|
||||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
||||||
<div class="ping_C mb10 ml10"></div>
|
|
||||||
</div>
|
|
||||||
<% end %><!--end-->
|
|
||||||
|
|
||||||
<% if @journals.present? %>
|
|
||||||
<div id="history">
|
|
||||||
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<%# if @journals.present? %>
|
||||||
|
<!--<div id="history">-->
|
||||||
|
<!--<%#= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<%# end %>
|
||||||
<div id="journal_issue_note" class="wiki">
|
<div id="journal_issue_note" class="wiki">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<input name="issue_quote_new" type="hidden" value="<%= %>" />
|
<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' %>
|
|
||||||
</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 %>-->
|
|
||||||
|
|
||||||
<%= call_hook(:view_issues_edit_notes_bottom, {:issue => @issue, :notes => @notes, :form => f}) %>
|
|
||||||
<!--</fieldset>-->
|
|
||||||
|
|
||||||
<!--<fieldset><legend><%#= l(:label_attachment_plural) %></legend>-->
|
|
||||||
<!--<p style="padding-top: 5px;"><%#= render :partial => 'attachments/new_form', :locals => {:container => @issue} %>
|
|
||||||
<!--</fieldset>-->
|
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<%= f.hidden_field :lock_version %>
|
<%= f.hidden_field :lock_version %>
|
||||||
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
|
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
|
||||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id] %>
|
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
<div id="preview" class="wiki"></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}) %>");
|
<% 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}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
$(".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%");
|
||||||
|
// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%");
|
||||||
|
<%end %>
|
@ -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 %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
<% end %>
|
<% 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>
|
||||||
|
|
||||||
|
<% content_for :header_tags do %>
|
||||||
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
|
<%= robot_exclusion_tag %>
|
||||||
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
|
<% end %>
|
||||||
</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} %>
|
|
||||||
</div>
|
</div>
|
||||||
<!--<%= javascript_tag "$('#issue_subject').focus();" %>-->
|
</div>
|
||||||
<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 %>
|
|
@ -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>");
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<% if @obj %>
|
||||||
|
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
|
||||||
|
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list',
|
||||||
|
:locals => {:obj => @obj,:object_flag => @obj_flag}) %>');
|
||||||
|
$("#tags_name_<%=@obj.id%>").val("");
|
||||||
|
$("#add_tag_<%=@obj.id%>").hide();
|
||||||
|
$("#files_tag").html("<%= escape_javascript(render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @select_tag_name}) %>");
|
||||||
|
<% else %>
|
||||||
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'files/org_subfield_list',
|
||||||
|
:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments}) %>");
|
||||||
|
<% end %>
|
@ -0,0 +1,173 @@
|
|||||||
|
//需求:表情栏可以隐藏显示,高度只要一点高
|
||||||
|
function sd_create_editor(params){
|
||||||
|
// var minHeight; //最小高度
|
||||||
|
var paramsHeight = params.height; //设定的高度
|
||||||
|
var id = arguments[1] ? arguments[1] : undefined;
|
||||||
|
var paramsWidth = params.width == undefined ? "100%" : params.width;
|
||||||
|
|
||||||
|
var editor = params.kindutil.create(params.textarea, {
|
||||||
|
resizeType : 1,minWidth:"1px",width:"94%",
|
||||||
|
height:"33px",// == undefined ? "30px":paramsHeight+"px",
|
||||||
|
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
|
||||||
|
items:['emoticons','fontname',
|
||||||
|
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
|
||||||
|
'formatblock', 'fontsize', '|','indent', 'outdent',
|
||||||
|
'|','imagedirectupload'],
|
||||||
|
afterChange:function(){//按键事件
|
||||||
|
|
||||||
|
var edit = this.edit;
|
||||||
|
var body = edit.doc.body;
|
||||||
|
edit.iframe.height(paramsHeight);
|
||||||
|
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
|
||||||
|
},
|
||||||
|
afterBlur:function(){
|
||||||
|
//params.toolbar_container.hide();
|
||||||
|
sd_check_editor_form_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||||
|
if(this.isEmpty()) {
|
||||||
|
this.edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
|
||||||
|
}
|
||||||
|
//params.toolbar_container.hide();
|
||||||
|
$('#reply_image_' + id).addClass('imageFuzzy');
|
||||||
|
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){
|
||||||
|
params.submit_btn.hide();
|
||||||
|
params.toolbar_container.hide();
|
||||||
|
this.resize("100%", null);
|
||||||
|
}else if(this.edit.html().trim() != ""){
|
||||||
|
params.submit_btn.show();
|
||||||
|
params.toolbar_container.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
//params.submit_btn.css("display","none");
|
||||||
|
},
|
||||||
|
afterFocus: function(){
|
||||||
|
var edit = this.edit;
|
||||||
|
var body = edit.doc.body;
|
||||||
|
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
|
||||||
|
edit.html('');
|
||||||
|
}
|
||||||
|
params.submit_btn.show();
|
||||||
|
params.contentmsg.hide();
|
||||||
|
params.toolbar_container.show();
|
||||||
|
// params.toolbar_container.show();
|
||||||
|
$('#reply_image_' + id).removeClass('imageFuzzy');
|
||||||
|
//edit.iframe.width(paramsWidth);
|
||||||
|
this.resize(paramsWidth, null);
|
||||||
|
//params.submit_btn.show();
|
||||||
|
},
|
||||||
|
|
||||||
|
afterCreate:function(){
|
||||||
|
//params.submit_btn.hide();
|
||||||
|
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
||||||
|
toolbar.css('display','inline');
|
||||||
|
toolbar.css('padding',0);
|
||||||
|
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||||
|
params.toolbar_container.append(toolbar);
|
||||||
|
params.toolbar_container.hide();
|
||||||
|
//init
|
||||||
|
var edit = this.edit;
|
||||||
|
var body = edit.doc.body;
|
||||||
|
edit.iframe[0].scroll = 'no';
|
||||||
|
body.style.overflowY = 'hidden';
|
||||||
|
//reset height
|
||||||
|
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
|
||||||
|
edit.iframe.height(paramsHeight);
|
||||||
|
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
|
||||||
|
this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
|
||||||
|
// params.toolbar_container.hide();
|
||||||
|
|
||||||
|
}
|
||||||
|
}).loadPlugin('paste');
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sd_check_editor_form_field(params){
|
||||||
|
var result=true;
|
||||||
|
if(params.content!=undefined){
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
result=false;
|
||||||
|
}
|
||||||
|
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||||
|
params.textarea.html(params.content.html());
|
||||||
|
params.content.sync();
|
||||||
|
if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){
|
||||||
|
params.contentmsg.html('内容不能为空');
|
||||||
|
params.contentmsg.css({color:'#ff0000'});
|
||||||
|
}else{
|
||||||
|
params.contentmsg.html('填写正确');
|
||||||
|
params.contentmsg.css({color:'#008000'});
|
||||||
|
}
|
||||||
|
params.contentmsg.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function sd_create_form(params){
|
||||||
|
params.form.submit(function(){
|
||||||
|
var flag = false;
|
||||||
|
if(params.form.attr('data-remote') != undefined ){
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
var is_checked = sd_check_editor_form_field({
|
||||||
|
issubmit:true,
|
||||||
|
content:params.editor,
|
||||||
|
contentmsg:params.contentmsg,
|
||||||
|
textarea:params.textarea
|
||||||
|
});
|
||||||
|
if(is_checked){
|
||||||
|
if(flag){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
$(this)[0].submit();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function sd_reset_editor_form(params){
|
||||||
|
params.form[0].reset();
|
||||||
|
params.textarea.empty();
|
||||||
|
if(params.editor != undefined){
|
||||||
|
params.editor.html(params.textarea.html());
|
||||||
|
}
|
||||||
|
params.contentmsg.hide();
|
||||||
|
}
|
||||||
|
//第二个参数是高度,可以传,可以不传
|
||||||
|
function sd_create_editor_from_data(id){
|
||||||
|
var height = arguments[1] ? arguments[1] : undefined;
|
||||||
|
var width = arguments[2] ? arguments[2] : undefined;
|
||||||
|
KindEditor.ready(function (K) {
|
||||||
|
$("div[nhname='new_message_" + id + "']").each(function () {
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.div_form = $(this);
|
||||||
|
params.form = $("form", params.div_form);
|
||||||
|
if (params.form == undefined || params.form.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form);
|
||||||
|
params.contentmsg = $("span[nhname='contentmsg_" + id + "']", params.div_form);
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form);
|
||||||
|
params.cancel_btn = $("#new_message_cancel_btn_" + id);
|
||||||
|
params.submit_btn = $("#new_message_submit_btn_" + id);
|
||||||
|
params.height = height;
|
||||||
|
params.width = width;
|
||||||
|
if (params.textarea.data('init') == undefined) {
|
||||||
|
params.editor = sd_create_editor(params,id);
|
||||||
|
sd_create_form(params);
|
||||||
|
params.cancel_btn.click(function () {
|
||||||
|
sd_reset_editor_form(params);
|
||||||
|
});
|
||||||
|
params.submit_btn.click(function () {
|
||||||
|
params.form.submit();
|
||||||
|
});
|
||||||
|
params.textarea.data('init', 1);
|
||||||
|
$(this).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
div_form = $("div[nhname='new_message_" + id + "']");
|
||||||
|
$(".ke-edit", div_form).css("height","33px");
|
||||||
|
$(".ke-edit-iframe",div_form).css("height","33px");
|
||||||
|
}
|
Loading…
Reference in new issue