\r
<div wicket:id="permissionRow">\r
<div style="padding-top:10px;border-left:1px solid #ccc;border-right:1px solid #ccc;" class="row-fluid">\r
- <div style="padding-top:5px;padding-left:5px;" class="span6" wicket:id="registrant"></div><div style="padding-top:5px;padding-right:5px;text-align:right;" class="span2"><span class="label label-info" wicket:id="regex">[regex]</span></div> <select class="input-medium" wicket:id="permission"></select>\r
+ <div style="padding-top:5px;padding-left:5px;" class="span6"><span wicket:id="registrant"></span></div><div style="padding-top:5px;padding-right:5px;text-align:right;" class="span2"><span class="label label-info" wicket:id="regex">[regex]</span></div> <select class="input-medium" wicket:id="permission"></select>\r
</div>\r
</div>\r
\r
import org.apache.wicket.model.IModel;
import com.gitblit.Constants.AccessPermission;
+import com.gitblit.Constants.RegistrantType;
import com.gitblit.models.RegistrantAccessPermission;
import com.gitblit.utils.DeepCopier;
+import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.WicketUtils;
/**
public void populateItem(final Item<RegistrantAccessPermission> item) {
final RegistrantAccessPermission entry = item.getModelObject();
- item.add(new Label("registrant", entry.registrant));
+ if (RegistrantType.REPOSITORY.equals(entry.type)) {
+ // repository, strip .git and show swatch
+ String repoName = StringUtils.stripDotGit(entry.registrant);
+ Label registrant = new Label("registrant", repoName);
+ WicketUtils.setCssClass(registrant, "repositorySwatch");
+ WicketUtils.setCssBackground(registrant, repoName);
+ item.add(registrant);
+ } else {
+ item.add(new Label("registrant", entry.registrant));
+ }
if (entry.isExplicit) {
item.add(new Label("regex", "").setVisible(false));
} else {