mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-28 04:51:07 +00:00 
			
		
		
		
	Follow #23328 Major changes: * Group the function in `templates/help.go` by their purposes. It could make future work easier. * Remove the `Printf` helper function, there is already a builtin `printf`. * Remove `DiffStatsWidth`, replace with `Eval` in template * Rename the `NewTextFuncMap` to `mailSubjectTextFuncMap`, it's for subject text template only, no need to make it support HTML functions. ---- And fine tune template error messages, to make it more friendly to developers and users.   --------- Co-authored-by: silverwind <me@silverwind.io>
		
			
				
	
	
		
			5 lines
		
	
	
	
		
			489 B
		
	
	
	
		
			Handlebars
		
	
	
	
	
	
			
		
		
	
	
			5 lines
		
	
	
	
		
			489 B
		
	
	
	
		
			Handlebars
		
	
	
	
	
	
| {{Eval .file.Addition "+" .file.Deletion}}
 | |
| <span class="diff-stats-bar gt-mx-3" data-tooltip-content="{{.root.locale.Tr "repo.diff.stats_desc_file" (Eval .file.Addition "+" .file.Deletion) .file.Addition .file.Deletion | Str2html}}">
 | |
| 	{{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}}
 | |
| 	<div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .file.Addition "/" "(" .file.Addition "+" .file.Deletion "+" 0.0 ")"}}%"></div>
 | |
| </span>
 |