dev_repository_hjq
whimlex 10 years ago
commit 7fa2338ce6

File diff suppressed because it is too large Load Diff

@ -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)

@ -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

@ -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) %>

@ -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) %>

@ -11,7 +11,7 @@
<div class="problem_txt fl">
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>)</span>
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit02 fl" %>
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit02 fl break_word" %>
<div class="cl"></div>
<p>
<% unless issue.assigned_to_id.nil? %>

@ -1,6 +1,7 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_issue_tracking) %></h2>
</div>
<div class="problem_top">
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<span>

@ -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') %>
@ -32,9 +32,9 @@
<% end %>
</div>
<div class="pro_pic_box mb10">
<a href="javascript:void(0)" class="link_img fl"><span class="pic_img fl"></span>
<a href="javascript:void(0)" class="link_img fl">
<!--显示附件、图片-->
<%= link_to_attachments @issue, :thumbnails => true %></a><br />
<%= link_to_attachment_project @issue, :thumbnails => true %></a><br />
<% end -%>
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
</div><!--pro_pic_box end-->
@ -51,7 +51,7 @@
</li>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
<li><p class="label" >&nbsp;指派给&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= @issue.assigned_to ? link_to_user(@issue.assigned_to, :class => "pro_info_p") : "-" %></span></li>
<li><p class="label" >&nbsp;指派给&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "-" %></span></li>
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
@ -77,7 +77,7 @@
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
<li><p class="label02" >&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%") %></span>
<li><p class="label02" >&nbsp;% 完成&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p"><%= @issue.done_ratio %>%</span>
</li>
<% end %>
<div class="cl"></div>
@ -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' %>-->

@ -34,7 +34,7 @@
:id => act.id},
:class => "problem_tit fl fb " %>
</a><br />
<p class="mt5"><%= textAreailizable act,:description %><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<%= l :label_activity_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
</p>
</div>
@ -51,7 +51,7 @@
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"}, :class => "problem_tit fl fb" %>
</a><br />
<p class="mt5"><%= textAreailizable act,:notes %><br />
<p class="mt5 break_word"><%= textAreailizable act,:notes %><br />
<%= l :label_activity_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>
@ -71,7 +71,7 @@
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}),
:class => "problem_tit fl fb " %>
<br />
<p class="mt5"><%= textAreailizable act,:content %><br />
<p class="mt5 break_word"><%= textAreailizable act,:content %><br />
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>
@ -89,7 +89,7 @@
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id}, :class => "problem_tit fl fb " %>
<% end %>
</a><br />
<p class="mt5"><%= textAreailizable act,:description %><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>
@ -104,7 +104,7 @@
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %><br />
<p class="mt5"><%= textAreailizable act,:description %><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>
@ -118,7 +118,7 @@
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %></a><br />
<p class="mt5"><%= textAreailizable act,:description %><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>

@ -85,7 +85,7 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;}
.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;}
.pro_info_box ul{}
.pro_info_box ul li{ margin-bottom:10px;}
.pro_info_p{ color:#0781b4; float:left; width:160px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.pro_info_p{ color:#0781b4 !important; float:left; width:160px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;padding-top:2.5px;}
.edit_pro_box{overflow:hidden;display:none; margin-bottom:30px; border-bottom:1px dashed #CCC; padding-bottom:10px;}
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }

Loading…
Cancel
Save