diff --git a/src/main/scala/gitbucket/core/controller/AccountController.scala b/src/main/scala/gitbucket/core/controller/AccountController.scala index 1ac1a0d..022acdd 100644 --- a/src/main/scala/gitbucket/core/controller/AccountController.scala +++ b/src/main/scala/gitbucket/core/controller/AccountController.scala @@ -13,7 +13,6 @@ import gitbucket.core.util.StringUtil._ import gitbucket.core.util._ import io.github.gitbucket.scalatra.forms._ -import org.apache.commons.io.FileUtils import org.scalatra.i18n.Messages import org.scalatra.BadRequest @@ -440,7 +439,7 @@ } get("/groups/new")(usersOnly { - html.group(None, List(GroupMember("", context.loginAccount.get.userName, true))) + html.creategroup(List(GroupMember("", context.loginAccount.get.userName, true))) }) post("/groups/new", newGroupForm)(usersOnly { form => @@ -456,7 +455,8 @@ get("/:groupName/_editgroup")(managersOnly { defining(params("groupName")){ groupName => - html.group(getAccountByUserName(groupName, true), getGroupMembers(groupName)) + // TODO Don't use Option.get + html.editgroup(getAccountByUserName(groupName, true).get, getGroupMembers(groupName)) } }) diff --git a/src/main/twirl/gitbucket/core/account/application.scala.html b/src/main/twirl/gitbucket/core/account/application.scala.html index 0bd5f99..62ab06b 100644 --- a/src/main/twirl/gitbucket/core/account/application.scala.html +++ b/src/main/twirl/gitbucket/core/account/application.scala.html @@ -2,7 +2,7 @@ personalTokens: List[gitbucket.core.model.AccessToken], gneratedToken: Option[(gitbucket.core.model.AccessToken, String)])(implicit context: gitbucket.core.controller.Context) @gitbucket.core.html.main("Applications"){ - @gitbucket.core.account.html.menu("application", context.settings.ssh){ + @gitbucket.core.account.html.menu("application", context.loginAccount.get.userName, false){
Personal access tokens
diff --git a/src/main/twirl/gitbucket/core/account/creategroup.scala.html b/src/main/twirl/gitbucket/core/account/creategroup.scala.html new file mode 100644 index 0000000..78058bb --- /dev/null +++ b/src/main/twirl/gitbucket/core/account/creategroup.scala.html @@ -0,0 +1,9 @@ +@(members: List[gitbucket.core.model.GroupMember])(implicit context: gitbucket.core.controller.Context) +@gitbucket.core.html.main("Create group"){ +
+
+

Create group

+ @gitbucket.core.account.html.groupform(None, members) +
+
+} diff --git a/src/main/twirl/gitbucket/core/account/edit.scala.html b/src/main/twirl/gitbucket/core/account/edit.scala.html index 9237745..76e429e 100644 --- a/src/main/twirl/gitbucket/core/account/edit.scala.html +++ b/src/main/twirl/gitbucket/core/account/edit.scala.html @@ -2,7 +2,7 @@ @import gitbucket.core.util.LDAPUtil @import gitbucket.core.view.helpers @gitbucket.core.html.main("Edit your profile"){ - @gitbucket.core.account.html.menu("profile", context.settings.ssh){ + @gitbucket.core.account.html.menu("profile", context.loginAccount.get.userName, false){ @gitbucket.core.helper.html.information(info) @gitbucket.core.helper.html.error(error) @if(LDAPUtil.isDummyMailAddress(account)){
Please register your mail address.
} diff --git a/src/main/twirl/gitbucket/core/account/editgroup.scala.html b/src/main/twirl/gitbucket/core/account/editgroup.scala.html new file mode 100644 index 0000000..0fbf3cf --- /dev/null +++ b/src/main/twirl/gitbucket/core/account/editgroup.scala.html @@ -0,0 +1,8 @@ +@(account: gitbucket.core.model.Account, + members: List[gitbucket.core.model.GroupMember])(implicit context: gitbucket.core.controller.Context) +@gitbucket.core.html.main("Edit group"){ + @gitbucket.core.account.html.menu("profile", account.userName, true){ +

Edit group

+ @gitbucket.core.account.html.groupform(Some(account), members) + } +} diff --git a/src/main/twirl/gitbucket/core/account/edithook.scala.html b/src/main/twirl/gitbucket/core/account/edithook.scala.html index 2b44ef1..8a7931a 100644 --- a/src/main/twirl/gitbucket/core/account/edithook.scala.html +++ b/src/main/twirl/gitbucket/core/account/edithook.scala.html @@ -4,7 +4,7 @@ create: Boolean)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @gitbucket.core.html.main("Service Hooks"){ - @gitbucket.core.account.html.menu("hooks", context.settings.ssh){ + @gitbucket.core.account.html.menu("hooks", account.userName, account.isGroupAccount){ @gitbucket.core.settings.html.edithookform( webHook, events, create, helpers.url(account.userName) + "/_hooks/new", diff --git a/src/main/twirl/gitbucket/core/account/group.scala.html b/src/main/twirl/gitbucket/core/account/group.scala.html deleted file mode 100644 index 725581f..0000000 --- a/src/main/twirl/gitbucket/core/account/group.scala.html +++ /dev/null @@ -1,145 +0,0 @@ -@(account: Option[gitbucket.core.model.Account], members: List[gitbucket.core.model.GroupMember])(implicit context: gitbucket.core.controller.Context) -@import gitbucket.core.view.helpers -@gitbucket.core.html.main(if(account.isEmpty) "Create group" else "Edit group"){ -
-
-

@{if(account.isEmpty) "Create group" else "Edit group"}

-
-
-
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
-
-
- - @gitbucket.core.helper.html.uploadavatar(account) -
-
-
-
- -
    -
- @gitbucket.core.helper.html.account("memberName", 200, true, false) - - -
- -
-
-
-
-
- @if(account.isDefined){ - - } - - @if(account.isDefined){ - Cancel - } -
-
-
-
-} - diff --git a/src/main/twirl/gitbucket/core/account/groupform.scala.html b/src/main/twirl/gitbucket/core/account/groupform.scala.html new file mode 100644 index 0000000..95ae9e2 --- /dev/null +++ b/src/main/twirl/gitbucket/core/account/groupform.scala.html @@ -0,0 +1,138 @@ +@(account: Option[gitbucket.core.model.Account], members: List[gitbucket.core.model.GroupMember])(implicit context: gitbucket.core.controller.Context) +@import gitbucket.core.view.helpers +
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ + @gitbucket.core.helper.html.uploadavatar(account) +
+
+
+
+ +
    +
+ @gitbucket.core.helper.html.account("memberName", 200, true, false) + + +
+ +
+
+
+
+
+ @if(account.isDefined){ + + } + + @if(account.isDefined){ + Cancel + } +
+
+ diff --git a/src/main/twirl/gitbucket/core/account/hooks.scala.html b/src/main/twirl/gitbucket/core/account/hooks.scala.html index 34bfdc4..1351c68 100644 --- a/src/main/twirl/gitbucket/core/account/hooks.scala.html +++ b/src/main/twirl/gitbucket/core/account/hooks.scala.html @@ -3,7 +3,7 @@ info: Option[Any])(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @gitbucket.core.html.main("Service Hooks"){ - @gitbucket.core.account.html.menu("hooks", context.settings.ssh){ + @gitbucket.core.account.html.menu("hooks", account.userName, account.isGroupAccount){ @gitbucket.core.helper.html.information(info)
diff --git a/src/main/twirl/gitbucket/core/account/menu.scala.html b/src/main/twirl/gitbucket/core/account/menu.scala.html index 4a4edcf..16e0341 100644 --- a/src/main/twirl/gitbucket/core/account/menu.scala.html +++ b/src/main/twirl/gitbucket/core/account/menu.scala.html @@ -1,42 +1,50 @@ -@(active: String, ssh: Boolean)(body: Html)(implicit context: gitbucket.core.controller.Context) +@(active: String, userName: String, group: Boolean)(body: Html)(implicit context: gitbucket.core.controller.Context)
diff --git a/src/main/twirl/gitbucket/core/account/ssh.scala.html b/src/main/twirl/gitbucket/core/account/ssh.scala.html index 344a70a..aece9ba 100644 --- a/src/main/twirl/gitbucket/core/account/ssh.scala.html +++ b/src/main/twirl/gitbucket/core/account/ssh.scala.html @@ -1,7 +1,7 @@ @(account: gitbucket.core.model.Account, sshKeys: List[gitbucket.core.model.SshKey])(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.ssh.SshUtil @gitbucket.core.html.main("SSH Keys"){ - @gitbucket.core.account.html.menu("ssh", context.settings.ssh){ + @gitbucket.core.account.html.menu("ssh", context.loginAccount.get.userName, false){
SSH Keys