Add config option to control jobs panel position

If the list of jobs reported by CI is big it eats a lot of vertical
space just below review score which is not very nice.
This change introduces config option ShowJobsBelowRelatedInfoBlock
to control the position of jobs panel on the review page. If option is
set to 'true' the panel will be positioned just below related info block
(space on the right from review info). By default the option is set to
'false' which means current behavior (position below review scores).
Usage example:
  [plugin "verify-status"]
     ShowJobsBelowRelatedInfoBlock = true

Change-Id: Ia9a455388142982066f44b76116cba776fe0d149
Signed-off-by: Sergii Kipot <kipot.sergey@gmail.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/ConfigInfo.java b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/ConfigInfo.java
index 00ac98a..593506f 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/ConfigInfo.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/ConfigInfo.java
@@ -20,12 +20,14 @@
   final native boolean showJobsSummaryPanel() /*-{ return this.show_jobs_summary_panel ? true : false; }-*/;
   final native boolean showJobsPanel() /*-{ return this.show_jobs_panel ? true : false; }-*/;
   final native boolean showJobsDropDownPanel() /*-{ return this.show_jobs_drop_down_panel ? true : false; }-*/;
+  final native boolean showJobsBelowRelatedInfoBlock() /*-{ return this.show_jobs_below_related_info_block ? true : false; }-*/;
   final native String sortJobsPanel() /*-{ return this.sort_jobs_panel }-*/;
   final native String sortJobsDropDownPanel() /*-{ return this.sort_jobs_drop_down_panel }-*/;
 
   final native void setShowJobsSummaryPanel(boolean s) /*-{ this.show_jobs_summary_panel = s; }-*/;
   final native void setShowJobsPanel(boolean s) /*-{ this.show_jobs_panel = s; }-*/;
   final native void setShowJobsDropDownPanel(boolean s) /*-{ this.show_jobs_drop_down_panel = s; }-*/;
+  final native void setShowJobsBelowRelatedInfoBlock(boolean s) /*-{ this.show_jobs_below_related_info_block = s; }-*/;
   final native void setSortJobsPanel(String s) /*-{ this.sort_jobs_panel = s; }-*/;
   final native void setSortJobsDropDownPanel(String s) /*-{ this.sort_jobs_drop_down_panel = s; }-*/;
 
diff --git a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/VerifyStatusPlugin.java b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/VerifyStatusPlugin.java
index d45824e..38bfc31 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/VerifyStatusPlugin.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/VerifyStatusPlugin.java
@@ -41,7 +41,9 @@
             }
             if (info.showJobsPanel()) {
               Plugin.get().panel(
-                  GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK,
+                  info.showJobsBelowRelatedInfoBlock()
+                      ? GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK
+                      : GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK,
                   new JobsPanel.Factory(info));
             }
             if (info.showJobsDropDownPanel()) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/public/verify-status.css b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/public/verify-status.css
index caf61ac..c8915d3 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/public/verify-status.css
+++ b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/public/verify-status.css
@@ -2,3 +2,6 @@
   border-spacing: 0px 5px;
 }
 
+div.gwt-TabPanelBottom div {
+  height: 100% !important;
+}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/GetConfig.java b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/GetConfig.java
index f1d299a..8d9368c 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/GetConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/GetConfig.java
@@ -37,6 +37,8 @@
     info.showJobsPanel = cfg.getBoolean("showJobsPanel", true);
     info.showJobsDropDownPanel = cfg.getBoolean("showJobsDropDownPanel", true);
     info.showJobsSummaryPanel = cfg.getBoolean("showJobsSummaryPanel", true);
+    info.showJobsBelowRelatedInfoBlock = cfg.getBoolean(
+        "showJobsBelowRelatedInfoBlock", false);
     info.sortJobsPanel = cfg.getEnum(JobsSorting.values(),
         "sortJobsPanel", JobsSorting.REPORTER);
     info.sortJobsDropDownPanel = cfg.getEnum(JobsSorting.values(),
@@ -48,6 +50,7 @@
     Boolean showJobsPanel;
     Boolean showJobsDropDownPanel;
     Boolean showJobsSummaryPanel;
+    Boolean showJobsBelowRelatedInfoBlock;
     JobsSorting sortJobsPanel;
     JobsSorting sortJobsDropDownPanel;
   }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/PutConfig.java b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/PutConfig.java
index 93f6bbb..3748b3b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/PutConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/verifystatus/server/PutConfig.java
@@ -41,6 +41,7 @@
     public Boolean showJobsPanel;
     public Boolean showJobsDropDownPanel;
     public Boolean showJobsSummaryPanel;
+    public Boolean showJobsBelowRelatedInfoBlock;
     public String sortJobsPanel;
     public String sortJobsDropDownPanel;
   }
@@ -86,6 +87,12 @@
     } else {
       cfg.unset("plugin", pluginName, "showJobsSummaryPanel");
     }
+    if (input.showJobsBelowRelatedInfoBlock != null) {
+      cfg.setBoolean("plugin", pluginName, "showJobsBelowRelatedInfoBlock",
+          input.showJobsBelowRelatedInfoBlock);
+    } else {
+      cfg.unset("plugin", pluginName, "showJobsBelowRelatedInfoBlock");
+    }
     if (input.sortJobsPanel != null) {
       cfg.setEnum("plugin", pluginName, "sortJobsPanel",
           JobsSorting.valueOf(input.sortJobsPanel));
diff --git a/src/main/resources/Documentation/about.md b/src/main/resources/Documentation/about.md
index 17fe3a7..e569344 100644
--- a/src/main/resources/Documentation/about.md
+++ b/src/main/resources/Documentation/about.md
@@ -91,13 +91,14 @@
 
 #### Parameters
 
-|Field Name             |Description|
-|:----------------------|:----------|
-|showJobsPanel          | Whether jobs panel should be displayed (default to true)|
-|showJobsDropDownPanel  | Whether jobs drop down panel should be displayed (default to true)|
-|showJobsSummaryPanel   | Whether jobs summary panel should be displayed (default to true)|
-|sortJobsPanel          | The order of jobs sorting on jobs panel (REPORTER,NAME,DATE default to REPORTER). Both upper and lower cases are allowed.|
-|sortJobsDropDownPanel  | The order of jobs sorting on jobs drop down panel (REPORTER,NAME,DATE default to REPORTER). Both upper and lower cases are allowed.|
+|Field Name                    |Description|
+|:-----------------------------|:----------|
+|showJobsPanel                 | Whether jobs panel should be displayed (default to true)|
+|showJobsDropDownPanel         | Whether jobs drop down panel should be displayed (default to true)|
+|showJobsSummaryPanel          | Whether jobs summary panel should be displayed (default to true)|
+|showJobsBelowRelatedInfoBlock | Whether jobs panel should be positioned below related info block (default to false)|
+|sortJobsPanel                 | The order of jobs sorting on jobs panel (REPORTER,NAME,DATE default to REPORTER). Both upper and lower cases are allowed.|
+|sortJobsDropDownPanel         | The order of jobs sorting on jobs drop down panel (REPORTER,NAME,DATE default to REPORTER). Both upper and lower cases are allowed.|
 
 
 #### Example
diff --git a/src/main/resources/Documentation/rest-api-config.md b/src/main/resources/Documentation/rest-api-config.md
index eef5387..a897276 100644
--- a/src/main/resources/Documentation/rest-api-config.md
+++ b/src/main/resources/Documentation/rest-api-config.md
@@ -67,13 +67,14 @@
 The `ConfigInfo` entity contains the configuration of the @PLUGIN@
 plugin.
 
-|Field Name               |Description|
-|:------------------------|:----------|
-|show_jobs_panel          | Whether jobs panel should be displayed|
-|show_jobs_drop_down_panel| Whether jobs drop down panel should be displayed|
-|show_jobs_summary_panel  | Whether jobs summary panel should be displayed|
-|sort_jobs_panel          | The order of jobs sorting on jobs panel (REPORTER,NAME,DATE)|
-|sort_jobs_drop_down_panel| The order of jobs sorting on jobs drop down panel (REPORTER,NAME,DATE)|
+|Field Name                         |Description|
+|:----------------------------------|:----------|
+|show_jobs_panel                    | Whether jobs panel should be displayed|
+|show_jobs_drop_down_panel          | Whether jobs drop down panel should be displayed|
+|show_jobs_summary_panel            | Whether jobs summary panel should be displayed|
+|show_jobs_below_related_info_block | Whether jobs panel should be positioned below related info block|
+|sort_jobs_panel                    | The order of jobs sorting on jobs panel (REPORTER,NAME,DATE)|
+|sort_jobs_drop_down_panel          | The order of jobs sorting on jobs drop down panel (REPORTER,NAME,DATE)|
 
 
 SEE ALSO