.row .col-sm-12 %h4 - if @info[:group] != '' - node_full = "#{@info[:group]}/#{@info[:node]}" - else - node_full = "#{@info[:node]}" %a{href: url_for("/node/version?node_full=#{node_full}")} versions \/ Diff version #{@info[:num]} - #{@info[:num2]} for Node %span.node_title #{@info[:node]} .row .col-sm-12 - date_version = Time.parse @info[:date] Date of version: %span.time #{date_version.strftime("%d-%m-%y at %r")} .row .col-sm-12 Number of lines changed: %span.added added #{@stat[0]} %span.deleted removed #{@stat[1]} .row .col-sm-6 - params = "node=#{@info[:node]}&group=#{@info[:group]}&oid=#{@info[:oid]}" - params = "#{params}&date=#{@info[:date]}&num=#{@info[:num]}" %form{action: url_for("/node/version/diffs?#{params}"), method: 'post', role: 'form'} .form-group %select.form-control#oid2{name: 'oid2'} - diff2 = {} - num = @oids_dates.count + 1 - next_id = false - @oids_dates.each do |x| %option{value: x[:oid]} Version #{num -= 1} (#{time_from_now x[:date]}) - if (x[:oid].to_s == @info[:oid2]) || (next_id) - diff2 = {num: num, date: x[:date]} - next_id = false - elsif (x[:oid].to_s == @info[:oid]) && !(@info[:oid2]) - next_id = true %button.btn.btn-default{type: 'submit'} Get Diffs! .row .col-sm-12 .old_version_title Version #{diff2[:num]} (#{time_from_now diff2[:date]}) .new_version_title Version #{@info[:num]} (#{time_from_now @info[:date]}) .row .col-sm-12 .diffs_old - @diff[:old_diff].each do |line| - if /^\+.*/.match(line) .added> :escaped #{line} - elsif /^\-.*/.match(line) .deleted> :escaped #{line} - elsif /^@@\s.*@@.*$/.match(line) .diff-index> :escaped #{line} - elsif /^empty_line /.match(line) - line.slice! "empty_line" .diff-empty> :escaped #{line} - else %div> :escaped #{line} .diffs_new - @diff[:new_diff].each do |line| - if /^\+.*/.match(line) .added> :escaped #{line} - elsif /^\-.*/.match(line) .deleted> :escaped #{line} - elsif /^@@\s.*@@.*$/.match(line) .diff-index> :escaped #{line} - elsif /^empty_line /.match(line) - line.slice! "empty_line" .diff-empty> :escaped #{line} - else %div> :escaped #{line}