diff --git a/app/views/pull_requests/_pull_request_changes.html.erb b/app/views/pull_requests/_pull_request_changes.html.erb index d64a65772..f12783146 100644 --- a/app/views/pull_requests/_pull_request_changes.html.erb +++ b/app/views/pull_requests/_pull_request_changes.html.erb @@ -1,14 +1,14 @@ <% if !@changes.blank? && @type == "3" %> -
-
-

改动了 <%= @changes_count %> 个文件

+
+
+

改动了 <%= @changes_count %> 个文件

+
+
    + <% @changes.each do |change| %> +
  • <%= change['new_path'] %>

  • + <% end %> +
- -
<% @changes.each do |change| %>
@@ -16,30 +16,7 @@
- - - <% 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']) %> - - -
- <%#= render :partial => 'repositories/change_diff', :locals => {:change => change} %> + <%= render :partial => 'repositories/change_diff', :locals => {:change => change} %>
<% end %> diff --git a/app/views/pull_requests/pull_request_changes.js.erb b/app/views/pull_requests/pull_request_changes.js.erb index 461cd3d06..19d03f06d 100644 --- a/app/views/pull_requests/pull_request_changes.js.erb +++ b/app/views/pull_requests/pull_request_changes.js.erb @@ -1 +1,2 @@ + $("#merge_record_3").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>'); \ No newline at end of file diff --git a/app/views/repositories/_change_diff.html.erb b/app/views/repositories/_change_diff.html.erb index d7eef5ce0..95126cd98 100644 --- a/app/views/repositories/_change_diff.html.erb +++ b/app/views/repositories/_change_diff.html.erb @@ -1,3 +1,4 @@ + <% diff = ActiveSupport::JSON.decode(change.to_json) %> @@ -17,7 +18,7 @@ <%= type == "match" ? "..." : last_line.center(4) %> <% else %> @@ -31,7 +32,7 @@ <%= new_line.to_s.center(4) %> <% end %> diff --git a/config/wechat.yml.template b/config/wechat.yml.template deleted file mode 100644 index 734ed0e51..000000000 --- a/config/wechat.yml.template +++ /dev/null @@ -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
" > -
<%= line.text.html_safe %>
+
<%= Redmine::CodesetUtil.replace_invalid_utf8(line.text).html_safe %>
-
<%= line.text.html_safe %>
+
<%= Redmine::CodesetUtil.replace_invalid_utf8(line.text).html_safe %>