pullrequest(井泉修改)

This commit is contained in:
huang 2016-11-29 18:22:43 +08:00
parent a19f6ffd38
commit 1299be5384
4 changed files with 14 additions and 76 deletions

View File

@ -1,14 +1,14 @@
<% if !@changes.blank? && @type == "3" %> <% if !@changes.blank? && @type == "3" %>
<div class="pullreques_change_box"> <div class="pullreques_change_box">
<div class="pullreques_pull_top clear"> <div class="pullreques_pull_top clear">
<p class="fl c_grey ml15">改动了<span class="fontBlue"> <%= @changes_count %></span> 个文件</p> <p class="fl c_grey ml15">改动了<span class="fontBlue"> <%= @changes_count %></span> 个文件</p>
</div>
<ul class="pullreques_change_list">
<% @changes.each do |change| %>
<li><span class="fl ml15 mt12 <%= get_type_of_file(change) %>"></span><p class="pullreques_pull_txt ml5 fl"><%= change['new_path'] %></p></li>
<% end %>
</ul>
</div> </div>
<ul class="pullreques_change_list">
<% @changes.each do |change| %>
<li><span class="fl ml15 mt12 <%= get_type_of_file(change) %>"></span><p class="pullreques_pull_txt ml5 fl"><%= change['new_path'] %></p></li>
<% end %>
</ul>
</div>
<% @changes.each do |change| %> <% @changes.each do |change| %>
<div class="showing-changes-row fontGrey2"> <div class="showing-changes-row fontGrey2">
<a class="linkGrey3" id="changed-files"> <a class="linkGrey3" id="changed-files">
@ -16,30 +16,7 @@
</a> </a>
</div> </div>
<div class="autoscroll"> <div class="autoscroll">
<table class="filecontent syntaxhl" style="width:100%;" > <%= render :partial => 'repositories/change_diff', :locals => {:change => change} %>
<tbody>
<% diff = ActiveSupport::JSON.decode(change['diff']).first %>
<% diff = OpenStruct.new(diff) %>
<% diff_file = Trustie::Gitlab::Diff::File.new(diff) %>
<% diff_file.diff_lines.each_with_index do |line, index| %>
<% type = line.type %>
<% last_line = line.new_pos %>
<% line_old = line.old_pos.to_s %>
<% if type == 'match' %>
<!--表示没有修改,两个都要显示行号-->
<% output += "|#{line_old.center(4)}|#{last_line.to_s.center(4)}|#{line.text}\n" %>
<% else %>
<% old_line = type == 'new' ? ' '*4: line_old %>
<% new_line = type == 'old' ? ' '*4: last_line %>
<% output += "|#{old_line.to_s.center(4)}|#{new_line.to_s.center(4)}|#{line.text}\n" %>
<% end %>
<% end %>
<%# line_num = diff_line_num(change['diff']) %>
<%# diff_content = diff_content(change['diff']) %>
</tbody>
</table>
<%#= render :partial => 'repositories/change_diff', :locals => {:change => change} %>
</div> </div>
<% end %> <% end %>

View File

@ -1 +1,2 @@
$("#merge_record_3").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>'); $("#merge_record_3").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>');

View File

@ -1,3 +1,4 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<table class="filecontent syntaxhl"> <table class="filecontent syntaxhl">
<tbody> <tbody>
<% diff = ActiveSupport::JSON.decode(change.to_json) %> <% diff = ActiveSupport::JSON.decode(change.to_json) %>
@ -17,7 +18,7 @@
<a><%= type == "match" ? "..." : last_line.center(4) %></a> <a><%= type == "match" ? "..." : last_line.center(4) %></a>
</td> </td>
<td class="line_content noteable_line <%= 'c_grey' if type == "match" %>" > <td class="line_content noteable_line <%= 'c_grey' if type == "match" %>" >
<pre style="width:auto;overflow: auto; "><%= line.text.html_safe %></pre> <pre style="width:auto;overflow: auto; "><%= Redmine::CodesetUtil.replace_invalid_utf8(line.text).html_safe %></pre>
</td> </td>
</tr> </tr>
<% else %> <% else %>
@ -31,7 +32,7 @@
<a><%= new_line.to_s.center(4) %></a> <a><%= new_line.to_s.center(4) %></a>
</td> </td>
<td class="<%= type == 'old' ? 'line_content noteable_line old' : 'line_content new noteable_line' %> " > <td class="<%= type == 'old' ? 'line_content noteable_line old' : 'line_content new noteable_line' %> " >
<pre style="width:auto;overflow: auto; "><%= line.text.html_safe %></pre> <pre style="width:auto;overflow: auto; "><%= Redmine::CodesetUtil.replace_invalid_utf8(line.text).html_safe %></pre>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@ -1,41 +0,0 @@
default: &default
# corpid: "corpid"
# corpsecret: "corpsecret"
# agentid: 1
#production
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
token: "123456"
access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key
#production
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
create_class_notice: "2GtJJGzzNlNy2i0UrsjEDlvfSVIUXQfSo47stpcQAVw"
create_project_notice: "jYu0iimbDpgWYZaTLXioZe2lvqoWTdKnUPyphTJ1mxs"
project_review_notice: "kdb-8UlMjTc3z51Qcf8g2vY4i_nE4OGKZAucdQma_2E"
join_project_notice: "TtXvy0XMIQyCgpnXHhoB8t-x0QIfy-78gAJXsGf9afg"
project_issue_notice: "HP8JejOnkzmvFopTarc0l1Tp4bU9qnxzdH27x3186lI"
at_notice: "U3kqzgriCaqkPI9qX0NDQOInJ5hiwHCz6wgTsPysSx4"
rebind_notice: "OYsiECfqUlHKlzF_X-pz_xsGh_vAAUunX0jYRdHlyFU"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
auto_openid_url_3: "&connect_redirect=1#wechat_redirect"
production:
<<: *default
development:
<<: *default
test:
<<: *default