mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Automatically select the org when click create repo from org dashboard (#24325)
 In org dashboard, the create repo link will be `repo/create?org={orgId}`
This commit is contained in:
		@@ -44,8 +44,10 @@ data.teamId = {{.Team.ID}};
 | 
				
			|||||||
{{if not .ContextUser.IsOrganization}}
 | 
					{{if not .ContextUser.IsOrganization}}
 | 
				
			||||||
data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepos}}},{{end}}];
 | 
					data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepos}}},{{end}}];
 | 
				
			||||||
data.isOrganization = false;
 | 
					data.isOrganization = false;
 | 
				
			||||||
data.organizationsTotalCount = {{.UserOrgsCount}}
 | 
					data.organizationsTotalCount = {{.UserOrgsCount}};
 | 
				
			||||||
data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}}
 | 
					data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};
 | 
				
			||||||
 | 
					{{else}}
 | 
				
			||||||
 | 
					data.organizationId = {{.ContextUser.ID}};
 | 
				
			||||||
{{end}}
 | 
					{{end}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
window.config.pageData.dashboardRepoList = data;
 | 
					window.config.pageData.dashboardRepoList = data;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
          {{ textMyRepos }}
 | 
					          {{ textMyRepos }}
 | 
				
			||||||
          <span class="ui grey label gt-ml-3">{{ reposTotalCount }}</span>
 | 
					          <span class="ui grey label gt-ml-3">{{ reposTotalCount }}</span>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <a :href="subUrl + '/repo/create'" :data-tooltip-content="textNewRepo">
 | 
					        <a :href="subUrl + '/repo/create' + (isOrganization ? '?org=' + organizationId : '')" :data-tooltip-content="textNewRepo">
 | 
				
			||||||
          <svg-icon name="octicon-plus"/>
 | 
					          <svg-icon name="octicon-plus"/>
 | 
				
			||||||
          <span class="sr-only">{{ textNewRepo }}</span>
 | 
					          <span class="sr-only">{{ textNewRepo }}</span>
 | 
				
			||||||
        </a>
 | 
					        </a>
 | 
				
			||||||
@@ -199,6 +199,7 @@ const sfc = {
 | 
				
			|||||||
      isOrganization: true,
 | 
					      isOrganization: true,
 | 
				
			||||||
      canCreateOrganization: false,
 | 
					      canCreateOrganization: false,
 | 
				
			||||||
      organizationsTotalCount: 0,
 | 
					      organizationsTotalCount: 0,
 | 
				
			||||||
 | 
					      organizationId: 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      subUrl: appSubUrl,
 | 
					      subUrl: appSubUrl,
 | 
				
			||||||
      ...pageData.dashboardRepoList,
 | 
					      ...pageData.dashboardRepoList,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user