Fix .locale.Tr function not found in delete modal (#23468)
				
					
				
			Caught by @wxiaoguang in https://github.com/go-gitea/gitea/pull/23337#issuecomment-1467317742. Additionally, there were three instances that have the same content as `templates/base/deletion_modal_actions.tmpl` but that are not intended to delete something. Instead of renaming the template above, these instances were simply re-hard-coded again. Renaming/improving the template above is left for future PRs.
This commit is contained in:
		
							parent
							
								
									f83246edb2
								
							
						
					
					
						commit
						6250fe1dc1
					
				
					 2 changed files with 31 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -43,7 +43,16 @@
 | 
			
		|||
												<input type="hidden" name="action" value="adopt">
 | 
			
		||||
												<input type="hidden" name="q" value="{{$.Keyword}}">
 | 
			
		||||
												<input type="hidden" name="page" value="{{$.CurrentPage}}">
 | 
			
		||||
												{{template "base/delete_modal_actions" .}}
 | 
			
		||||
												<div class="actions">
 | 
			
		||||
													<button class="ui red basic inverted cancel button">
 | 
			
		||||
														{{svg "octicon-trash" 16 "gt-mr-2"}}
 | 
			
		||||
														{{$.locale.Tr "modal.no"}}
 | 
			
		||||
													</button>
 | 
			
		||||
													<button class="ui green basic inverted ok button">
 | 
			
		||||
														{{svg "octicon-check" 16 "gt-mr-2"}}
 | 
			
		||||
														{{$.locale.Tr "modal.yes"}}
 | 
			
		||||
													</button>
 | 
			
		||||
												</div>
 | 
			
		||||
											</form>
 | 
			
		||||
										</div>
 | 
			
		||||
										<button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button>
 | 
			
		||||
| 
						 | 
				
			
			@ -61,7 +70,16 @@
 | 
			
		|||
												<input type="hidden" name="action" value="delete">
 | 
			
		||||
												<input type="hidden" name="q" value="{{$.Keyword}}">
 | 
			
		||||
												<input type="hidden" name="page" value="{{$.CurrentPage}}">
 | 
			
		||||
												{{template "base/delete_modal_actions" .}}
 | 
			
		||||
												<div class="actions">
 | 
			
		||||
													<button class="ui red basic inverted cancel button">
 | 
			
		||||
														{{svg "octicon-trash" 16 "gt-mr-2"}}
 | 
			
		||||
														{{$.locale.Tr "modal.no"}}
 | 
			
		||||
													</button>
 | 
			
		||||
													<button class="ui green basic inverted ok button">
 | 
			
		||||
														{{svg "octicon-check" 16 "gt-mr-2"}}
 | 
			
		||||
														{{$.locale.Tr "modal.yes"}}
 | 
			
		||||
													</button>
 | 
			
		||||
												</div>
 | 
			
		||||
											</form>
 | 
			
		||||
										</div>
 | 
			
		||||
									</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,7 +50,16 @@
 | 
			
		|||
														{{$.CsrfTokenHtml}}
 | 
			
		||||
														<input type="hidden" name="id" value="{{$dir}}">
 | 
			
		||||
														<input type="hidden" name="action" value="adopt">
 | 
			
		||||
														{{template "base/delete_modal_actions" .}}
 | 
			
		||||
														<div class="actions">
 | 
			
		||||
															<button class="ui red basic inverted cancel button">
 | 
			
		||||
																{{svg "octicon-x"}}
 | 
			
		||||
																{{$.locale.Tr "modal.no"}}
 | 
			
		||||
															</button>
 | 
			
		||||
															<button class="ui green basic inverted ok button">
 | 
			
		||||
																{{svg "octicon-check"}}
 | 
			
		||||
																{{$.locale.Tr "modal.yes"}}
 | 
			
		||||
															</button>
 | 
			
		||||
														</div>
 | 
			
		||||
													</form>
 | 
			
		||||
												</div>
 | 
			
		||||
											{{end}}
 | 
			
		||||
| 
						 | 
				
			
			@ -68,7 +77,7 @@
 | 
			
		|||
														{{$.CsrfTokenHtml}}
 | 
			
		||||
														<input type="hidden" name="id" value="{{$dir}}">
 | 
			
		||||
														<input type="hidden" name="action" value="delete">
 | 
			
		||||
														{{template "base/delete_modal_actions" .}}
 | 
			
		||||
														{{template "base/delete_modal_actions" $}}
 | 
			
		||||
													</form>
 | 
			
		||||
												</div>
 | 
			
		||||
											{{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue