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, '[...]')
@content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\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
rescue ActiveRecord::RecordNotFound
render_404

View File

@ -186,7 +186,7 @@ class Mailer < ActionMailer::Base
@course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, courses c
where m.user_id = '#{user.id}' and c.id = m.course_id and jfm.jour_id = c.id
and jfm.jour_type='Course' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@user_journal_messages = user.journals_for_messages.where("jour_type='Principal' and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
# 查询user在项目中留言用户反馈

View File

@ -20,8 +20,10 @@
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>
</div>
<% end %>
<div id="journal_issue_note" class="wiki"></div>
<input name="issue_quote_new" type="hidden" value="<%= %>" />
<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>
<!--<%# if @issue.safe_attribute? 'private_notes' %>-->
<!--<label for="issue_private_notes"><%#= f.check_box :private_notes, :no_label => true %> <%#= l(:field_private_notes) %></label>-->

View File

@ -3,9 +3,9 @@
<!-- modified by bai -->
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>" style=" word-wrap: break-word; word-break: break-all">
<!-- 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_discon" style="width: 600px;">
<div class="ping_discon">
<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>
<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>
<!--回复内容、引用内容-->
<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>
<div class="cl"></div>

View File

@ -109,6 +109,9 @@
<%= render :partial => 'edit' %>
</div>
<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();">
<%= l(:button_submit) %>
</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
if @journal && @journal.private_notes?
if @journal && @journal.private_notes?
%>
$('#issue_private_notes').attr('checked', true);
<% end %>
showAndScrollTo("update", "notes");
$('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight;