浏览代码

HUE-8888 [blog] Moving the language choose to a footer flag (#1044)

Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>
Enrico Berti 5 年之前
父节点
当前提交
ee8fd7638d

+ 4 - 0
docs/gethue/static/css/custom.css

@@ -4,3 +4,7 @@
 .blog-article img:hover {
   box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.15);
 }
+img.flag {
+  max-width: 1.5em;
+  border: 1px solid #cccccc;
+}

二进制
docs/gethue/static/img/flags/en.png


+ 25 - 0
docs/gethue/static/img/flags/en.svg

@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 7410 3900">
+<rect width="7410" height="3900" fill="#b22234"/>
+<path d="M0,450H7410m0,600H0m0,600H7410m0,600H0m0,600H7410m0,600H0" stroke="#fff" stroke-width="300"/>
+<rect width="2964" height="2100" fill="#3c3b6e"/>
+<g fill="#fff">
+<g id="s18">
+<g id="s9">
+<g id="s5">
+<g id="s4">
+<path id="s" d="M247,90 317.534230,307.082039 132.873218,172.917961H361.126782L176.465770,307.082039z"/>
+<use xlink:href="#s" y="420"/>
+<use xlink:href="#s" y="840"/>
+<use xlink:href="#s" y="1260"/>
+</g>
+<use xlink:href="#s" y="1680"/>
+</g>
+<use xlink:href="#s4" x="247" y="210"/>
+</g>
+<use xlink:href="#s9" x="494"/>
+</g>
+<use xlink:href="#s18" x="988"/>
+<use xlink:href="#s9" x="1976"/>
+<use xlink:href="#s5" x="2470"/>
+</g>
+</svg>

+ 5 - 0
docs/gethue/static/img/flags/fr.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2">
+<rect width="3" height="2" fill="#ED2939"/>
+<rect width="2" height="2" fill="#fff"/>
+<rect width="1" height="2" fill="#002395"/>
+</svg>

+ 5 - 0
docs/gethue/static/img/flags/it.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2">
+<rect width="1" height="2" fill="#009246"/>
+<rect width="1" height="2" x="1" fill="#fff"/>
+<rect width="1" height="2" x="2" fill="#ce2b37"/>
+</svg>

二进制
docs/gethue/static/img/flags/jp.png


+ 4 - 0
docs/gethue/static/img/flags/jp.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600">
+<rect fill="#fff" height="600" width="900"/>
+<circle fill="#bc002d" cx="450" cy="300" r="180"/>
+</svg>

+ 5 - 0
docs/gethue/static/img/flags/se.svg

@@ -0,0 +1,5 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 10">
+<rect width="16" height="10" fill="#006aa7"/>
+<rect width="2" height="10" x="5" fill="#fecc00"/>
+<rect width="16" height="2" y="4" fill="#fecc00"/>
+</svg>

+ 12 - 2
docs/gethue/themes/stack-hue-theme/layouts/partials/footer.html

@@ -4,8 +4,18 @@
 <footer class="space--sm footer-2 ">
   <div class="container">
     <div class="row">
-      <div class="col-sm-6">
+      <div class="col-sm-9">
         <ul class="list-inline list--hover">
+          {{ $currentLang := .Lang }}
+          {{ range $.Site.Home.AllTranslations }}
+            {{ if ne .Lang $currentLang }}
+            <li>
+              <a href="{{ .Permalink }}">
+                <img class="icon icon--xs flag" alt="{{ .Language.LanguageName }}" title="{{ .Language.LanguageName }}" src="{{ .Site.BaseURL }}img/flags/{{.Lang}}.png" />
+              </a>
+            </li>
+            {{ end }}
+          {{ end }}
           <li> <a href="mailto:team@gethue.com"><span>{{ i18n "contact" }}</span></a> </li>
           <li> <a href="https://github.com/cloudera/hue/blob/master/CONTRIBUTING.md"><span>{{ i18n "work" }}</span></a> </li>
           <li> <a href="{{ .Site.BaseURL }}/posts/"><span>{{ i18n "blog" }}</span></a> </li>
@@ -22,7 +32,7 @@
           </li>
         </ul>
       </div>
-      <div class="col-sm-6 text-right text-center-xs">
+      <div class="col-sm-3 text-right text-center-xs">
         <a class="btn btn--sm btn--primary type--uppercase" href="http://demo.gethue.com" target="_blank">
           <span class="btn__text">
             {{ i18n "try" }}

+ 8 - 20
docs/gethue/themes/stack-hue-theme/layouts/partials/header.html

@@ -80,14 +80,20 @@
                         <div class="row">
                           <div class="dropdown__content col-lg-2">
                             <ul class="menu-vertical">
-                              <li><a href="{{ .Site.Params.docsHost }}/user/querying/">{{ i18n "user" }}</a></li>
+                              <li>
+                                <a href="{{ .Site.Params.docsHost }}/user/querying/"
+                                  >{{ i18n "user" }}</a
+                                >
+                              </li>
                               <li>
                                 <a href="{{ .Site.Params.docsHost }}/administrator/"
                                   >{{ i18n "admin" }}</a
                                 >
                               </li>
                               <li>
-                                <a href="{{ .Site.Params.docsHost }}/developer/">{{ i18n "developer" }}</a>
+                                <a href="{{ .Site.Params.docsHost }}/developer/"
+                                  >{{ i18n "developer" }}</a
+                                >
                               </li>
                             </ul>
                           </div>
@@ -105,24 +111,6 @@
                       {{ i18n "forum" }}
                     </a>
                   </li>
-                  <li class="dropdown">
-                    <span class="dropdown__trigger">
-                      {{ .Site.Language.LanguageName }}
-                    </span>
-                    <div class="dropdown__container">
-                      <div class="container">
-                        <div class="row">
-                          <div class="dropdown__content col-lg-2">
-                            <ul>
-                              {{ range $.Site.Home.AllTranslations }}
-                              <li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
-                              {{ end }}
-                            </ul>
-                          </div>
-                        </div>
-                      </div>
-                    </div>
-                  </li>
                   <li>
                     <a href="https://github.com/cloudera/hue" title="GitHub" target="_blank">
                       <i class="socicon socicon-github icon icon--xs"></i>

+ 0 - 0
docs/gethue/themes/stack-hue-theme/static/css/style.css