1、项目issue区分主贴和回帖

2、引用模式修改
This commit is contained in:
huang 2015-07-02 08:43:41 +08:00
parent f395967ac9
commit af59cd9ba7
6 changed files with 16 additions and 8 deletions

View File

@ -74,6 +74,7 @@ class JournalsController < ApplicationController
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]') text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
@content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> " @content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
@content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content
@id = user.id @id = user.id
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404

View File

@ -20,6 +20,8 @@
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %> <%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>
</div> </div>
<% end %> <% end %>
<div id="journal_issue_note" class="wiki"></div>
<input name="issue_quote_new" type="hidden" value="<%= %>" />
<fieldset><legend>回复</legend> <fieldset><legend>回复</legend>
<%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %> <%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %>
</fieldset> </fieldset>

View File

@ -3,9 +3,9 @@
<!-- modified by bai --> <!-- modified by bai -->
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>" style=" word-wrap: break-word; word-break: break-all"> <div id="change-<%= journal.id %>" class="<%= journal.css_classes %>" style=" word-wrap: break-word; word-break: break-all">
<!-- end --> <!-- end -->
<div class="ping_C mb10 ml10"> <div class="ping_C mb10">
<div class="ping_dispic"><a href="#" target="_blank"><%= image_tag(url_to_avatar(journal.user), :class => "ping_dispic",:width => 46,:height => 46) %></a></div> <div class="ping_dispic"><a href="#" target="_blank"><%= image_tag(url_to_avatar(journal.user), :class => "ping_dispic",:width => 46,:height => 46) %></a></div>
<div class="ping_discon" style="width: 600px;"> <div class="ping_discon">
<div class="ping_distop"> <div class="ping_distop">
<a href="#" target="_blank" class="c_blue fb fl mb10 "><%= journal.user %></a><span class="c_grey fr"><%= format_time journal.created_on %></span> <a href="#" target="_blank" class="c_blue fb fl mb10 "><%= journal.user %></a><span class="c_grey fr"><%= format_time journal.created_on %></span>
<div class="cl"></div> <div class="cl"></div>
@ -20,7 +20,9 @@
<!--编辑、引用、回复按钮--> <!--编辑、引用、回复按钮-->
<div class="ping_disfoot"><%= render_links_easy(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></div> <div class="ping_disfoot"><%= render_links_easy(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></div>
<!--回复内容、引用内容--> <!--回复内容、引用内容-->
<p><%= render_notes_issue(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></p> <p>
<%= render_notes_issue(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
</p>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -109,6 +109,9 @@
<%= render :partial => 'edit' %> <%= render :partial => 'edit' %>
</div> </div>
<p style="padding-top: 5px"></p> <p style="padding-top: 5px"></p>
<!--引用时不能修改,剥离出引用内容-->
<a remote="true" href="javascript:void(0)" class="blue_btn fr mr80" onclick="issue_desc_editor.sync();$('#issue-form').submit();"> <a remote="true" href="javascript:void(0)" class="blue_btn fr mr80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">
<%= l(:button_submit) %> <%= l(:button_submit) %>
</a> </a>

View File

@ -1,11 +1,11 @@
$('#issue_notes').val("<%= raw escape_javascript(@content) %>"); $('#journal_issue_note').html("<%= raw escape_javascript(@content.html_safe) %>");
$("input[name='issue_quote_new']").val("<%= raw escape_javascript(@content.html_safe) %>");
<% <%
# when quoting a private journal, check the private checkbox # when quoting a private journal, check the private checkbox
if @journal && @journal.private_notes? if @journal && @journal.private_notes?
%> %>
$('#issue_private_notes').attr('checked', true); $('#issue_private_notes').attr('checked', true);
<% end %> <% end %>
showAndScrollTo("update", "notes"); showAndScrollTo("update", "notes");
$('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight; $('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight;