瀏覽代碼

HUE-1989 [core] Welcome tour on the home page

Only on the home page that way it won't conflict with the admin wizard.
Fix typo in Beeswax.
Romain Rigaux 11 年之前
父節點
當前提交
1380e84773

+ 1 - 2
apps/about/src/about/templates/admin_wizard.mako

@@ -48,8 +48,7 @@ ${ header.menubar() }
                   class="fa fa-cogs"></i> ${ _('Check Configuration') }</a></li>
               <li><a href="#step2" class="step">${ _('Step 2:') } <i class="fa fa-book"></i> ${ _('Examples') }</a></li>
               <li><a href="#step3" class="step">${ _('Step 3:') } <i class="fa fa-group"></i> ${ _('Users') }</a></li>
-              <li><a id="lastStep" href="#step4" class="step">${ _('Step 4:') } <i class="fa fa-flag"></i> ${_('Go!') }
-              </a></li>
+              <li><a id="lastStep" href="#step4" class="step">${ _('Step 4:') } <i class="fa fa-flag"></i> ${_('Go!') }</a></li>
             </ul>
 
           <div class="steps">

+ 1 - 1
apps/beeswax/src/beeswax/forms.py

@@ -104,7 +104,7 @@ class SaveResultsFileForm(forms.Form):
                                 help_text=_t("Path to file"))
   overwrite = forms.BooleanField(label=_t('Overwrite'),
                                  required=False,
-                                 help_text=_t("Overwrite the selected filed"))
+                                 help_text=_t("Overwrite the selected files"))
 
   def clean_target_file(self):
     if not self.cleaned_data['target_file'].startswith('/'):

+ 96 - 19
desktop/core/src/desktop/templates/common_footer.mako

@@ -113,8 +113,7 @@ from django.template.defaultfilters import escape, escapejs
         }
         function getParameterByName(name) {
           name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
-          var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
-                  results = regex.exec(_qs);
+          var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(_qs);
           return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
         }
     %endif
@@ -179,29 +178,107 @@ from django.template.defaultfilters import escape, escapejs
     %endif
 
 </script>
-%if tours_and_tutorials:
+% if tours_and_tutorials:
+
+<style type="text/css">
+  .steps {
+    min-height: 150px;
+  }
+</style>
+
+<script src="/static/ext/js/routie-0.3.0.min.js" type="text/javascript" charset="utf-8"></script>
+
+<script type="text/javascript" charset="utf-8">
+$(document).ready(function(){
+  var currentStep = "tourStep1";
+
+  routie({
+    "tourStep1":function () {
+      showStep("tourStep1");
+    },
+    "tourStep2":function () {
+      showStep("tourStep2");
+    },
+    "tourStep3":function () {
+      showStep("tourStep3");
+    }
+  });
+
+  function showStep(step) {
+    currentStep = step;
+
+    $("a.tourStep").parent().removeClass("active");
+    $("a.tourStep[href=#" + step + "]").parent().addClass("active");
+    if (step == "tourStep3") {
+      $("#tourLastStep").parent().addClass("active");
+    }
+    $(".tourStepDetails").hide();
+    $("#" + step).show();
+  }
+});
+</script>
+
   <%include file="tours.mako"/>
-  <div id="jHueTourModal" class="modal hide fade" tabindex="-1">
+
+  <div id="jHueTourModal" class="modal fade" tabindex="-1">
     <div class="modal-header">
       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
       <h3>${_('Did you know?')}</h3>
     </div>
     <div class="modal-body">
-      <div class="pull-left" style="color: #DDDDDD;font-size: 116px;margin: 10px; margin-right: 20px"><i class="fa fa-flag-checkered"></i></div>
-      <div style="margin: 10px">
-      <p>
-        ${_('There are one or more tours available for this page. These tours were created to guide you around.')}
-      </p>
-      <p>
-        ${_('You can see the list of tours by clicking on the checkered flag icon at the top right of this page.')} <span class="badge badge-info"><i class="fa fa-flag-checkered"></i></span>
-      </p>
-        </div>
-    </div>
-    <div class="modal-footer">
-      <label class="checkbox" style="float:left"><input id="jHueTourModalChk" type="checkbox" />${_('Do not show this dialog again')}</label>
-      <a id="jHueTourModalClose" href="#" class="btn btn-primary disable-feedback">${_('Got it, prof!')}</a>
+     <div class="row-fluid">
+       <div id="properties" class="section">
+      <ul class="nav nav-tabs" style="margin-bottom: 0">
+        <li class="active"><a href="#tourStep1" class="tourStep">${ _('Step 1:') } ${ _('Add data') }</a></li>
+        <li><a href="#tourStep2" class="tourStep">${ _('Step 2:') }  ${ _('Query data') }</a></li>
+        <li><a id="tourLastStep" href="#tourStep3" class="tourStep">${ _('Step 3:') } ${_('Do more!') }</a></li>
+      </ul>
     </div>
-  </div>
-%endif
+
+    <div class="tourSteps">
+      <div id="tourStep1" class="tourStepDetails">
+        <div class="pull-left" style="color: #DDDDDD;font-size: 116px;margin: 10px; margin-right: 20px"><i class="fa fa-download"></i></div>
+        <div style="margin: 40px">
+          <p>
+            ${ _('With') }  <span class="badge badge-info"><i class="fa fa-file"></i> File Browser</span>
+            ${ _('and the apps in the') }  <span class="badge badge-info">Data Browsers <b class="caret"></b></span> ${ _('section, upload, view your data and create tables.') }
+          </p>
+          <p>
+            ${ _('Pre-installed samples are also already there.') }
+          </p>
+        </div>
+      </div>
+
+      <div id="tourStep2" class="tourStepDetails hide">
+          <div class="pull-left" style="color: #DDDDDD;font-size: 116px;margin: 10px; margin-right: 20px"><i class="fa fa-search"></i></div>
+          <div style="margin: 40px">
+            <p>
+              ${ _('Then query and visualize the data with the') } <span class="badge badge-info">Query Editors <b class="caret"></b></span>
+               ${ _('and') }  <span class="badge badge-info">Search <b class="caret"></b></span>
+            </p>
+          </div>
+      </div>
+
+      <div id="tourStep3" class="tourStepDetails hide">
+        <div class="pull-left" style="color: #DDDDDD;font-size: 116px;margin: 10px; margin-right: 20px"><i class="fa fa-flag-checkered"></i></div>
+        <div style="margin: 40px">
+          <p>
+            ${ _('Tours were created to guide you around.') }
+            ${ _('You can see the list of tours by clicking on the checkered flag icon') } <span class="badge badge-info"><i class="fa fa-flag-checkered"></i></span>
+            ${ ('at the top right of this page.') }
+          </p>
+          <p>
+            ${ _('More documentation is available at') } <a href="http://learn.gethue.com">learn.gethue.com</a>.
+          </p>
+        </div>
+      </div>
+     </div>
+     </div>
+     <div class="modal-footer">
+       <label class="checkbox" style="float:left"><input id="jHueTourModalChk" type="checkbox" />${_('Do not show this dialog again')}</label>
+       <a id="jHueTourModalClose" href="#" class="btn btn-primary disable-feedback">${_('Got it, prof!')}</a>
+     </div>
+   </div>
+% endif
   </body>
 </html>

+ 1 - 1
desktop/core/static/js/jquery.tour.js

@@ -178,7 +178,7 @@
           _toursHtml += '<li>' + _this.options.labels.NO_AVAILABLE_TOURS + '</li>';
         }
       }
-      if (_added > 0 && typeof $.totalStorage !== "undefined" && ($.totalStorage("jHueTourHideModal") == null || $.totalStorage("jHueTourHideModal") == false) && !RegExp("/accounts/login").test(location.pathname)) {
+      if (_added > 0 && typeof $.totalStorage !== "undefined" && ($.totalStorage("jHueTourHideModal") == null || $.totalStorage("jHueTourHideModal") == false) && RegExp("/home").test(location.pathname)) {
         $(document).ready(function () {
           $("#jHueTourModal").modal();
           $.totalStorage("jHueTourHideModal", true);