mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Add links to toggle WIP status (#14677)
* Add links to toggle PR WIP status * Allow PR author to toggle WIP status * refactors and restyling, remove links from translations Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		| @@ -909,6 +909,17 @@ async function initRepository() { | ||||
|       return false; | ||||
|     }); | ||||
|  | ||||
|     // Toggle WIP | ||||
|     $('.toggle-wip a, .toggle-wip button').on('click', async (e) => { | ||||
|       e.preventDefault(); | ||||
|       const {title, wipPrefix, updateUrl} = e.currentTarget.closest('.toggle-wip').dataset; | ||||
|       await $.post(updateUrl, { | ||||
|         _csrf: csrf, | ||||
|         title: title?.startsWith(wipPrefix) ? title.substr(wipPrefix.length).trim() : `${wipPrefix.trim()} ${title}`, | ||||
|       }); | ||||
|       reload(); | ||||
|     }); | ||||
|  | ||||
|     // Issue Comments | ||||
|     initIssueComments(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user