Browse Source

Updated Routes for GRC #100

Yoginth 7 years ago
parent
commit
a53f145f27
2 changed files with 22 additions and 22 deletions
  1. 20 20
      routes/admin/admin.go
  2. 2 2
      routes/admin/news.go

+ 20 - 20
routes/admin/admin.go

@@ -125,26 +125,26 @@ func updateSystemStatus() {
 type AdminOperation int
 
 const (
-	// CLEAN_INACTIVATE_USER operation value
-	CLEAN_INACTIVATE_USER AdminOperation = iota + 1
+	// CleanInactiveUser operation value
+	CleanInactiveUser AdminOperation = iota + 1
 
-	// CLEAN_REPO_ARCHIVES operation value
-	CLEAN_REPO_ARCHIVES
+	// CleanRepoArchives operation value
+	CleanRepoArchives
 
-	// CLEAN_MISSING_REPOS operation value
-	CLEAN_MISSING_REPOS
+	// CleanMissingRepos operation value
+	CleanMissingRepos
 
-	// GIT_GC_REPOS operation value
-	GIT_GC_REPOS
+	// GitGCRepos operation value
+	GitGCRepos
 
-	// SYNC_SSH_AUTHORIZED_KEY operation value
-	SYNC_SSH_AUTHORIZED_KEY
+	// SyncSSHAuthorizedKey operation value
+	SyncSSHAuthorizedKey
 
-	// SYNC_REPOSITORY_HOOKS operation value
-	SYNC_REPOSITORY_HOOKS
+	// SyncRepositoryHooks operation value
+	SyncRepositoryHooks
 
-	// REINIT_MISSING_REPOSITORY operation value
-	REINIT_MISSING_REPOSITORY
+	// ReinitMissingRepository operation value
+	ReinitMissingRepository
 )
 
 // Dashboard shows dashboard page
@@ -160,22 +160,22 @@ func Dashboard(c *context.Context) {
 		var success string
 
 		switch AdminOperation(op) {
-		case CLEAN_REPO_ARCHIVES:
+		case CleanRepoArchives:
 			success = "All repositories archives have been deleted successfully."
 			err = models.DeleteRepositoryArchives()
-		case CLEAN_MISSING_REPOS:
+		case CleanMissingRepos:
 			success = "All repository records that lost Git files have been deleted successfully."
 			err = models.DeleteMissingRepositories()
-		case GIT_GC_REPOS:
+		case GitGCRepos:
 			success = "All repositories have done garbage collection successfully."
 			err = models.GitGcRepos()
-		case SYNC_SSH_AUTHORIZED_KEY:
+		case SyncSSHAuthorizedKey:
 			success = "All public keys have been rewritten successfully."
 			err = models.RewriteAuthorizedKeys()
-		case SYNC_REPOSITORY_HOOKS:
+		case SyncRepositoryHooks:
 			success = "All repositories' pre-receive, update and post-receive hooks have been resynced successfully."
 			err = models.SyncRepositoryHooks()
-		case REINIT_MISSING_REPOSITORY:
+		case ReinitMissingRepository:
 			success = "All repository records that lost Git files have been reinitialized successfully."
 			err = models.ReinitMissingRepositories()
 		}

+ 2 - 2
routes/admin/news.go

@@ -28,14 +28,14 @@ func News(c *context.Context) {
 	c.HTML(200, NewsTPL)
 }
 
-// News shows news page
+// NewsNew shows new news page
 func NewsNew(c *context.Context) {
 	c.Data["Title"] = "News"
 	c.Data["PageIsAdminNews"] = true
 	c.HTML(200, NewsNewTPL)
 }
 
-// News shows news page
+// NewsEdit shows edit news page
 func NewsEdit(c *context.Context) {
 	c.Data["Title"] = "News"
 	c.Data["PageIsAdminNews"] = true