Bring navigation back to Gerrit
Make the navigation link that returns to Gerrit UX more visible,
so that it will obvious how to return to the main screen once
you are done with plugins.
Change-Id: Idc13ccd3a73fffe6569ed54e176e2378b639b006
diff --git a/src/main/java/com/googlesource/gerrit/plugins/manager/PluginManagerTopMenu.java b/src/main/java/com/googlesource/gerrit/plugins/manager/PluginManagerTopMenu.java
index f7dfa39..916edfd 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/manager/PluginManagerTopMenu.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/manager/PluginManagerTopMenu.java
@@ -40,7 +40,7 @@
this.userProvider = userProvider;
this.menuEntries =
Arrays.asList(new MenuEntry("Plugins", Arrays.asList(new MenuItem(
- "Manage", myUrl + "static/index.html", "_blank"))));
+ "Manage", myUrl + "static/index.html", "_self"))));
}
@Override
diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css
index f74c1e1..2816380 100644
--- a/src/main/resources/static/css/style.css
+++ b/src/main/resources/static/css/style.css
@@ -24,8 +24,8 @@
width: 65px;
}
-button.btn-sm {
- width: 83px;
+button.btn-100 {
+ width: 100%;
}
.label-success {
diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html
index 2a3cbbd..977ddac 100644
--- a/src/main/resources/static/index.html
+++ b/src/main/resources/static/index.html
@@ -27,7 +27,13 @@
</div>
</form>
<ul class="nav navbar-nav navbar-right">
- <li><a href="/">> Go to Gerrit</a></li>
+ <li>
+ <div class="navbar-form navbar-right">
+ <button type="button"
+ class="btn btn-sm btn-primary btn-100"
+ ng-click="plugins.goToGerrit()">Done » Go To Gerrit</button>
+ </div>
+ </li>
</ul>
</div>
</div>
diff --git a/src/main/resources/static/js/plugin-manager.js b/src/main/resources/static/js/plugin-manager.js
index 5345660..0fb97a2 100644
--- a/src/main/resources/static/js/plugin-manager.js
+++ b/src/main/resources/static/js/plugin-manager.js
@@ -14,7 +14,7 @@
var app = angular.module('PluginManager', []).controller(
'LoadInstalledPlugins',
- function($scope, $http) {
+ function($scope, $http, $location, $window) {
var plugins = this;
plugins.list = [];
@@ -129,6 +129,16 @@
});
}
+ plugins.goToGerrit = function () {
+ var currUrl = $location.absUrl();
+ var indexOfHash = currUrl.indexOf("#")
+ if(indexOfHash > 0) {
+ currUrl = currUrl.substring(0,indexOfHash)
+ }
+ var newUrl = currUrl + "/../../../.."
+ $window.location.href = newUrl
+ };
+
$scope.refreshInstalled();
});
@@ -136,4 +146,4 @@
$httpProvider.defaults.headers.common = {
'X-Gerrit-Auth' : '@X-Gerrit-Auth'
};
-});
\ No newline at end of file
+});