Skip to content

Add whitespace handling to PR-comparsion #4683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 14, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Optimize dropdown template code to be less verbose
  • Loading branch information
lafriks authored Aug 13, 2018
commit d8f7767b673f143ebf9775d094c2b4154a746e1b
24 changes: 4 additions & 20 deletions templates/repo/diff/whitespace_dropdown.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,19 @@
<i class="dropdown icon"></i>
<div class="menu">
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=">
{{ if eq .WhitespaceBehavior "" }}
<i class="circle dot icon"></i>
{{else}}
<i class="circle outline icon"></i>
{{end}}
<i class="circle {{ if eq .WhitespaceBehavior "" }}dot{{else}}outline{{end}} icon"></i>
{{.i18n.Tr "repo.diff.whitespace_show_everything"}}
</a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all">
{{ if eq .WhitespaceBehavior "ignore-all" }}
<i class="circle dot icon"></i>
{{else}}
<i class="circle outline icon"></i>
{{end}}
<i class="circle {{ if eq .WhitespaceBehavior "ignore-all" }}dot{{else}}outline{{end}} icon"></i>
{{.i18n.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
</a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change">
{{ if eq .WhitespaceBehavior "ignore-change" }}
<i class="circle dot icon"></i>
{{else}}
<i class="circle outline icon"></i>
{{end}}
<i class="circle {{ if eq .WhitespaceBehavior "ignore-change" }}dot{{else}}outline{{end}} icon"></i>
{{.i18n.Tr "repo.diff.whitespace_ignore_amount_changes"}}
</a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol">
{{ if eq .WhitespaceBehavior "ignore-eol" }}
<i class="circle dot icon"></i>
{{else}}
<i class="circle outline icon"></i>
{{end}}
<i class="circle {{ if eq .WhitespaceBehavior "ignore-eol" }}dot{{else}}outline{{end}} icon"></i>
{{.i18n.Tr "repo.diff.whitespace_ignore_at_eol"}}
</a>
</div>
Expand Down