Fix view of versioned file
[pithos-web-client] / src / gr / grnet / pithos / web / client / StatusPanel.java
index 34296d6..f06f5c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2013 GRNET S.A. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
  */
 package gr.grnet.pithos.web.client;
 
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+import com.google.gwt.safehtml.shared.UriUtils;
+import com.google.gwt.user.client.ui.*;
 
 /**
  * The panel that displays a status bar with quota information.
  */
 public class StatusPanel extends Composite {
 
-       /**
-        * The constructor of the status panel.
-        */
-       public StatusPanel() {
-               HorizontalPanel outer = new HorizontalPanel();
-               outer.setWidth("100%");
-               outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
+    /**
+     * The constructor of the status panel.
+     */
+    public StatusPanel() {
+        final String SYNNEFO_VERSION = Pithos.getFromOtherPropertiesOrDefault("SYNNEFO_VERSION", "");
+
+        HorizontalPanel outer = new HorizontalPanel();
+        outer.setWidth("100%");
+        outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
 
         VerticalPanel inner = new VerticalPanel();
         inner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
-               HorizontalPanel firstLine = new HorizontalPanel();
-               firstLine.setSpacing(8);
-        firstLine.add(new HTML("<a href='javascript:void(0)'>About</a> |"));
-        firstLine.add(new HTML("<a href='javascript:void(0)'>Help</a> |"));
-        firstLine.add(new HTML("<a href='javascript:void(0)'>Contact</a> |"));
-        firstLine.add(new HTML("<a href='javascript:void(0)'>Terms</a> |"));
-        firstLine.add(new HTML("<a href='javascript:void(0)'>Privacy</a>"));
-               inner.add(firstLine);
+        HorizontalPanel firstLine = new HorizontalPanel();
+        firstLine.setSpacing(8);
+        if(Pithos.isShowCopyrightMessage()) {
+            final String COMPANY_URL = Pithos.getFromOtherPropertiesOrDefault("COMPANY_URL", "#");
+            final String safeCompanyURL = UriUtils.encode(COMPANY_URL);
+            final String COPYRIGHT_MESSAGE = Pithos.getFromOtherPropertiesOrDefault("COPYRIGHT_MESSAGE", "");
+            final String safeCopyrightMessage = SafeHtmlUtils.htmlEscape(COPYRIGHT_MESSAGE);
+            firstLine.add(new HTML("<a class='grnet-sign' href='" + safeCompanyURL + "'>" + safeCopyrightMessage + "</a>"));
+
+            Pithos.LOG("Showing copyright message");
+        }
+        else {
+            Pithos.LOG("Not showing copyright message");
+        }
+        inner.add(firstLine);
 
         HorizontalPanel secondLine = new HorizontalPanel();
-        secondLine.add(new HTML("Copyright (C) 2011 Greek Research and Technology Network"));
+        secondLine.add(new HTML(
+            "<div class='software'>" +
+                "Powered by <a href='http://synnefo.orgs'>Synnefo</a>" +
+                "<span class='version'> v" + SYNNEFO_VERSION + "</span>" +
+            "</div>"));
+//        secondLine.addStyleName("software");
         inner.add(secondLine);
         outer.add(inner);
         outer.addStyleName("pithos-statusbar");
 
-               initWidget(outer);
-       }
+        initWidget(outer);
+    }
 }