diff options
Diffstat (limited to 'src/main/java/com/gitblit/wicket')
-rw-r--r-- | src/main/java/com/gitblit/wicket/GitBlitWebApp.properties | 4 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/UserPage.html | 1 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/UserPage.java | 21 |
3 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties index c80d45ce..eb92e2d2 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties @@ -739,4 +739,6 @@ gb.key = Key gb.comment = Comment gb.sshKeyCommentDescription = Enter an optional comment. If blank, the comment will be extracted from the key data. gb.permission = Permission -gb.sshKeyPermissionDescription = Specify the access permission for the SSH key
\ No newline at end of file +gb.sshKeyPermissionDescription = Specify the access permission for the SSH key +gb.transportPreference = Transport Preference +gb.transportPreferenceDescription = Set the transport that you prefer to use for cloning
\ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/pages/UserPage.html b/src/main/java/com/gitblit/wicket/pages/UserPage.html index 017fcb1f..8dccfee7 100644 --- a/src/main/java/com/gitblit/wicket/pages/UserPage.html +++ b/src/main/java/com/gitblit/wicket/pages/UserPage.html @@ -66,6 +66,7 @@ <div wicket:id="emailAddress"></div>
<div wicket:id="language"></div>
<div wicket:id="emailMeOnMyTicketChanges"></div>
+ <div wicket:id="transport"></div>
<div class="form-actions"><input class="btn btn-appmenu" type="submit" value="Save" wicket:message="value:gb.save" wicket:id="save" /></div>
</form>
diff --git a/src/main/java/com/gitblit/wicket/pages/UserPage.java b/src/main/java/com/gitblit/wicket/pages/UserPage.java index 00a36272..306eea65 100644 --- a/src/main/java/com/gitblit/wicket/pages/UserPage.java +++ b/src/main/java/com/gitblit/wicket/pages/UserPage.java @@ -35,6 +35,7 @@ import org.apache.wicket.markup.repeater.data.ListDataProvider; import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
+import com.gitblit.Constants.Transport;
import com.gitblit.GitBlitException;
import com.gitblit.Keys;
import com.gitblit.models.Menu.ParameterMenuItem;
@@ -221,6 +222,7 @@ public class UserPage extends RootPage { final IModel<String> emailAddress = Model.of(user.emailAddress == null ? "" : user.emailAddress);
final IModel<Language> language = Model.of(preferredLanguage);
final IModel<Boolean> emailMeOnMyTicketChanges = Model.of(user.getPreferences().isEmailMeOnMyTicketChanges());
+ final IModel<Transport> transport = Model.of(user.getPreferences().getTransport());
prefs.add(new TextOption("displayName",
getString("gb.displayName"),
@@ -243,6 +245,24 @@ public class UserPage extends RootPage { getString("gb.emailMeOnMyTicketChangesDescription"),
emailMeOnMyTicketChanges).setVisible(app().notifier().isSendingMail()));
+ List<Transport> availableTransports = new ArrayList<>();
+ if (app().gitblit().isServingSSH()) {
+ availableTransports.add(Transport.SSH);
+ }
+ if (app().gitblit().isServingHTTP()) {
+ availableTransports.add(Transport.HTTPS);
+ availableTransports.add(Transport.HTTP);
+ }
+ if (app().gitblit().isServingGIT()) {
+ availableTransports.add(Transport.GIT);
+ }
+
+ prefs.add(new ChoiceOption<Transport>("transport",
+ getString("gb.transportPreference"),
+ getString("gb.transportPreferenceDescription"),
+ transport,
+ availableTransports));
+
prefs.add(new AjaxButton("save") {
private static final long serialVersionUID = 1L;
@@ -261,6 +281,7 @@ public class UserPage extends RootPage { }
user.getPreferences().setEmailMeOnMyTicketChanges(emailMeOnMyTicketChanges.getObject());
+ user.getPreferences().setTransport(transport.getObject());
try {
app().gitblit().reviseUser(user.username, user);
|