缺陷主题、描述强制换行

跟踪按钮样式
引用样式修改
This commit is contained in:
huang 2015-04-15 15:15:51 +08:00
parent c607bd5cbf
commit 0023d0610b
5 changed files with 65 additions and 81 deletions

View File

@ -73,6 +73,35 @@ module JournalsHelper
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes ,:style => "width:580px")
end
# 缺陷回复内容、引用内容
# Redo:后面需要统一扩展
def render_notes_issue (issue, journal, options={})
content = ''
editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project)))
destroyable = User.current.logged? && ((journal.user == User.current) || (issue.author_id == User.current.id) || (User.current.admin == 1))
links = []
if !journal.notes.blank?
links << link_to(l(:button_quote),
{:controller => 'journals', :action => 'new', :id => issue.id, :journal_id => journal},
:remote => true,
:method => 'post',
:title => l(:button_quote)) if options[:reply_links]
links << link_to_in_place_notes_editor(l(:button_edit), "journal-#{journal.id}-notes",
{ :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' },
:title => l(:button_edit)) if editable
#Added by young
if destroyable
links << link_to(l(:button_delete), { :controller => 'journals', :action => 'destroy', :id => journal, :format => 'js' },
:title => l(:button_delete))
end
end
#content << content_tag('div', links.join(' ').html_safe, :class => 'contextual', :style => 'margin-top:-25px;') unless links.empty?
content << textilizable(journal, :notes)
css_classes = "wiki"
css_classes << " editable" if editable
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes ,:style => "width:510px")
end
def link_to_in_place_notes_editor(text, field_id, url, options={})
onclick = "$.ajax({url: '#{url_for(url)}', type: 'get'}); return false;"
link_to text, '#', options.merge(:onclick => onclick)

View File

@ -42,7 +42,28 @@ module WatchersHelper
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end
def watcher_link_issue(objects, user, options=[])
return '' unless user && user.logged?
objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)}
@watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or objects.first.instance_of?(Contest) or (objects.first.instance_of?(Bid)))
css = @watch_flag ? ([watcher_css(objects), watched ? 'talk_edit ' : 'talk_edit '].join(' ') << options[0].to_s) :
([watcher_css(objects), watched ? 'talk_edit fr ' : 'talk_edit fr '].join(' ') << options[0].to_s)
text = @watch_flag ?
(watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch))
url = watch_path(
:object_type => objects.first.class.to_s.underscore,
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)
)
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, :class => css
end

View File

@ -1,6 +1,6 @@
<!--added by huang-->
<%#= watcher_link(@issue, User.current) %>
<%= watcher_link_issue(@issue, User.current) %>
<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>

View File

@ -17,24 +17,17 @@
<% end %>
</p>
</div>
<!--编辑、引用、回复按钮-->
<div class="ping_disfoot"><%= render_links(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>
<div class="cl"></div>
<div class="recall" >
<div class="recall_head"><a href="#" target="_blank"><img src="images/project/pic_01.jpg" width="30" height="30" /></a></div>
<div class="recall_con">
<p><%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %></p>
<span class="c_grey fl"><%= format_time journal.created_on %></span>
</div>
<div class="cl"></div>
</div><!---recall end-->
<!---recall end-->
</div>
<div class="cl"></div>
</div>
</div>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<% end %>
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %>

View File

@ -12,7 +12,7 @@
<%= 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" >
<p class="pro_page_tit" style="word-break:break-all;" >
<%= @issue.subject %><span class='<%= "#{get_issue_type(@issue.tracker_id)}" %>'><%= get_issue_typevalue(@issue.tracker_id) %></span></p><br />
<div class="cl"></div>
<p>由<a href="javascript:void(0)" class="problem_name"><%= @issue.author %></a>
@ -24,7 +24,7 @@
</div><!--talk_txt end-->
<a href="javascript:void(0)" class="talk_edit fr"<%= render :partial => 'action_menu' %></a>
<div class="cl"></div>
<div class="talk_info mb10">
<div class="talk_info mb10" style="word-break:break-all;">
<% if @issue.description? || @issue.attachments.any? -%>
<% 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') %>
@ -90,81 +90,22 @@
<%= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'talk_edit fr' if authorize_for('issues', 'edit') %></a>
<div class="cl"></div>
</div><!--problem_main end-->
<!--留言-->
<% if @journals.present? %>
<div id="history">
<h3><%=l(:label_history)%></h3>
<%= render :partial => 'history', :locals => { :issue => @issue, :journals => @journals } %>
</div>
<% end %>
</div><!--pro_page_box end-->
<%# html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<!--<div class="<%#= @issue.css_classes %> details">-->
<!--<%#· if @prev_issue_id || @next_issue_id %>-->
<!--<div class="next-prev-links contextual">-->
<%#·= link_to_if @prev_issue_id,
# "\xc2\xab #{l(:label_previous)}",
# (@prev_issue_id ? issue_path(Issue.find_by_id(@prev_issue_id)) : nil),
:title => "##{@prev_issue_id}" %> |
<!--<%# if @issue_position && @issue_count %>-->
<!--<span class="position"><%#= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |-->
<!--<%# end %>-->
<%#= link_to_if @next_issue_id,
# "#{l(:label_next)} \xc2\xbb",
# (@next_issue_id ? issue_path(Issue.find_by_id(@next_issue_id)) : nil),
:title => "##{@next_issue_id}" %>
<!--</div>-->
<!--<%# end %>-->
<!-- 顶和踩 在这里添加 -->
<!--<span id="praise_tread" style="float: right">-->
<!--<%#= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>-->
<!--</span>-->
<!--<p class="author">-->
<%#= authoring @issue.created_on, @issue.author %>.
<!--<%# if @issue.created_on != @issue.updated_on %>-->
<%#= l(:label_updated_time, time_tag(@issue.updated_on)).html_safe %>.
<!--<%# end %>-->
<!--</p>-->
<!-- added by william -for tag -->
<!--<div id="tags">-->
<!--<%#= render :partial => 'tags/tag', :locals => {:obj => @issue,:object_flag => "3" }%>-->
<!--</div>-->
<!--<%# if false # !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>-->
<!--<hr />-->
<!--<div id="issue_tree">-->
<!--<div class="contextual">-->
<!--<%#= link_to_new_subtask(@issue) if User.current.allowed_to?(:manage_subtasks, @project) %>-->
<!--</div>-->
<!--<p><strong><%#=l(:label_subtask_plural)%></strong></p>-->
<!--<%#= render_descendants_tree(@issue) unless @issue.leaf? %>-->
<!--</div>-->
<!--<%# end %>-->
<!--<%# if @relations.present? || User.current.allowed_to?(:manage_issue_relations, @project) %>-->
<!--<hr />-->
<!--<div id="relations">-->
<!--<%#= render :partial => 'relations' %>-->
<!--</div>-->
<!--<%# end %>-->
<!--</div>-->
</div>
<% if @changesets.present? %>
<div id="issue-changesets">
<h3><%=l(:label_associated_revisions)%></h3>
<%= render :partial => 'changesets', :locals => { :changesets => @changesets} %>
</div>
<div id="issue-changesets">
<h3><%=l(:label_associated_revisions)%></h3>
<%= render :partial => 'changesets', :locals => { :changesets => @changesets} %>
</div>
<% end %>
<!--留言-->
<!--留言-- end>
<!--<div style="clear: both;"></div>-->
<!--<%#= render :partial => 'action_menu' %>-->