Procházet zdrojové kódy

Str2html -> Str2HTML

Yoginth před 7 roky
rodič
revize
3fe2372834

+ 1 - 1
pkg/template/template.go

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

+ 4 - 4
templates/base/alert.tmpl

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

+ 1 - 1
templates/explore/repo_list.tmpl

@@ -55,7 +55,7 @@
 							<span class="text grey"><i class="menu-icon octicon">🌵</i> {{.NumForks}}</span>
 						</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"><i style="font-size:11px" class="menu-icon octicon">🕒</i> {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
 				</div>
 			</div>

+ 1 - 1
templates/mail/issue/comment.tmpl

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

+ 1 - 1
templates/mail/issue/mention.tmpl

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

+ 1 - 1
templates/org/settings/delete.tmpl

@@ -11,7 +11,7 @@
 				</h4>
 				<div class="ui attached warning segment">
 					<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>
 					<form class="ui form" id="delete-form" action="{{.Link}}" method="post">
 						{{.CSRFTokenHTML}}

+ 4 - 4
templates/org/team/sidebar.tmpl

@@ -23,13 +23,13 @@
 		</div>
 		<div class="item">
 			{{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)}}
-				{{.i18n.Tr "org.teams.read_permission_desc" | Str2html}}
+				{{.i18n.Tr "org.teams.read_permission_desc" | Str2HTML}}
 			{{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)}}
-				{{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}}
+				{{.i18n.Tr "org.teams.admin_permission_desc" | Str2HTML}}
 			{{end}}
 		</div>
 	</div>

+ 1 - 1
templates/repo/bare.tmpl

@@ -11,7 +11,7 @@
 					</h4>
 					<div class="ui attached guide table segment">
 						<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">
 								{{if not $.DisableHTTP}}
 									<button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">

+ 1 - 1
templates/repo/commits_table.tmpl

@@ -47,7 +47,7 @@
 							{{else}}
 								<a rel="nofollow" class="ui sha label" href="{{AppSubURL}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}">{{ShortSHA1 .ID.String}}</a>
 							{{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 class="grey text right aligned">
 							<i style="font-size:11px" class="menu-icon octicon">🕒</i> {{TimeSince .Author.When $.Lang}}

+ 1 - 1
templates/repo/diff/box.tmpl

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

+ 1 - 1
templates/repo/diff/page.tmpl

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

+ 1 - 1
templates/repo/editor/commit_form.tmpl

@@ -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}}>
 					<label>
 						<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}}
 					</label>
 				</div>

+ 1 - 1
templates/repo/home.tmpl

@@ -8,7 +8,7 @@
 			{{template "misc/signup_prompt" .}}
 		{{end}}
 			<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 repo url" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
 			</p>
 			<div class="ui segment" id="git-stats">