Hello Einav Cohen,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/15984

to review the following change.

Change subject: webadmin: add feedback image to webadmin
......................................................................

webadmin: add feedback image to webadmin

Bug-Url: https://bugzilla.redhat.com/884824
Change-Id: Ic804e1ec2a7365898db7013a09639a2096a76184
Signed-off-by: Einav Cohen <[email protected]>
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/DynamicMessages.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/HeaderPresenterWidget.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.ui.xml
A packaging/branding/ovirt.brand/images/feedback.png
M packaging/branding/ovirt.brand/ovirt_messages.properties
M packaging/branding/ovirt.brand/ovirt_web_admin.css
7 files changed, 61 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/15984/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/DynamicMessages.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/DynamicMessages.java
index aa4f664..c844573 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/DynamicMessages.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/DynamicMessages.java
@@ -31,6 +31,7 @@
         LOGIN_HEADER_LABEL("login_header_label"), //$NON-NLS-1$
         MAIN_HEADER_LABEL("main_header_label"), //$NON-NLS-1$
         COPY_RIGHT_NOTICE("copy_right_notice"), //$NON-NLS-1$
+        FEEDBACK_URL("feedback_url"), //$NON-NLS-1$
         DOC("doc"); //$NON-NLS-1$
 
         private final String value;
@@ -229,6 +230,16 @@
     }
 
     /**
+     * Get the copy right notice using the {@code Dictionary} in the host 
page. With a fall back to the standard GWT
+     * Constant.
+     *
+     * @return The copy right notice string.
+     */
+    public final String feedbackUrl() {
+        return getString(DynamicMessageKey.FEEDBACK_URL);
+    }
+
+    /**
      * Get the application documentation title using the {@code Dictionary} in 
the host page. With a fall back to the standard GWT
      * Constant.
      *
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/HeaderPresenterWidget.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/HeaderPresenterWidget.java
index 2b23731..dc4e44c 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/HeaderPresenterWidget.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/HeaderPresenterWidget.java
@@ -25,6 +25,8 @@
         HasClickHandlers getConfigureLink();
 
         HasClickHandlers getAboutLink();
+
+        void setFeedbackLink(String feedbackLink);
     }
 
     @ContentSlot
@@ -45,6 +47,7 @@
         this.searchPanel = searchPanel;
         this.aboutPopup = aboutPopup;
         this.configurePopup = configurePopup;
+        getView().setFeedbackLink(dynamicMessages.feedbackUrl());
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.java
index 5945716..13ac186 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.java
@@ -11,6 +11,8 @@
 import com.google.gwt.dom.client.Style.Cursor;
 import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.editor.client.Editor.Ignore;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
@@ -18,6 +20,7 @@
 import com.google.gwt.user.client.ui.Anchor;
 import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.HTMLPanel;
+import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.InlineLabel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.SimplePanel;
@@ -69,6 +72,11 @@
     @UiField
     FlowPanel mainTabContainer;
 
+    @UiField
+    Image feedbackImage;
+
+    private String feedbackLink = null;
+
     @Inject
     public HeaderView(ApplicationConstants constants,
             ApplicationDynamicMessages dynamicMessages) {
@@ -83,6 +91,18 @@
         // Ensure proper main tab bar position
         setMainTabBarOffset(mainTabBarInitialOffset);
         localize(dynamicMessages);
+
+        feedbackImage.setVisible(false);
+
+        feedbackImage.addClickHandler(new ClickHandler() {
+
+            @Override
+            public void onClick(ClickEvent event) {
+                if (feedbackLink != null && feedbackLink.length() > 0) {
+                    Window.open(feedbackLink, "_blank", null); //$NON-NLS-1$
+                }
+            }
+        });
     }
 
     private void localize(ApplicationDynamicMessages dynamicMessages) {
@@ -145,4 +165,12 @@
         guideLink.getElement().getStyle().setCursor(enabled ? Cursor.POINTER : 
Cursor.DEFAULT);
     }
 
+    @Override
+    public void setFeedbackLink(String feedbackLink) {
+        this.feedbackLink = feedbackLink;
+        if (feedbackLink != null && feedbackLink.length() > 0) {
+            feedbackImage.setVisible(true);
+        }
+    }
+
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.ui.xml
index b3a09ad..d47a924 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/HeaderView.ui.xml
@@ -30,7 +30,7 @@
 
         .menuBar {
             float: right;
-            padding: 10px;
+            padding: 10px 140px 10px 10px;
         }
 
         .userName {
@@ -64,6 +64,11 @@
             width: 300px;
             float: left;
         }
+
+        @external obrand_feedbackImageStyle;
+        .obrand_feedbackImageStyle {
+        }
+
     </ui:style>
 
     <g:HTMLPanel addStyleNames="{style.obrand_wrapperOuter}">
@@ -84,6 +89,7 @@
                 </g:HTMLPanel>
 
                 <div style="clear: both;" />
+                <g:Image ui:field="feedbackImage" 
addStyleNames="{style.obrand_feedbackImageStyle}" url="clear.cache.gif" />
             </g:HTMLPanel>
 
             <g:HTMLPanel addStyleNames="{style.lowerPanel}">
diff --git a/packaging/branding/ovirt.brand/images/feedback.png 
b/packaging/branding/ovirt.brand/images/feedback.png
new file mode 100644
index 0000000..b2e28d0
--- /dev/null
+++ b/packaging/branding/ovirt.brand/images/feedback.png
Binary files differ
diff --git a/packaging/branding/ovirt.brand/ovirt_messages.properties 
b/packaging/branding/ovirt.brand/ovirt_messages.properties
index fcd8abe..40dc3b2 100644
--- a/packaging/branding/ovirt.brand/ovirt_messages.properties
+++ b/packaging/branding/ovirt.brand/ovirt_messages.properties
@@ -27,3 +27,6 @@
 obrand.webadmin.doc=ENGINE Web Admin Documentation
 # The text at the top of the main user page.
 obrand.webadmin.main_header_label=
+
+# feedback URL
+obrand.webadmin.feedback_url=http://www.ovirt.org
diff --git a/packaging/branding/ovirt.brand/ovirt_web_admin.css 
b/packaging/branding/ovirt.brand/ovirt_web_admin.css
index 4152bc9..e16325e 100644
--- a/packaging/branding/ovirt.brand/ovirt_web_admin.css
+++ b/packaging/branding/ovirt.brand/ovirt_web_admin.css
@@ -33,3 +33,12 @@
     padding-bottom: 7px;
 }
 
+/* feedback image */
+.obrand_feedbackImageStyle {
+    position: absolute;
+    right: 0px;
+    top: 0px;
+    cursor: hand;
+    cursor: pointer;
+    background-image: url(images/feedback.png);
+}


-- 
To view, visit http://gerrit.ovirt.org/15984
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic804e1ec2a7365898db7013a09639a2096a76184
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to