summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/wicket')
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp.properties8
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp_es.properties6
-rwxr-xr-xsrc/com/gitblit/wicket/GitBlitWebApp_ja.properties6
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp_ko.properties8
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp_nl.properties8
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp_pl.properties6
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp_pt_BR.properties8
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.html2
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java26
-rw-r--r--src/com/gitblit/wicket/pages/RepositoryPage.java10
-rw-r--r--src/com/gitblit/wicket/pages/RootSubPage.java2
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.html2
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.java19
-rw-r--r--src/com/gitblit/wicket/panels/ProjectRepositoryPanel.html2
-rw-r--r--src/com/gitblit/wicket/panels/ProjectRepositoryPanel.java146
-rw-r--r--src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java4
-rw-r--r--src/com/gitblit/wicket/panels/RepositoriesPanel.html6
-rw-r--r--src/com/gitblit/wicket/panels/RepositoriesPanel.java78
18 files changed, 207 insertions, 140 deletions
diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties
index 16f76411..d601e1ef 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp.properties
@@ -1,5 +1,5 @@
gb.repository = repository
-gb.owner = owner
+gb.repoAdministrators = repository administrators
gb.description = description
gb.lastChange = last change
gb.refs = refs
@@ -94,7 +94,7 @@ gb.zip = zip
gb.showReadme = show readme
gb.showReadmeDescription = show a \"readme\" Markdown file on the summary page
gb.nameDescription = use '/' to group repositories. e.g. libraries/mycoollib.git
-gb.ownerDescription = the owner may edit repository settings
+gb.repoAdministratorsDescription = the repository administrators may edit repository settings
gb.blob = blob
gb.commitActivityTrend = commit activity trend
gb.commitActivityDOW = commit activity by day of week
@@ -279,7 +279,7 @@ gb.displayName = display name
gb.emailAddress = email address
gb.errorAdminLoginRequired = Administration requires a login
gb.errorOnlyAdminMayCreateRepository = Only an administrator may create a repository
-gb.errorOnlyAdminOrOwnerMayEditRepository = Only an administrator or the owner may edit a repository
+gb.errorOnlyAdminOrRepoAdminMayEditRepository = Only an administrator or a repository administrator may edit a repository
gb.errorAdministrationDisabled = Administration is disabled
gb.lastNDays = last {0} days
gb.completeGravatarProfile = Complete profile on Gravatar.com
@@ -364,7 +364,7 @@ gb.gcPeriod = GC period
gb.gcPeriodDescription = duration between garbage collections
gb.gcThreshold = GC threshold
gb.gcThresholdDescription = minimum total size of loose objects to trigger early garbage collection
-gb.ownerPermission = repository owner
+gb.repoAdministratorPermission = repository administrator
gb.administrator = admin
gb.administratorPermission = Gitblit administrator
gb.team = team
diff --git a/src/com/gitblit/wicket/GitBlitWebApp_es.properties b/src/com/gitblit/wicket/GitBlitWebApp_es.properties
index 64c9ca13..478a0ab6 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp_es.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_es.properties
@@ -1,5 +1,5 @@
gb.repository = Repositorio
-gb.owner = Propietario
+gb.repoAdministrators = Administradores del repositorio
gb.description = Descripci\u00F3n
gb.lastChange = Actualizado
gb.refs = Refs
@@ -94,7 +94,7 @@ gb.zip = Zip
gb.showReadme = Ver l\u00E9eme
gb.showReadmeDescription = Mostrar el archivo \"l\u00E9eme\" de Markdown en la p\u00E1gina resumen
gb.nameDescription = Usa '/' para agrupar repositorios. ej. librerias/mylibreria.git
-gb.ownerDescription = El propietario puede editar la configuraci\u00F3n del repositorio
+gb.repoAdministratorsDescription = Administradores del repositorio puede editar la configuraci\u00F3n del repositorio
gb.blob = Objeto
gb.commitActivityTrend = Tendencia de actividad del repositorio
gb.commitActivityDOW = Actividad de consignas por d\u00EDa de la semana
@@ -364,7 +364,7 @@ gb.gcPeriod = Periodo para GC
gb.gcPeriodDescription = Duraci\u00F3n entre periodos de limpieza
gb.gcThreshold = L\u00EDmites para GC
gb.gcThresholdDescription = Tama\u00F1o m\u00EDnimo total de objetos sueltos para activar la recolecci\u00F3n inmediata de basura
-gb.ownerPermission = Propietario del repositorio
+gb.repoAdministratorPermission = Administrador del repositorio
gb.administrator = Admin
gb.administratorPermission = Administrador de Gitblit
gb.team = Equipo
diff --git a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties
index 086df7b7..d4e35118 100755
--- a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties
@@ -1,5 +1,5 @@
gb.repository = \u30ea\u30dd\u30b8\u30c8\u30ea
-gb.owner = \u6240\u6709\u8005
+gb.repoAdministrators = \u30EA\u30DD\u30B8\u30C8\u30EA\u7BA1\u7406\u8005
gb.description = \u8aac\u660e
gb.lastChange = \u6700\u5f8c\u306e\u5909\u66f4
gb.refs = refs
@@ -94,7 +94,7 @@ gb.zip = zip
gb.showReadme = readme\u8868\u793a
gb.showReadmeDescription = \"readme\" Markdown\u30d5\u30a1\u30a4\u30eb\u3092\u6982\u8981\u30da\u30fc\u30b8\u306b\u8868\u793a\u3059\u308b
gb.nameDescription = \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u306b\u306f '/' \u3092\u4f7f\u3046\u3002 e.g. libraries/mycoollib.git
-gb.ownerDescription = \u6240\u6709\u8005\u306f\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3067\u304d\u308b
+gb.repoAdministratorsDescription = \u30EA\u30DD\u30B8\u30C8\u30EA\u7BA1\u7406\u8005\u306f\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3067\u304d\u308b
gb.blob = blob
gb.commitActivityTrend = commit activity trend
gb.commitActivityDOW = commit activity by day of week
@@ -279,7 +279,7 @@ gb.displayName = display name
gb.emailAddress = email address
gb.errorAdminLoginRequired = Administration requires a login
gb.errorOnlyAdminMayCreateRepository = Only an administrator may create a repository
-gb.errorOnlyAdminOrOwnerMayEditRepository = Only an administrator or the owner may edit a repository
+gb.errorOnlyAdminOrRepoAdminMayEditRepository = Only an administrator or a repository administrator may edit a repository
gb.errorAdministrationDisabled = Administration is disabled
gb.lastNDays = last {0} days
gb.completeGravatarProfile = Complete profile on Gravatar.com
diff --git a/src/com/gitblit/wicket/GitBlitWebApp_ko.properties b/src/com/gitblit/wicket/GitBlitWebApp_ko.properties
index 18eda26c..bff593da 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp_ko.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_ko.properties
@@ -1,5 +1,5 @@
gb.repository = \uC800\uC7A5\uC18C
-gb.owner = \uC18C\uC720\uC790
+gb.repoAdministrators = \uC800\uC7A5\uC18C \uAD00\uB9AC\uC790
gb.description = \uC124\uBA85
gb.lastChange = \uCD5C\uADFC \uBCC0\uACBD
gb.refs = refs
@@ -94,7 +94,7 @@ gb.zip = zip
gb.showReadme = \uB9AC\uB4DC\uBBF8(readme) \uBCF4\uAE30
gb.showReadmeDescription = \uC694\uC57D\uD398\uC774\uC9C0\uC5D0\uC11C \"readme\" \uB9C8\uD06C\uB2E4\uC6B4 \uD30C\uC77C \uBCF4\uAE30
gb.nameDescription = \uC800\uC7A5\uC18C\uB97C \uADF8\uB8F9\uC73C\uB85C \uBB36\uC73C\uB824\uBA74 '/' \uB97C \uC0AC\uC6A9. \uC608) libraries/reponame.git
-gb.ownerDescription = \uC18C\uC720\uC790\uB294 \uC800\uC7A5\uC18C \uC124\uC815\uC744 \uBCC0\uACBD\uD560 \uC218 \uC788\uC74C
+gb.repoAdministratorsDescription = \uC800\uC7A5\uC18C \uAD00\uB9AC\uC790 \uC800\uC7A5\uC18C \uC124\uC815\uC744 \uBCC0\uACBD\uD560 \uC218 \uC788\uC74C
gb.blob = blob
gb.commitActivityTrend = \uCEE4\uBC0B \uD65C\uB3D9 \uD2B8\uB79C\uB4DC
gb.commitActivityDOW = 1\uC8FC\uC77C\uC758 \uC77C\uB2E8\uC704 \uCEE4\uBC0B \uD65C\uB3D9
@@ -279,7 +279,7 @@ gb.displayName = \uD45C\uC2DC\uB418\uB294 \uC774\uB984
gb.emailAddress = \uC774\uBA54\uC77C \uC8FC\uC18C
gb.errorAdminLoginRequired = \uAD00\uB9AC\uB97C \uC704\uD574\uC11C\uB294 \uB85C\uADF8\uC778\uC774 \uD544\uC694
gb.errorOnlyAdminMayCreateRepository = \uAD00\uB9AC\uC790\uB9CC \uC800\uC7A5\uC18C\uB97C \uB9CC\uB4E4\uC218 \uC788\uC74C
-gb.errorOnlyAdminOrOwnerMayEditRepository = \uAD00\uB9AC\uC790\uC640 \uC18C\uC720\uC790\uB9CC \uC800\uC7A5\uC18C\uB97C \uC218\uC815\uD560 \uC218 \uC788\uC74C
+gb.errorOnlyAdminOrRepoAdminMayEditRepository = \uAD00\uB9AC\uC790\uC640 \uC800\uC7A5\uC18C \uAD00\uB9AC\uC790\uB9CC \uC800\uC7A5\uC18C\uB97C \uC218\uC815\uD560 \uC218 \uC788\uC74C
gb.errorAdministrationDisabled = \uAD00\uB9AC\uAE30\uB2A5 \uBE44\uD65C\uC131\uD654\uB428
gb.lastNDays = {0} \uC77C\uC804
gb.completeGravatarProfile = Gravatar.com \uC5D0 \uD504\uB85C\uD30C\uC77C \uC0DD\uC131\uB428
@@ -364,7 +364,7 @@ gb.gcPeriod = GC \uC8FC\uAE30
gb.gcPeriodDescription = \uAC00\uBE44\uC9C0 \uD074\uB809\uC158\uAC04\uC758 \uC2DC\uAC04 \uAC04\uACA9
gb.gcThreshold = GC \uAE30\uC900\uC810
gb.gcThresholdDescription = \uC870\uAE30 \uAC00\uBE44\uC9C0 \uCEEC\uB809\uC158\uC744 \uBC1C\uC0DD\uC2DC\uD0A4\uAE30 \uC704\uD55C \uC624\uBE0C\uC81D\uD2B8\uB4E4\uC758 \uCD5C\uC18C \uC804\uCCB4 \uD06C\uAE30
-gb.ownerPermission = \uC800\uC7A5\uC18C \uC624\uB108
+gb.repoAdministratorPermission = \uC800\uC7A5\uC18C \uAD00\uB9AC\uC790
gb.administrator = \uAD00\uB9AC\uC790
gb.administratorPermission = Gitblit \uAD00\uB9AC\uC790
gb.team = \uD300
diff --git a/src/com/gitblit/wicket/GitBlitWebApp_nl.properties b/src/com/gitblit/wicket/GitBlitWebApp_nl.properties
index 5471ad8a..75a0ac61 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp_nl.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_nl.properties
@@ -1,5 +1,5 @@
gb.repository = repositorie
-gb.owner = eigenaar
+gb.repoAdministrators = repository beheerders
gb.description = omschrijving
gb.lastChange = laatste wijziging
gb.refs = refs
@@ -94,7 +94,7 @@ gb.zip = zip
gb.showReadme = toon readme
gb.showReadmeDescription = toon een \"readme\" Markdown bestand in de samenvattingspagina
gb.nameDescription = gebruik '/' voor het groeperen van repositories. bijv. libraries/mycoollib.git
-gb.ownerDescription = de eigenaar mag repository instellingen wijzigen
+gb.repoAdministratorsDescription = repository beheerders mag repository instellingen wijzigen
gb.blob = blob
gb.commitActivityTrend = commit activiteit trend
gb.commitActivityDOW = commit activiteit per dag van de week
@@ -279,7 +279,7 @@ gb.displayName = display naam
gb.emailAddress = emailadres
gb.errorAdminLoginRequired = Aanmelden vereist voor beheerwerk
gb.errorOnlyAdminMayCreateRepository = Alleen een beheerder kan een repositorie maken
-gb.errorOnlyAdminOrOwnerMayEditRepository = Alleen een beheerder of de eigenaar kan een repositorie wijzigen
+gb.errorOnlyAdminOrOwnerMayEditRepository = Alleen een beheerder of een repository beheerder kan een repositorie wijzigen
gb.errorAdministrationDisabled = Beheer is uitgeschakeld
gb.lastNDays = laatste {0} dagen
gb.completeGravatarProfile = Completeer profiel op Gravatar.com
@@ -364,7 +364,7 @@ gb.gcPeriod = opruim periode
gb.gcPeriodDescription = tijdsduur tussen opruimacties
gb.gcThreshold = opruim drempel
gb.gcThresholdDescription = minimum totaalomvang van losse objecten voor het starten van opruimactie
-gb.ownerPermission = repositorie eigenaar
+gb.repoAdministratorPermission = repository beheerder
gb.administrator = beheer
gb.administratorPermission = Gitblit beheerder
gb.team = team
diff --git a/src/com/gitblit/wicket/GitBlitWebApp_pl.properties b/src/com/gitblit/wicket/GitBlitWebApp_pl.properties
index 82ffa635..4760981a 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp_pl.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_pl.properties
@@ -1,5 +1,5 @@
gb.repository = Repozytorium
-gb.owner = W\u0142a\u015Bciciel
+gb.repoAdministrators = Administratorzy repozytorium
gb.description = Opis
gb.lastChange = Ostatnia zmiana
gb.refs = Refs
@@ -94,7 +94,7 @@ gb.zip = zip
gb.showReadme = Poka\u017C readme
gb.showReadmeDescription = Poka\u017C sparsowany \"readme\" na stronie podsumowania
gb.nameDescription = u\u017Cyj '/' do grupowania repozytori\u00F3w, np. libraries/server-lib.git
-gb.ownerDescription = W\u0142a\u015Bciciel mo\u017Ce edytowa\u0107 ustawienia repozytorium
+gb.repoAdministratorsDescription = Administrator repozytorium mo\u017Ce edytowa\u0107 ustawienia repozytorium
gb.blob = blob
gb.commitActivityTrend = Aktywno\u015B\u0107 zmian
gb.commitActivityDOW = Aktywno\u015B\u0107 zmian wed\u0142ug dnia tygodnia
@@ -279,7 +279,7 @@ gb.displayName = Wy\u015Bwietlana nazwa
gb.emailAddress = Adres email
gb.errorAdminLoginRequired = Administracja wymaga zalogowania
gb.errorOnlyAdminMayCreateRepository = Tylko administrator mo\u017Ce utworzy\u0107 repozytorium
-gb.errorOnlyAdminOrOwnerMayEditRepository = Tylko administrator lub w\u0142a\u015Bciciel mo\u017Ce edytowa\u0107 repozytorium.
+gb.errorOnlyAdminOrRepoAdminMayEditRepository = Tylko administrator lub administrator repozytorium mo\u017Ce edytowa\u0107 repozytorium.
gb.errorAdministrationDisabled = Administracja jest wy\u0142\u0105czona
gb.lastNDays = Ostatnich {0} dni
gb.completeGravatarProfile = Pe\u0142ny profil na Gravatar.com
diff --git a/src/com/gitblit/wicket/GitBlitWebApp_pt_BR.properties b/src/com/gitblit/wicket/GitBlitWebApp_pt_BR.properties
index 469d2055..0bbd119c 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp_pt_BR.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_pt_BR.properties
@@ -1,5 +1,5 @@
gb.repository = repositório
-gb.owner = proprietário
+gb.repoAdministrators = administradores do repositório
gb.description = descrição
gb.lastChange = última alteração
gb.refs = refs
@@ -94,7 +94,7 @@ gb.zip = zip
gb.showReadme = mostrar readme
gb.showReadmeDescription = mostrar um arquivo \"leia-me\" na página de resumo
gb.nameDescription = usar '/' para agrupar repositórios. e.g. libraries/mycoollib.git
-gb.ownerDescription = o proprietário pode editar configurações do repositório
+gb.repoAdministratorsDescription = o administradores do repositório pode editar configurações do repositório
gb.blob = blob
gb.commitActivityTrend = tendência dos commits
gb.commitActivityDOW = commits diários
@@ -279,7 +279,7 @@ gb.displayName = nome
gb.emailAddress = e-mail
gb.errorAdminLoginRequired = Administração requer um login
gb.errorOnlyAdminMayCreateRepository = Somente umadministrador pode criar um repositório
-gb.errorOnlyAdminOrOwnerMayEditRepository = Somente umadministrador pode editar um repositório
+gb.errorOnlyAdminOrRepoAdminMayEditRepository = Somente umadministrador ou um administrador de repositório pode editar um repositório
gb.errorAdministrationDisabled = Administração está desabilitada
gb.lastNDays = últimos {0} dias
gb.completeGravatarProfile = Profile completo em Gravatar.com
@@ -364,7 +364,7 @@ gb.gcPeriod = período do GC
gb.gcPeriodDescription = duração entre as coletas de lixo
gb.gcThreshold = limite do GC
gb.gcThresholdDescription = tamanho total mínimo de objetos \"soltos\" que ativam a coleta de lixo
-gb.ownerPermission = proprietário do repositório
+gb.repoAdministratorPermission = administrador do repositório
gb.administrator = administrador
gb.administratorPermission = administrador do Gitblit
gb.team = equipe
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
index 60893f44..be9616c0 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.html
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
@@ -50,7 +50,7 @@
<div class="tab-pane" id="permissions">
<table class="plain">
<tbody class="settings">
- <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select class="span2" wicket:id="owner" tabindex="15" /> &nbsp;<span class="help-inline"><wicket:message key="gb.ownerDescription"></wicket:message></span></td></tr>
+ <tr><th><wicket:message key="gb.repoAdministrators"></wicket:message></th><td class="edit"><span wicket:id="repoAdministrators" tabindex="15" /> &nbsp;<span class="help-inline"><wicket:message key="gb.repoAdministratorsDescription"></wicket:message></span></td></tr>
<tr><th colspan="2"><hr/></th></tr>
<tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span4" wicket:id="accessRestriction" tabindex="16" /></td></tr>
<tr><th colspan="2"><hr/></th></tr>
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
index a071b69e..9a81bde4 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -61,6 +61,7 @@ import com.gitblit.models.RegistrantAccessPermission;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.utils.ArrayUtils;
+import com.gitblit.utils.MultiConfigUtil;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.StringChoiceRenderer;
@@ -70,6 +71,8 @@ import com.gitblit.wicket.panels.RegistrantPermissionsPanel;
public class EditRepositoryPage extends RootSubPage {
+ private MultiConfigUtil multiConfigUtil = new MultiConfigUtil();
+
private final boolean isCreate;
private boolean isAdmin;
@@ -94,7 +97,7 @@ public class EditRepositoryPage extends RootSubPage {
// personal create permissions, inject personal repository path
model.name = user.getPersonalPath() + "/";
model.projectPath = user.getPersonalPath();
- model.owner = user.username;
+ model.addRepoAdministrator(user.username);
// personal repositories are private by default
model.accessRestriction = AccessRestrictionType.VIEW;
model.authorizationControl = AuthorizationControl.NAMED;
@@ -164,6 +167,12 @@ public class EditRepositoryPage extends RootSubPage {
final RegistrantPermissionsPanel teamsPalette = new RegistrantPermissionsPanel("teams",
RegistrantType.TEAM, GitBlit.self().getAllTeamnames(), repositoryTeams, getAccessPermissions());
+ // repo administrators palette
+ List admins = multiConfigUtil.convertCollectionToList(repositoryModel.getRepoAdministrators());
+ List persons = GitBlit.self().getAllUsernames();
+ final Palette repoAdministratorsPalette = new Palette("repoAdministrators", new ListModel<String>(admins), new CollectionModel<String>(
+ persons), new StringChoiceRenderer(), 10, true);
+
// indexed local branches palette
List<String> allLocalBranches = new ArrayList<String>();
allLocalBranches.add(Constants.DEFAULT_BRANCH);
@@ -326,6 +335,12 @@ public class EditRepositoryPage extends RootSubPage {
}
repositoryModel.indexedBranches = indexedBranches;
+ repositoryModel.removeAllRepoAdministrators();
+ Iterator<String> repoAdmins = repoAdministratorsPalette.getSelectedChoices();
+ while (repoAdmins.hasNext()) {
+ repositoryModel.addRepoAdministrator(repoAdmins.next());
+ }
+
// pre-receive scripts
List<String> preReceiveScripts = new ArrayList<String>();
Iterator<String> pres = preReceivePalette.getSelectedChoices();
@@ -377,8 +392,7 @@ public class EditRepositoryPage extends RootSubPage {
// field names reflective match RepositoryModel fields
form.add(new TextField<String>("name").setEnabled(allowEditName));
form.add(new TextField<String>("description"));
- form.add(new DropDownChoice<String>("owner", GitBlit.self().getAllUsernames())
- .setEnabled(GitBlitWebSession.get().canAdmin() && !repositoryModel.isPersonalRepository()));
+ form.add(repoAdministratorsPalette);
form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true)));
DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction", Arrays
.asList(AccessRestrictionType.values()), new AccessRestrictionRenderer());
@@ -559,9 +573,9 @@ public class EditRepositoryPage extends RootSubPage {
isAdmin = true;
return;
} else {
- if (!model.owner.equalsIgnoreCase(user.username)) {
- // User is not an Admin nor Owner
- error(getString("gb.errorOnlyAdminOrOwnerMayEditRepository"), true);
+ if (!model.isRepoAdministrator(user.username)) {
+ // User is not an Admin nor RepoAdministrator
+ error(getString("gb.errorOnlyAdminOrRepoAdminMayEditRepository"), true);
}
}
}
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java
index aac527d7..b67aaa6d 100644
--- a/src/com/gitblit/wicket/pages/RepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoryPage.java
@@ -79,7 +79,7 @@ public abstract class RepositoryPage extends BasePage {
private final Map<String, PageRegistration> registeredPages;
private boolean showAdmin;
- private boolean isOwner;
+ private boolean isRepoAdministrator;
public RepositoryPage(PageParameters params) {
super(params);
@@ -183,10 +183,10 @@ public abstract class RepositoryPage extends BasePage {
} else {
showAdmin = GitBlit.getBoolean(Keys.web.allowAdministration, false);
}
- isOwner = GitBlitWebSession.get().isLoggedIn()
- && (model.owner != null && model.owner.equalsIgnoreCase(GitBlitWebSession.get()
+ isRepoAdministrator = GitBlitWebSession.get().isLoggedIn()
+ && (model.isRepoAdministrator(GitBlitWebSession.get()
.getUsername()));
- if (showAdmin || isOwner) {
+ if (showAdmin || isRepoAdministrator) {
pages.put("edit", new PageRegistration("gb.edit", EditRepositoryPage.class, params));
}
return pages;
@@ -540,7 +540,7 @@ public abstract class RepositoryPage extends BasePage {
}
public boolean isOwner() {
- return isOwner;
+ return isRepoAdministrator;
}
private class SearchForm extends SessionlessForm<Void> implements Serializable {
diff --git a/src/com/gitblit/wicket/pages/RootSubPage.java b/src/com/gitblit/wicket/pages/RootSubPage.java
index e7e12ccc..ed1bdfbf 100644
--- a/src/com/gitblit/wicket/pages/RootSubPage.java
+++ b/src/com/gitblit/wicket/pages/RootSubPage.java
@@ -88,7 +88,7 @@ public abstract class RootSubPage extends RootPage {
if (repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE)
&& repositoryModel.authorizationControl.equals(AuthorizationControl.NAMED)) {
if (user != null &&
- (repositoryModel.isOwner(user.username) || repositoryModel.isUsersPersonalRepository(user.username))) {
+ (repositoryModel.isRepoAdministrator(user.username) || repositoryModel.isUsersPersonalRepository(user.username))) {
// exclude Owner or personal repositories
continue;
}
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html
index 45ffddfb..788dbb57 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.html
+++ b/src/com/gitblit/wicket/pages/SummaryPage.html
@@ -16,7 +16,7 @@
<div class="hidden-phone" style="padding-bottom: 10px;">
<table class="plain">
<tr><th><wicket:message key="gb.description">[description]</wicket:message></th><td><span wicket:id="repositoryDescription">[repository description]</span></td></tr>
- <tr><th><wicket:message key="gb.owner">[owner]</wicket:message></th><td><span wicket:id="repositoryOwner">[repository owner]</span></td></tr>
+ <tr><th><wicket:message key="gb.repoAdministrators">[owner]</wicket:message></th><td><span wicket:id="repositoryAdministrators">[repository owner]</span></td></tr>
<tr><th><wicket:message key="gb.lastChange">[last change]</wicket:message></th><td><span wicket:id="repositoryLastChange">[repository last change]</span></td></tr>
<tr><th><wicket:message key="gb.stats">[stats]</wicket:message></th><td><span wicket:id="branchStats">[branch stats]</span> <span class="link"><a wicket:id="metrics"><wicket:message key="gb.metrics">[metrics]</wicket:message></a></span></td></tr>
<tr><th style="vertical-align:top;"><wicket:message key="gb.repositoryUrl">[URL]</wicket:message>&nbsp;<img style="vertical-align: top;padding-left:3px;" wicket:id="accessRestrictionIcon" /></th><td><span wicket:id="repositoryCloneUrl">[repository clone url]</span><div wicket:id="otherUrls"></div></td></tr>
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index 8df2cebc..3b2c92a1 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -49,6 +49,7 @@ import com.gitblit.models.UserModel;
import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.MarkdownUtils;
+import com.gitblit.utils.MultiConfigUtil;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.BranchesPanel;
@@ -59,6 +60,8 @@ import com.gitblit.wicket.panels.TagsPanel;
public class SummaryPage extends RepositoryPage {
+ private MultiConfigUtil multiConfigUtil = new MultiConfigUtil();
+
public SummaryPage(PageParameters params) {
super(params);
@@ -82,16 +85,12 @@ public class SummaryPage extends RepositoryPage {
// repository description
add(new Label("repositoryDescription", getRepositoryModel().description));
- String owner = getRepositoryModel().owner;
- if (StringUtils.isEmpty(owner)) {
- add(new Label("repositoryOwner").setVisible(false));
- } else {
- UserModel ownerModel = GitBlit.self().getUserModel(owner);
- if (ownerModel != null) {
- add(new LinkPanel("repositoryOwner", null, ownerModel.getDisplayName(), UserPage.class, WicketUtils.newUsernameParameter(owner)));
- } else {
- add(new Label("repositoryOwner", owner));
- }
+ String repoAdministrators = multiConfigUtil.convertCollectionToSingleLineString(getRepositoryModel().getRepoAdministrators());
+ if (StringUtils.isEmpty(repoAdministrators)) {
+ add(new Label("repositoryAdministrators").setVisible(false));
+ } else {
+ //TODO reimplement link panel for each username
+ add(new Label("repositoryAdministrators", repoAdministrators));
}
add(WicketUtils.createTimestampLabel("repositoryLastChange",
diff --git a/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.html b/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.html
index 46781536..e953235c 100644
--- a/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.html
+++ b/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.html
@@ -51,7 +51,7 @@
<img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>
</a>
</div>
- <span style="color: #999;font-style:italic;font-size:0.8em;" wicket:id="repositoryOwner">[owner]</span>
+ <span style="color: #999;font-style:italic;font-size:0.8em;" wicket:id="repositoryAdministrators">[owner]</span>
</div>
<div class="pageTitle" style="border:0px;">
diff --git a/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.java b/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
index 50f0d52d..d4f2a3a8 100644
--- a/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
+++ b/src/com/gitblit/wicket/panels/ProjectRepositoryPanel.java
@@ -36,6 +36,7 @@ import com.gitblit.SyndicationServlet;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.utils.ArrayUtils;
+import com.gitblit.utils.MultiConfigUtil;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
@@ -51,86 +52,104 @@ public class ProjectRepositoryPanel extends BasePanel {
private static final long serialVersionUID = 1L;
- public ProjectRepositoryPanel(String wicketId, Localizer localizer, Component parent,
- final boolean isAdmin, final RepositoryModel entry,
+ private MultiConfigUtil multiConfigUtil = new MultiConfigUtil();
+
+ public ProjectRepositoryPanel(String wicketId, Localizer localizer,
+ Component parent, final boolean isAdmin,
+ final RepositoryModel entry,
final Map<AccessRestrictionType, String> accessRestrictions) {
super(wicketId);
- final boolean showSwatch = GitBlit.getBoolean(Keys.web.repositoryListSwatches, true);
- final boolean gitServlet = GitBlit.getBoolean(Keys.git.enableGitServlet, true);
- final boolean showSize = GitBlit.getBoolean(Keys.web.showRepositorySizes, true);
+ final boolean showSwatch = GitBlit.getBoolean(
+ Keys.web.repositoryListSwatches, true);
+ final boolean gitServlet = GitBlit.getBoolean(
+ Keys.git.enableGitServlet, true);
+ final boolean showSize = GitBlit.getBoolean(
+ Keys.web.showRepositorySizes, true);
// repository swatch
Component swatch;
if (entry.isBare) {
- swatch = new Label("repositorySwatch", "&nbsp;").setEscapeModelStrings(false);
+ swatch = new Label("repositorySwatch", "&nbsp;")
+ .setEscapeModelStrings(false);
} else {
swatch = new Label("repositorySwatch", "!");
- WicketUtils.setHtmlTooltip(swatch, localizer.getString("gb.workingCopyWarning", parent));
+ WicketUtils.setHtmlTooltip(swatch,
+ localizer.getString("gb.workingCopyWarning", parent));
}
WicketUtils.setCssBackground(swatch, entry.toString());
add(swatch);
swatch.setVisible(showSwatch);
PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);
- add(new LinkPanel("repositoryName", "list", StringUtils.getRelativePath(entry.projectPath,
- StringUtils.stripDotGit(entry.name)), SummaryPage.class, pp));
- add(new Label("repositoryDescription", entry.description).setVisible(!StringUtils
- .isEmpty(entry.description)));
+ add(new LinkPanel("repositoryName", "list",
+ StringUtils.getRelativePath(entry.projectPath,
+ StringUtils.stripDotGit(entry.name)),
+ SummaryPage.class, pp));
+ add(new Label("repositoryDescription", entry.description)
+ .setVisible(!StringUtils.isEmpty(entry.description)));
if (StringUtils.isEmpty(entry.originRepository)) {
add(new Label("originRepository").setVisible(false));
} else {
- Fragment forkFrag = new Fragment("originRepository", "originFragment", this);
- forkFrag.add(new LinkPanel("originRepository", null, StringUtils.stripDotGit(entry.originRepository),
- SummaryPage.class, WicketUtils.newRepositoryParameter(entry.originRepository)));
+ Fragment forkFrag = new Fragment("originRepository",
+ "originFragment", this);
+ forkFrag.add(new LinkPanel("originRepository", null, StringUtils
+ .stripDotGit(entry.originRepository), SummaryPage.class,
+ WicketUtils.newRepositoryParameter(entry.originRepository)));
add(forkFrag);
}
- add(new BookmarkablePageLink<Void>("tickets", TicketsPage.class, pp).setVisible(entry.useTickets));
- add(new BookmarkablePageLink<Void>("docs", DocsPage.class, pp).setVisible(entry.useDocs));
+ add(new BookmarkablePageLink<Void>("tickets", TicketsPage.class, pp)
+ .setVisible(entry.useTickets));
+ add(new BookmarkablePageLink<Void>("docs", DocsPage.class, pp)
+ .setVisible(entry.useDocs));
if (entry.isFrozen) {
- add(WicketUtils.newImage("frozenIcon", "cold_16x16.png", localizer.getString("gb.isFrozen", parent)));
+ add(WicketUtils.newImage("frozenIcon", "cold_16x16.png",
+ localizer.getString("gb.isFrozen", parent)));
} else {
add(WicketUtils.newClearPixel("frozenIcon").setVisible(false));
}
if (entry.isFederated) {
- add(WicketUtils.newImage("federatedIcon", "federated_16x16.png", localizer.getString("gb.isFederated", parent)));
+ add(WicketUtils.newImage("federatedIcon", "federated_16x16.png",
+ localizer.getString("gb.isFederated", parent)));
} else {
add(WicketUtils.newClearPixel("federatedIcon").setVisible(false));
}
switch (entry.accessRestriction) {
case NONE:
- add(WicketUtils.newBlankImage("accessRestrictionIcon").setVisible(false));
+ add(WicketUtils.newBlankImage("accessRestrictionIcon").setVisible(
+ false));
break;
case PUSH:
- add(WicketUtils.newImage("accessRestrictionIcon", "lock_go_16x16.png",
+ add(WicketUtils.newImage("accessRestrictionIcon",
+ "lock_go_16x16.png",
accessRestrictions.get(entry.accessRestriction)));
break;
case CLONE:
- add(WicketUtils.newImage("accessRestrictionIcon", "lock_pull_16x16.png",
+ add(WicketUtils.newImage("accessRestrictionIcon",
+ "lock_pull_16x16.png",
accessRestrictions.get(entry.accessRestriction)));
break;
case VIEW:
- add(WicketUtils.newImage("accessRestrictionIcon", "shield_16x16.png",
+ add(WicketUtils.newImage("accessRestrictionIcon",
+ "shield_16x16.png",
accessRestrictions.get(entry.accessRestriction)));
break;
default:
add(WicketUtils.newBlankImage("accessRestrictionIcon"));
}
- if (StringUtils.isEmpty(entry.owner)) {
- add(new Label("repositoryOwner").setVisible(false));
+ if (entry.getRepoAdministrators().size() < 1) {
+ add(new Label("repositoryAdministrators").setVisible(false));
} else {
- UserModel ownerModel = GitBlit.self().getUserModel(entry.owner);
- String owner = entry.owner;
- if (ownerModel != null) {
- owner = ownerModel.getDisplayName();
- }
- add(new Label("repositoryOwner", owner + " (" +
- localizer.getString("gb.owner", parent) + ")"));
+ add(new Label("repositoryAdministrators",
+ multiConfigUtil.convertCollectionToSingleLineString(entry
+ .getRepoAdministrators())
+ + " ("
+ + localizer.getString("gb.repoAdministrators", parent) + ")"));
}
UserModel user = GitBlitWebSession.get().getUser();
@@ -138,15 +157,19 @@ public class ProjectRepositoryPanel extends BasePanel {
user = UserModel.ANONYMOUS;
}
Fragment repositoryLinks;
- boolean showOwner = entry.isOwner(user.username);
+ boolean isRepoAdministrator = entry.isRepoAdministrator(user.username);
// owner of personal repository gets admin powers
- boolean showAdmin = isAdmin || entry.isUsersPersonalRepository(user.username);
-
- if (showAdmin || showOwner) {
- repositoryLinks = new Fragment("repositoryLinks", showAdmin ? "repositoryAdminLinks"
- : "repositoryOwnerLinks", this);
- repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class,
- WicketUtils.newRepositoryParameter(entry.name)));
+ boolean showAdmin = isAdmin
+ || entry.isUsersPersonalRepository(user.username);
+
+ if (showAdmin || isRepoAdministrator) {
+ repositoryLinks = new Fragment(
+ "repositoryLinks",
+ showAdmin ? "repositoryAdminLinks" : "repositoryOwnerLinks",
+ this);
+ repositoryLinks.add(new BookmarkablePageLink<Void>(
+ "editRepository", EditRepositoryPage.class, WicketUtils
+ .newRepositoryParameter(entry.name)));
if (showAdmin) {
Link<Void> deleteLink = new Link<Void>("deleteRepository") {
@@ -157,28 +180,41 @@ public class ProjectRepositoryPanel extends BasePanel {
if (GitBlit.self().deleteRepositoryModel(entry)) {
// redirect to the owning page
if (entry.isPersonalRepository()) {
- setResponsePage(getPage().getClass(), WicketUtils.newUsernameParameter(entry.projectPath.substring(1)));
+ setResponsePage(
+ getPage().getClass(),
+ WicketUtils
+ .newUsernameParameter(entry.projectPath
+ .substring(1)));
} else {
- setResponsePage(getPage().getClass(), WicketUtils.newProjectParameter(entry.projectPath));
+ setResponsePage(
+ getPage().getClass(),
+ WicketUtils
+ .newProjectParameter(entry.projectPath));
}
} else {
- error(MessageFormat.format(getString("gb.repositoryDeleteFailed"), entry));
+ error(MessageFormat.format(
+ getString("gb.repositoryDeleteFailed"),
+ entry));
}
}
};
- deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
- localizer.getString("gb.deleteRepository", parent), entry)));
+ deleteLink.add(new JavascriptEventConfirmation("onclick",
+ MessageFormat.format(localizer.getString(
+ "gb.deleteRepository", parent), entry)));
repositoryLinks.add(deleteLink);
}
} else {
- repositoryLinks = new Fragment("repositoryLinks", "repositoryUserLinks", this);
+ repositoryLinks = new Fragment("repositoryLinks",
+ "repositoryUserLinks", this);
}
- repositoryLinks.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils
- .newRepositoryParameter(entry.name)).setEnabled(entry.hasCommits));
+ repositoryLinks.add(new BookmarkablePageLink<Void>("tree",
+ TreePage.class, WicketUtils.newRepositoryParameter(entry.name))
+ .setEnabled(entry.hasCommits));
- repositoryLinks.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils
- .newRepositoryParameter(entry.name)).setEnabled(entry.hasCommits));
+ repositoryLinks.add(new BookmarkablePageLink<Void>("log",
+ LogPage.class, WicketUtils.newRepositoryParameter(entry.name))
+ .setEnabled(entry.hasCommits));
add(repositoryLinks);
@@ -190,17 +226,20 @@ public class ProjectRepositoryPanel extends BasePanel {
}
Label lastChangeLabel = new Label("repositoryLastChange", lastChange);
add(lastChangeLabel);
- WicketUtils.setCssClass(lastChangeLabel, getTimeUtils().timeAgoCss(entry.lastChange));
+ WicketUtils.setCssClass(lastChangeLabel,
+ getTimeUtils().timeAgoCss(entry.lastChange));
if (entry.hasCommits) {
// Existing repository
add(new Label("repositorySize", entry.size).setVisible(showSize));
} else {
// New repository
- add(new Label("repositorySize", localizer.getString("gb.empty", parent)).setEscapeModelStrings(false));
+ add(new Label("repositorySize", localizer.getString("gb.empty",
+ parent)).setEscapeModelStrings(false));
}
- add(new ExternalLink("syndication", SyndicationServlet.asLink("", entry.name, null, 0)));
+ add(new ExternalLink("syndication", SyndicationServlet.asLink("",
+ entry.name, null, 0)));
List<String> repositoryUrls = new ArrayList<String>();
if (gitServlet) {
@@ -209,7 +248,8 @@ public class ProjectRepositoryPanel extends BasePanel {
}
repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(entry.name));
- String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? "" : repositoryUrls.remove(0);
+ String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? ""
+ : repositoryUrls.remove(0);
add(new RepositoryUrlPanel("repositoryCloneUrl", primaryUrl));
}
}
diff --git a/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java b/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
index 4156cd19..b3efdd80 100644
--- a/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
+++ b/src/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
@@ -162,8 +162,8 @@ public class RegistrantPermissionsPanel extends BasePanel {
item.add(administrator);
break;
case OWNER:
- Label owner = new Label("pType", getString("gb.owner"));
- WicketUtils.setHtmlTooltip(owner, getString("gb.ownerPermission"));
+ Label owner = new Label("pType", getString("gb.repoAdministrators"));
+ WicketUtils.setHtmlTooltip(owner, getString("gb.repoAdministratorPermission"));
WicketUtils.setCssClass(owner, "label label-info");
item.add(owner);
break;
diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.html b/src/com/gitblit/wicket/panels/RepositoriesPanel.html
index 42f9f1f2..98ff4308 100644
--- a/src/com/gitblit/wicket/panels/RepositoriesPanel.html
+++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.html
@@ -57,7 +57,7 @@
<wicket:message key="gb.repository">Repository</wicket:message>
</th>
<th class="hidden-phone" wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>
- <th class="hidden-tablet hidden-phone" wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>
+ <th class="hidden-tablet hidden-phone" wicket:id="orderByOwner"><wicket:message key="gb.repoAdministrators">Owner</wicket:message></th>
<th class="hidden-phone"></th>
<th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>
<th class="hidden-phone"></th>
@@ -72,7 +72,7 @@
<wicket:message key="gb.repository">Repository</wicket:message>
</th>
<th class="hidden-phone" ><span><wicket:message key="gb.description">Description</wicket:message></span></th>
- <th class="hidden-tablet hidden-phone"><span><wicket:message key="gb.owner">Owner</wicket:message></span></th>
+ <th class="hidden-tablet hidden-phone"><span><wicket:message key="gb.repoAdministrators">Owner</wicket:message></span></th>
<th class="hidden-phone"></th>
<th><wicket:message key="gb.lastChange">Last Change</wicket:message></th>
<th class="hidden-phone"></th>
@@ -88,7 +88,7 @@
<wicket:fragment wicket:id="repositoryRow">
<td class="left" style="padding-left:3px;" ><b><span class="repositorySwatch" wicket:id="repositorySwatch"></span></b> <span style="padding-left:3px;" wicket:id="repositoryName">[repository name]</span></td>
<td class="hidden-phone"><span class="list" wicket:id="repositoryDescription">[repository description]</span></td>
- <td class="hidden-tablet hidden-phone author"><span wicket:id="repositoryOwner">[repository owner]</span></td>
+ <td class="hidden-tablet hidden-phone author"><span wicket:id="repositoryAdministrators">[repository owner]</span></td>
<td class="hidden-phone" style="text-align: right;padding-right:10px;"><img class="inlineIcon" wicket:id="forkIcon" /><img class="inlineIcon" wicket:id="ticketsIcon" /><img class="inlineIcon" wicket:id="docsIcon" /><img class="inlineIcon" wicket:id="frozenIcon" /><img class="inlineIcon" wicket:id="federatedIcon" /><img class="inlineIcon" wicket:id="accessRestrictionIcon" /></td>
<td><span wicket:id="repositoryLastChange">[last change]</span></td>
<td class="hidden-phone" style="text-align: right;padding-right:15px;"><span style="font-size:0.8em;" wicket:id="repositorySize">[repository size]</span></td>
diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.java b/src/com/gitblit/wicket/panels/RepositoriesPanel.java
index 976c517f..c6c57a79 100644
--- a/src/com/gitblit/wicket/panels/RepositoriesPanel.java
+++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.java
@@ -49,6 +49,7 @@ import com.gitblit.SyndicationServlet;
import com.gitblit.models.ProjectModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
+import com.gitblit.utils.MultiConfigUtil;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
@@ -64,6 +65,8 @@ public class RepositoriesPanel extends BasePanel {
private static final long serialVersionUID = 1L;
+ private MultiConfigUtil multiConfigUtil = new MultiConfigUtil();
+
public RepositoriesPanel(String wicketId, final boolean showAdmin, final boolean showManagement,
List<RepositoryModel> models, boolean enableLinks,
final Map<AccessRestrictionType, String> accessRestrictionTranslations) {
@@ -287,14 +290,7 @@ public class RepositoriesPanel extends BasePanel {
row.add(WicketUtils.newBlankImage("accessRestrictionIcon"));
}
- String owner = entry.owner;
- if (!StringUtils.isEmpty(owner)) {
- UserModel ownerModel = GitBlit.self().getUserModel(owner);
- if (ownerModel != null) {
- owner = ownerModel.getDisplayName();
- }
- }
- row.add(new Label("repositoryOwner", owner));
+ row.add(new Label("repositoryAdministrators", multiConfigUtil.convertCollectionToSingleLineString(entry.getRepoAdministrators())));
String lastChange;
if (entry.lastChange.getTime() == 0) {
@@ -306,42 +302,29 @@ public class RepositoriesPanel extends BasePanel {
row.add(lastChangeLabel);
WicketUtils.setCssClass(lastChangeLabel, getTimeUtils().timeAgoCss(entry.lastChange));
- boolean showOwner = user != null && entry.isOwner(user.username);
- boolean myPersonalRepository = showOwner && entry.isUsersPersonalRepository(user.username);
+ boolean isRepoAdministrator = user != null && entry.isRepoAdministrator(user.username);
+ boolean myPersonalRepository = isRepoAdministrator && entry.isUsersPersonalRepository(user.username);
if (showAdmin || myPersonalRepository) {
Fragment repositoryLinks = new Fragment("repositoryLinks",
"repositoryAdminLinks", this);
repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository",
EditRepositoryPage.class, WicketUtils
.newRepositoryParameter(entry.name)));
- Link<Void> deleteLink = new Link<Void>("deleteRepository") {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onClick() {
- if (GitBlit.self().deleteRepositoryModel(entry)) {
- if (dp instanceof SortableRepositoriesProvider) {
- info(MessageFormat.format(getString("gb.repositoryDeleted"), entry));
- ((SortableRepositoriesProvider) dp).remove(entry);
- } else {
- setResponsePage(getPage().getClass(), getPage().getPageParameters());
- }
- } else {
- error(MessageFormat.format(getString("gb.repositoryDeleteFailed"), entry));
- }
- }
- };
+ Link<Void> deleteLink = new DeleteLink(entry, dp);
deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
getString("gb.deleteRepository"), entry)));
repositoryLinks.add(deleteLink);
row.add(repositoryLinks);
- } else if (showOwner) {
+ } else if (isRepoAdministrator) {
Fragment repositoryLinks = new Fragment("repositoryLinks",
- "repositoryOwnerLinks", this);
+ "repositoryAdminLinks", this);
repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository",
EditRepositoryPage.class, WicketUtils
.newRepositoryParameter(entry.name)));
+ Link<Void> deleteLink = new DeleteLink(entry, dp);
+ deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
+ getString("gb.deleteRepository"), entry)));
+ repositoryLinks.add(deleteLink);
row.add(repositoryLinks);
} else {
row.add(new Label("repositoryLinks"));
@@ -370,6 +353,35 @@ public class RepositoriesPanel extends BasePanel {
}
}
+ private class DeleteLink extends Link<Void> {
+ private RepositoryModel entry;
+
+ private IDataProvider<RepositoryModel> dp;
+
+ private static final long serialVersionUID = 1L;
+
+ public DeleteLink(RepositoryModel entry, IDataProvider<RepositoryModel> dp) {
+ super("deleteRepository");
+ this.entry=entry;
+ this.dp=dp;
+ }
+
+ @Override
+ public void onClick() {
+ if (GitBlit.self().deleteRepositoryModel(entry)) {
+ if (dp instanceof SortableRepositoriesProvider) {
+ info(MessageFormat.format(getString("gb.repositoryDeleted"), entry));
+ ((SortableRepositoriesProvider) dp).remove(entry);
+ } else {
+ setResponsePage(getPage().getClass(), getPage().getPageParameters());
+ }
+ } else {
+ error(MessageFormat.format(getString("gb.repositoryDeleteFailed"), entry));
+ }
+ }
+
+ }
+
private static class GroupRepositoryModel extends RepositoryModel {
private static final long serialVersionUID = 1L;
@@ -463,6 +475,8 @@ public class RepositoriesPanel extends BasePanel {
private List<RepositoryModel> list;
+ private MultiConfigUtil multiConfigUtil = new MultiConfigUtil();
+
protected SortableRepositoriesProvider(List<RepositoryModel> list) {
this.list = list;
setSort(SortBy.date.name(), false);
@@ -516,9 +530,9 @@ public class RepositoriesPanel extends BasePanel {
@Override
public int compare(RepositoryModel o1, RepositoryModel o2) {
if (asc) {
- return o1.owner.compareTo(o2.owner);
+ return multiConfigUtil.convertCollectionToSingleLineString(o1.getRepoAdministrators()).compareTo(multiConfigUtil.convertCollectionToSingleLineString(o2.getRepoAdministrators()));
}
- return o2.owner.compareTo(o1.owner);
+ return multiConfigUtil.convertCollectionToSingleLineString(o2.getRepoAdministrators()).compareTo(multiConfigUtil.convertCollectionToSingleLineString(o1.getRepoAdministrators()));
}
});
} else if (prop.equals(SortBy.description.name())) {