Changed name from inline to unified

This commit is contained in:
Kim "BKC" Carlbäcker 2016-01-02 23:13:47 +01:00
parent 4e6d048ba1
commit 8fe5d887ae
8 changed files with 13 additions and 33 deletions

View file

@ -669,7 +669,7 @@ diff.commit = commit
diff.data_not_available = Diff Data Not Available. diff.data_not_available = Diff Data Not Available.
diff.show_diff_stats = Show Diff Stats diff.show_diff_stats = Show Diff Stats
diff.show_split_view = Split View diff.show_split_view = Split View
diff.show_inline_view = Inline View diff.show_unified_view = Unified View
diff.stats_desc = <strong> %d changed files</strong> with <strong>%d additions</strong> and <strong>%d deletions</strong> diff.stats_desc = <strong> %d changed files</strong> with <strong>%d additions</strong> and <strong>%d deletions</strong>
diff.bin = BIN diff.bin = BIN
diff.view_file = View File diff.view_file = View File

File diff suppressed because one or more lines are too long

View file

@ -738,14 +738,7 @@ pre.raw {
pre.wrap { pre.wrap {
white-space: pre-wrap; white-space: pre-wrap;
/* CSS 3 */ /* CSS 3 */
white-space: -moz-pre-wrap; word-break: break-word;
/* Mozilla, since 1999 */
white-space: -pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
} }
.full.height { .full.height {
padding: 0; padding: 0;

View file

@ -21,10 +21,10 @@ pre {
} }
&.wrap { &.wrap {
white-space: pre-wrap; /* CSS 3 */ white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ // white-space: -moz-normal; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */ // white-space: -normal; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */ // white-space: -o-normal; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */ word-break: break-word;
} }
} }
.full.height { .full.height {

View file

@ -168,7 +168,7 @@ func Diff(ctx *middleware.Context) {
} }
} }
ctx.Data["Style"] = ctx.Query("style") == "split" ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["Username"] = userName ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName ctx.Data["Reponame"] = repoName
ctx.Data["IsImageFile"] = commit.IsImageFile ctx.Data["IsImageFile"] = commit.IsImageFile
@ -214,7 +214,7 @@ func CompareDiff(ctx *middleware.Context) {
} }
commits = models.ValidateCommitsWithEmails(commits) commits = models.ValidateCommitsWithEmails(commits)
ctx.Data["Style"] = ctx.Query("style") == "split" ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["CommitRepoLink"] = ctx.Repo.RepoLink ctx.Data["CommitRepoLink"] = ctx.Repo.RepoLink
ctx.Data["Commits"] = commits ctx.Data["Commits"] = commits
ctx.Data["CommitCount"] = commits.Len() ctx.Data["CommitCount"] = commits.Len()

View file

@ -6,7 +6,7 @@
<i class="fa fa-retweet"></i> <i class="fa fa-retweet"></i>
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
<div class="ui right"> <div class="ui right">
<a class="ui tiny basic toggle button" href="?style={{if .Style}}inline{{else}}split{{end}}">{{ if .Style }}{{.i18n.Tr "repo.diff.show_inline_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a> <a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a> <a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
</div> </div>
</div> </div>
@ -33,9 +33,9 @@
</ol> </ol>
</div> </div>
{{if .Style}} {{if .IsSplitStyle}}
{{ template "repo/diff_box_split" . }} {{ template "repo/diff_box_split" . }}
{{else}} {{else}}
{{ template "repo/diff_box_inline" . }} {{ template "repo/diff_box_unified" . }}
{{end}} {{end}}
{{end}} {{end}}

View file

@ -81,10 +81,6 @@
prev.children().eq(2).html($(this).children().eq(2).html()); prev.children().eq(2).html($(this).children().eq(2).html());
prev.children().eq(3).addClass('add-code'); prev.children().eq(3).addClass('add-code');
prev.children().eq(2).addClass('add-code'); prev.children().eq(2).addClass('add-code');
// prev.children().eq(2).attr('style', 'background-color: #eaffea !important');
// prev.children().eq(2).children().eq(0).attr('style', 'background-color: #eaffea !important');
// prev.children().eq(3).attr('style', 'background-color: #eaffea !important');
// prev.children().eq(3).children().eq(0).attr('style', 'background-color: #eaffea !important');
$(this).remove(); $(this).remove();
} }
}); });

View file

@ -57,15 +57,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<script>
(function() {
$('tr.del-code').each(function() {
if($(this).next().hasClass('add-code')) {
// $($(this).children()[3]).replaceWith($(this).next().children()[3]);
}
});
}());
</script>
{{end}} {{end}}
{{end}} {{end}}
</div> </div>