templates: rename template function Str2html -> Str2HTML

pull/5340/head^2
Unknwon 2018-12-10 22:23:56 -05:00
parent d3d8284985
commit db3f0048d8
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
36 changed files with 72 additions and 72 deletions

View File

@ -64,7 +64,7 @@ func NewFuncMap() []template.FuncMap {
"AppendAvatarSize": tool.AppendAvatarSize, "AppendAvatarSize": tool.AppendAvatarSize,
"Safe": Safe, "Safe": Safe,
"Sanitize": bluemonday.UGCPolicy().Sanitize, "Sanitize": bluemonday.UGCPolicy().Sanitize,
"Str2html": Str2HTML, // TODO: Rename to Str2HTML "Str2HTML": Str2HTML,
"NewLine2br": NewLine2br, "NewLine2br": NewLine2br,
"TimeSince": tool.TimeSince, "TimeSince": tool.TimeSince,
"RawTimeSince": tool.RawTimeSince, "RawTimeSince": tool.RawTimeSince,

View File

@ -10,7 +10,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<p> <p>
{{.i18n.Tr "admin.dashboard.statistic_info" .Stats.Counter.User .Stats.Counter.Org .Stats.Counter.PublicKey .Stats.Counter.Repo .Stats.Counter.Watch .Stats.Counter.Star .Stats.Counter.Action .Stats.Counter.Access .Stats.Counter.Issue .Stats.Counter.Comment .Stats.Counter.Oauth .Stats.Counter.Follow .Stats.Counter.Mirror .Stats.Counter.Release .Stats.Counter.LoginSource .Stats.Counter.Webhook .Stats.Counter.Milestone .Stats.Counter.Label .Stats.Counter.HookTask .Stats.Counter.Team .Stats.Counter.UpdateTask .Stats.Counter.Attachment | Str2html}} {{.i18n.Tr "admin.dashboard.statistic_info" .Stats.Counter.User .Stats.Counter.Org .Stats.Counter.PublicKey .Stats.Counter.Repo .Stats.Counter.Watch .Stats.Counter.Star .Stats.Counter.Action .Stats.Counter.Access .Stats.Counter.Issue .Stats.Counter.Comment .Stats.Counter.Oauth .Stats.Counter.Follow .Stats.Counter.Mirror .Stats.Counter.Release .Stats.Counter.LoginSource .Stats.Counter.Webhook .Stats.Counter.Milestone .Stats.Counter.Label .Stats.Counter.HookTask .Stats.Counter.Team .Stats.Counter.UpdateTask .Stats.Counter.Attachment | Str2HTML}}
</p> </p>
</div> </div>
<h4 class="ui top attached header"> <h4 class="ui top attached header">

View File

@ -1,20 +1,20 @@
{{if .Flash.ErrorMsg}} {{if .Flash.ErrorMsg}}
<div class="ui negative message"> <div class="ui negative message">
<p>{{.Flash.ErrorMsg | Str2html}}</p> <p>{{.Flash.ErrorMsg | Str2HTML}}</p>
</div> </div>
{{end}} {{end}}
{{if .Flash.WarningMsg}} {{if .Flash.WarningMsg}}
<div class="ui warning message"> <div class="ui warning message">
<p>{{.Flash.WarningMsg | Str2html}}</p> <p>{{.Flash.WarningMsg | Str2HTML}}</p>
</div> </div>
{{end}} {{end}}
{{if .Flash.SuccessMsg}} {{if .Flash.SuccessMsg}}
<div class="ui positive message"> <div class="ui positive message">
<p>{{.Flash.SuccessMsg | Str2html}}</p> <p>{{.Flash.SuccessMsg | Str2HTML}}</p>
</div> </div>
{{end}} {{end}}
{{if .Flash.InfoMsg}} {{if .Flash.InfoMsg}}
<div class="ui info message"> <div class="ui info message">
<p>{{.Flash.InfoMsg | Str2html}}</p> <p>{{.Flash.InfoMsg | Str2HTML}}</p>
</div> </div>
{{end}} {{end}}

View File

@ -21,7 +21,7 @@
<span class="text grey"><i class="octicon octicon-git-branch"></i> {{.NumForks}}</span> <span class="text grey"><i class="octicon octicon-git-branch"></i> {{.NumForks}}</span>
</div> </div>
</div> </div>
{{if .Description}}<p class="has-emoji">{{.Description | Str2html}}</p>{{end}} {{if .Description}}<p class="has-emoji">{{.Description | Str2HTML}}</p>{{end}}
<p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p> <p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
</div> </div>
</div> </div>

View File

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<p>{{.Body | Str2html}}</p> <p>{{.Body | Str2HTML}}</p>
<p> <p>
--- ---
<br> <br>

View File

@ -7,7 +7,7 @@
<body> <body>
<p>@{{.Doer.DisplayName}} mentioned you:</p> <p>@{{.Doer.DisplayName}} mentioned you:</p>
<p>{{.Body | Str2html}}</p> <p>{{.Body | Str2HTML}}</p>
<p> <p>
--- ---
<br> <br>

View File

@ -11,7 +11,7 @@
</h4> </h4>
<div class="ui attached warning segment"> <div class="ui attached warning segment">
<div class="ui red message"> <div class="ui red message">
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "org.settings.delete_prompt" | Str2html}}</p> <p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "org.settings.delete_prompt" | Str2HTML}}</p>
</div> </div>
<form class="ui form" id="delete-form" action="{{.Link}}" method="post"> <form class="ui form" id="delete-form" action="{{.Link}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}

View File

@ -23,13 +23,13 @@
</div> </div>
<div class="item"> <div class="item">
{{if eq .Team.LowerName "owners"}} {{if eq .Team.LowerName "owners"}}
{{.i18n.Tr "org.teams.owners_permission_desc" | Str2html}} {{.i18n.Tr "org.teams.owners_permission_desc" | Str2HTML}}
{{else if (eq .Team.Authorize 1)}} {{else if (eq .Team.Authorize 1)}}
{{.i18n.Tr "org.teams.read_permission_desc" | Str2html}} {{.i18n.Tr "org.teams.read_permission_desc" | Str2HTML}}
{{else if (eq .Team.Authorize 2)}} {{else if (eq .Team.Authorize 2)}}
{{.i18n.Tr "org.teams.write_permission_desc" | Str2html}} {{.i18n.Tr "org.teams.write_permission_desc" | Str2HTML}}
{{else if (eq .Team.Authorize 3)}} {{else if (eq .Team.Authorize 3)}}
{{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}} {{.i18n.Tr "org.teams.admin_permission_desc" | Str2HTML}}
{{end}} {{end}}
</div> </div>
</div> </div>

View File

@ -11,7 +11,7 @@
</h4> </h4>
<div class="ui attached guide table segment"> <div class="ui attached guide table segment">
<div class="item"> <div class="item">
<h3>{{.i18n.Tr "repo.clone_this_repo"}} <small>{{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3> <h3>{{.i18n.Tr "repo.clone_this_repo"}} <small>{{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2HTML}}</small></h3>
<div class="ui action small input"> <div class="ui action small input">
{{if not $.DisableHTTP}} {{if not $.DisableHTTP}}
<button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}"> <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">

View File

@ -47,7 +47,7 @@
{{else}} {{else}}
<a rel="nofollow" class="ui sha label" href="{{AppSubURL}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSHA1 .ID.String}}</a> <a rel="nofollow" class="ui sha label" href="{{AppSubURL}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSHA1 .ID.String}}</a>
{{end}} {{end}}
<span class="{{if gt .ParentCount 1}}grey text {{end}} has-emoji">{{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas | Str2html}}</span> <span class="{{if gt .ParentCount 1}}grey text {{end}} has-emoji">{{RenderCommitMessage false .Summary $.RepoLink $.Repository.ComposeMetas | Str2HTML}}</span>
</td> </td>
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td> <td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
</tr> </tr>

View File

@ -4,7 +4,7 @@
<div class="diff-detail-box diff-box"> <div class="diff-detail-box diff-box">
<div> <div>
<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 .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" 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>

View File

@ -9,7 +9,7 @@
<a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}"> <a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}">
{{.i18n.Tr "repo.diff.browse_source"}} {{.i18n.Tr "repo.diff.browse_source"}}
</a> </a>
{{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas | Str2html}} {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas | Str2HTML}}
</div> </div>
<div class="ui attached info segment"> <div class="ui attached info segment">
{{if .Author}} {{if .Author}}

View File

@ -14,7 +14,7 @@
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}> <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}>
<label> <label>
<i class="octicon octicon-git-commit" height="16" width="14"></i> <i class="octicon octicon-git-commit" height="16" width="14"></i>
{{$branchName := .BranchName | Str2html}} {{$branchName := .BranchName | Str2HTML}}
{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" $branchName | Safe}} {{.i18n.Tr "repo.editor.commit_directly_to_this_branch" $branchName | Safe}}
</label> </label>
</div> </div>

View File

@ -5,7 +5,7 @@
{{template "base/alert" .}} {{template "base/alert" .}}
{{if .PageIsRepoHome}} {{if .PageIsRepoHome}}
<p id="repo-desc"> <p id="repo-desc">
{{if .Repository.Description}}<span class="description has-emoji">{{.Repository.Description | NewLine2br | Str2html}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}} {{if .Repository.Description}}<span class="description has-emoji">{{.Repository.Description | NewLine2br | Str2HTML}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a> <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</p> </p>
<div class="ui segment" id="git-stats"> <div class="ui segment" id="git-stats">

View File

@ -35,7 +35,7 @@
<div class="meta"> <div class="meta">
{{ $closedDate:= TimeSince .ClosedDate $.Lang }} {{ $closedDate:= TimeSince .ClosedDate $.Lang }}
{{if .IsClosed}} {{if .IsClosed}}
<span class="octicon octicon-clock"></span> {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}} <span class="octicon octicon-clock"></span> {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2HTML}}
{{else}} {{else}}
<span class="octicon octicon-calendar"></span> <span class="octicon octicon-calendar"></span>
{{if .DeadlineString}} {{if .DeadlineString}}
@ -62,7 +62,7 @@
{{end}} {{end}}
{{if .Content}} {{if .Content}}
<div class="content"> <div class="content">
{{.RenderedContent|Str2html}} {{.RenderedContent|Str2HTML}}
</div> </div>
{{end}} {{end}}
</li> </li>

View File

@ -29,7 +29,7 @@
<div class="ui attached segment"> <div class="ui attached segment">
<div class="render-content markdown has-emoji"> <div class="render-content markdown has-emoji">
{{if .Issue.RenderedContent}} {{if .Issue.RenderedContent}}
{{.Issue.RenderedContent|Str2html}} {{.Issue.RenderedContent|Str2HTML}}
{{else}} {{else}}
<span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span> <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
{{end}} {{end}}
@ -90,7 +90,7 @@
<div class="ui attached segment"> <div class="ui attached segment">
<div class="render-content markdown has-emoji"> <div class="render-content markdown has-emoji">
{{if .RenderedContent}} {{if .RenderedContent}}
{{.RenderedContent | Str2html}} {{.RenderedContent | Str2HTML}}
{{else}} {{else}}
<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span> <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
{{end}} {{end}}
@ -140,7 +140,7 @@
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.DisplayName}}</a> {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.DisplayName}}</a> {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}</span>
<div class="detail"> <div class="detail">
<span class="octicon octicon-git-commit"></span> <span class="octicon octicon-git-commit"></span>
<span class="text grey">{{.Content | Str2html}}</span> <span class="text grey">{{.Content | Str2HTML}}</span>
</div> </div>
</div> </div>
{{end}} {{end}}

View File

@ -28,10 +28,10 @@
{{if .Issue.PullRequest.HasMerged}} {{if .Issue.PullRequest.HasMerged}}
{{ $mergedStr:= TimeSince .Issue.PullRequest.Merged $.Lang }} {{ $mergedStr:= TimeSince .Issue.PullRequest.Merged $.Lang }}
<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.Name}}</a> <a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.Name}}</a>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span> <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2HTML}}</span>
{{else}} {{else}}
<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> <a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span> <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2HTML}}</span>
{{end}} {{end}}
{{else}} {{else}}
{{ $createdStr:= TimeSince .Issue.Created $.Lang }} {{ $createdStr:= TimeSince .Issue.Created $.Lang }}

View File

@ -43,10 +43,10 @@
<a href="{{AppSubURL}}/{{.Publisher.Name}}">{{.Publisher.DisplayName}}</a> <a href="{{AppSubURL}}/{{.Publisher.Name}}">{{.Publisher.DisplayName}}</a>
</span> </span>
{{if .Created}}<span class="time">{{TimeSince .Created $.Lang}}</span>{{end}} {{if .Created}}<span class="time">{{TimeSince .Created $.Lang}}</span>{{end}}
<span class="ahead">{{$.i18n.Tr "repo.release.ahead" .NumCommitsBehind .Target | Str2html}}</span> <span class="ahead">{{$.i18n.Tr "repo.release.ahead" .NumCommitsBehind .Target | Str2HTML}}</span>
</p> </p>
<div class="markdown desc"> <div class="markdown desc">
{{Str2html .Note}} {{Str2HTML .Note}}
</div> </div>
<div class="download"> <div class="download">
<h2>{{$.i18n.Tr "repo.release.downloads"}}</h2> <h2>{{$.i18n.Tr "repo.release.downloads"}}</h2>

View File

@ -12,7 +12,7 @@
<div class="ui attached table segment"> <div class="ui attached table segment">
<div class="ui hook list"> <div class="ui hook list">
<div class="item"> <div class="item">
{{.i18n.Tr "repo.settings.githooks_desc" | Str2html}} {{.i18n.Tr "repo.settings.githooks_desc" | Str2HTML}}
</div> </div>
{{range .Hooks}} {{range .Hooks}}
<div class="item"> <div class="item">

View File

@ -184,7 +184,7 @@
<div class="field"> <div class="field">
<label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label> <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
<input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}"> <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{.Repository.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
<p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p> <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2HTML}}</p>
</div> </div>
<div class="inline fields"> <div class="inline fields">
<label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label> <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>

View File

@ -10,7 +10,7 @@
{{.i18n.Tr "repo.settings.branch_protection"}} {{.i18n.Tr "repo.settings.branch_protection"}}
</h4> </h4>
<div class="ui attached segment branch-protection"> <div class="ui attached segment branch-protection">
<p>{{.i18n.Tr "repo.settings.branch_protection_desc" .Branch.Name | Str2html}}</p> <p>{{.i18n.Tr "repo.settings.branch_protection_desc" .Branch.Name | Str2HTML}}</p>
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="inline field"> <div class="inline field">

View File

@ -1,5 +1,5 @@
{{if eq .HookType "dingtalk"}} {{if eq .HookType "dingtalk"}}
<p>{{.i18n.Tr "repo.settings.add_dingtalk_hook_desc" "https://open-doc.dingtalk.com/" | Str2html}}</p> <p>{{.i18n.Tr "repo.settings.add_dingtalk_hook_desc" "https://open-doc.dingtalk.com/" | Str2HTML}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/dingtalk/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> <form class="ui form" action="{{.BaseLink}}/settings/hooks/dingtalk/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}"> <div class="required field {{if .Err_PayloadURL}}error{{end}}">

View File

@ -1,5 +1,5 @@
{{if eq .HookType "discord"}} {{if eq .HookType "discord"}}
<p>{{.i18n.Tr "repo.settings.add_discord_hook_desc" "https://discordapp.com/" | Str2html}}</p> <p>{{.i18n.Tr "repo.settings.add_discord_hook_desc" "https://discordapp.com/" | Str2HTML}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/discord/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> <form class="ui form" action="{{.BaseLink}}/settings/hooks/discord/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}"> <div class="required field {{if .Err_PayloadURL}}error{{end}}">

View File

@ -1,5 +1,5 @@
{{if eq .HookType "gogs"}} {{if eq .HookType "gogs"}}
<p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://gogs.io/docs/features/webhook.html" | Str2html}}</p> <p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://gogs.io/docs/features/webhook.html" | Str2HTML}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> <form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}"> <div class="required field {{if .Err_PayloadURL}}error{{end}}">

View File

@ -34,7 +34,7 @@
<div class="ui attached table segment"> <div class="ui attached table segment">
<div class="ui hook list"> <div class="ui hook list">
<div class="item"> <div class="item">
{{.Description | Str2html}} {{.Description | Str2HTML}}
</div> </div>
{{range .Webhooks}} {{range .Webhooks}}
<div class="item"> <div class="item">

View File

@ -4,19 +4,19 @@
<div class="field"> <div class="field">
<div class="ui radio non-events checkbox"> <div class="ui radio non-events checkbox">
<input class="hidden" name="events" type="radio" value="push_only" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}> <input class="hidden" name="events" type="radio" value="push_only" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.event_push_only" | Str2html}}</label> <label>{{.i18n.Tr "repo.settings.event_push_only" | Str2HTML}}</label>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<div class="ui radio non-events checkbox"> <div class="ui radio non-events checkbox">
<input class="hidden" name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}> <input class="hidden" name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.event_send_everything" | Str2html}}</label> <label>{{.i18n.Tr "repo.settings.event_send_everything" | Str2HTML}}</label>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<div class="ui radio events checkbox"> <div class="ui radio events checkbox">
<input class="hidden" name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}> <input class="hidden" name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.event_choose" | Str2html}}</label> <label>{{.i18n.Tr "repo.settings.event_choose" | Str2HTML}}</label>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
{{if eq .HookType "slack"}} {{if eq .HookType "slack"}}
<p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "https://slack.com" | Str2html}}</p> <p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "https://slack.com" | Str2HTML}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post"> <form class="ui form" action="{{.BaseLink}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}"> <div class="required field {{if .Err_PayloadURL}}error{{end}}">

View File

@ -38,7 +38,7 @@
<div class="ui unstackable attached table segment"> <div class="ui unstackable attached table segment">
<div id="{{if .IsIPythonNotebook}}ipython-notebook{{end}}" class="file-view {{if .IsMarkdown}}markdown{{else if .IsIPythonNotebook}}ipython-notebook{{else if .ReadmeInList}}plain-text{{else if and .IsTextFile}}code-view{{end}} has-emoji"> <div id="{{if .IsIPythonNotebook}}ipython-notebook{{end}}" class="file-view {{if .IsMarkdown}}markdown{{else if .IsIPythonNotebook}}ipython-notebook{{else if .ReadmeInList}}plain-text{{else if and .IsTextFile}}code-view{{end}} has-emoji">
{{if .IsMarkdown}} {{if .IsMarkdown}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}} {{if .FileContent}}{{.FileContent | Str2HTML}}{{end}}
{{else if .IsIPythonNotebook}} {{else if .IsIPythonNotebook}}
<script> <script>
var rendered = null; var rendered = null;
@ -64,7 +64,7 @@
}); });
</script> </script>
{{else if .ReadmeInList}} {{else if .ReadmeInList}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}} {{if .FileContent}}{{.FileContent | Str2HTML}}{{end}}
{{else if not .IsTextFile}} {{else if not .IsTextFile}}
<div class="view-raw ui center"> <div class="view-raw ui center">
{{if .IsImageFile}} {{if .IsImageFile}}

View File

@ -10,7 +10,7 @@
<strong>{{.LatestCommit.Author.Name}}</strong> <strong>{{.LatestCommit.Author.Name}}</strong>
{{end}} {{end}}
<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}" rel="nofollow">{{ShortSHA1 .LatestCommit.ID.String}}</a> <a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}" rel="nofollow">{{ShortSHA1 .LatestCommit.ID.String}}</a>
<span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas | Str2html}}</span> <span class="grey has-emoji">{{RenderCommitMessage false .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas | Str2HTML}}</span>
</th> </th>
<th class="nine wide"> <th class="nine wide">
</th> </th>
@ -49,7 +49,7 @@
{{end}} {{end}}
<td class="message collapsing has-emoji"> <td class="message collapsing has-emoji">
<a rel="nofollow" class="ui sha label" href="{{$.RepoLink}}/commit/{{$commit.ID}}">{{ShortSHA1 $commit.ID.String}}</a> <a rel="nofollow" class="ui sha label" href="{{$.RepoLink}}/commit/{{$commit.ID}}">{{ShortSHA1 $commit.ID.String}}</a>
{{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas | Str2html}} {{RenderCommitMessage false $commit.Summary $.RepoLink $.Repository.ComposeMetas | Str2HTML}}
</td> </td>
<td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td> <td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
</tr> </tr>

View File

@ -62,7 +62,7 @@
</div> </div>
</div> </div>
<div class="markdown has-emoji"> <div class="markdown has-emoji">
{{.content | Str2html}} {{.content | Str2HTML}}
</div> </div>
</div> </div>
</div> </div>

View File

@ -15,15 +15,15 @@
{{else if .ResendLimited}} {{else if .ResendLimited}}
<p class="center">{{.i18n.Tr "auth.resent_limit_prompt"}}</p> <p class="center">{{.i18n.Tr "auth.resent_limit_prompt"}}</p>
{{else}} {{else}}
<p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .LoggedUser.Email .Hours | Str2html}}</p> <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .LoggedUser.Email .Hours | Str2HTML}}</p>
{{end}} {{end}}
{{else}} {{else}}
{{if .IsSendRegisterMail}} {{if .IsSendRegisterMail}}
<p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2html}}</p> <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2HTML}}</p>
{{else if .IsActivateFailed}} {{else if .IsActivateFailed}}
<p>{{.i18n.Tr "auth.invalid_code"}}</p> <p>{{.i18n.Tr "auth.invalid_code"}}</p>
{{else}} {{else}}
<p>{{.i18n.Tr "auth.has_unconfirmed_mail" .LoggedUser.Name .LoggedUser.Email | Str2html}}</p> <p>{{.i18n.Tr "auth.has_unconfirmed_mail" .LoggedUser.Name .LoggedUser.Email | Str2HTML}}</p>
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="text right"> <div class="text right">
<button class="ui blue button">{{.i18n.Tr "auth.resend_mail"}}</button> <button class="ui blue button">{{.i18n.Tr "auth.resend_mail"}}</button>

View File

@ -10,7 +10,7 @@
<div class="ui attached segment"> <div class="ui attached segment">
{{template "base/alert" .}} {{template "base/alert" .}}
{{if .IsResetSent}} {{if .IsResetSent}}
<p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2html}}</p> <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2HTML}}</p>
{{else if .IsResetRequest}} {{else if .IsResetRequest}}
<div class="required inline field {{if .Err_Email}}error{{end}}"> <div class="required inline field {{if .Err_Email}}error{{end}}">
<label for="email">{{.i18n.Tr "email"}}</label> <label for="email">{{.i18n.Tr "email"}}</label>

View File

@ -55,7 +55,7 @@
{{if .ShowRegistrationButton}} {{if .ShowRegistrationButton}}
<div class="inline field"> <div class="inline field">
<label></label> <label></label>
<a href="{{AppSubURL}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a> <a href="{{AppSubURL}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2HTML}}</a>
</div> </div>
{{end}} {{end}}
</div> </div>

View File

@ -10,56 +10,56 @@
<a href="{{AppSubURL}}/{{.GetActUserName}}">{{.ShortActUserName}}</a> <a href="{{AppSubURL}}/{{.GetActUserName}}">{{.ShortActUserName}}</a>
<!-- Reference types to models/action.go --> <!-- Reference types to models/action.go -->
{{if eq .GetOpType 1}} {{if eq .GetOpType 1}}
{{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 2}} {{else if eq .GetOpType 2}}
{{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 5}} {{else if eq .GetOpType 5}}
{{ $branchLink := .GetBranch | EscapePound}} {{ $branchLink := .GetBranch | EscapePound}}
{{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 6}} {{else if eq .GetOpType 6}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 7}} {{else if eq .GetOpType 7}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 8}} {{else if eq .GetOpType 8}}
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 9}} {{else if eq .GetOpType 9}}
{{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 10}} {{else if eq .GetOpType 10}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 11}} {{else if eq .GetOpType 11}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 12}} {{else if eq .GetOpType 12}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 13}} {{else if eq .GetOpType 13}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 14}} {{else if eq .GetOpType 14}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 15}} {{else if eq .GetOpType 15}}
{{ $index := index .GetIssueInfos 0}} {{ $index := index .GetIssueInfos 0}}
{{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 16}} {{else if eq .GetOpType 16}}
{{ $branchLink := .GetBranch | EscapePound}} {{ $branchLink := .GetBranch | EscapePound}}
{{$.i18n.Tr "action.create_branch" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.create_branch" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 17}} {{else if eq .GetOpType 17}}
{{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 18}} {{else if eq .GetOpType 18}}
{{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 19}} {{else if eq .GetOpType 19}}
{{$.i18n.Tr "action.fork_repo" .GetRepoLink .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.fork_repo" .GetRepoLink .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 20}} {{else if eq .GetOpType 20}}
{{ $branchLink := .GetBranch | EscapePound}} {{ $branchLink := .GetBranch | EscapePound}}
{{$.i18n.Tr "action.mirror_sync_push" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.mirror_sync_push" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 21}} {{else if eq .GetOpType 21}}
{{$.i18n.Tr "action.mirror_sync_create" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.mirror_sync_create" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
{{else if eq .GetOpType 22}} {{else if eq .GetOpType 22}}
{{$.i18n.Tr "action.mirror_sync_delete" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} {{$.i18n.Tr "action.mirror_sync_delete" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
{{end}} {{end}}
</p> </p>
{{if or (eq .GetOpType 5) (eq .GetOpType 20)}} {{if or (eq .GetOpType 5) (eq .GetOpType 20)}}

View File

@ -10,7 +10,7 @@
</h4> </h4>
<div class="ui attached warning segment"> <div class="ui attached warning segment">
<div class="ui red message"> <div class="ui red message">
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2html}}</p> <p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2HTML}}</p>
</div> </div>
<form class="ui form" id="delete-form" action="{{.Link}}" method="post"> <form class="ui form" id="delete-form" action="{{.Link}}" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}

View File

@ -43,7 +43,7 @@
</div> </div>
</div> </div>
<br> <br>
<p>{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}</p> <p>{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2HTML}}</p>
<div {{if not .HasError}}class="hide"{{end}} id="add-ssh-key-panel"> <div {{if not .HasError}}class="hide"{{end}} id="add-ssh-key-panel">
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.i18n.Tr "settings.add_new_key"}} {{.i18n.Tr "settings.add_new_key"}}