[lxc-devel] [linuxcontainers.org/master] Fix the feedback panel on the try it page

anthonydillon on Github lxc-bot at linuxcontainers.org
Wed Nov 22 00:48:54 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 689 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20171122/f921bcb1/attachment.bin>
-------------- next part --------------
From fdd55ee1e90cd4f7ed8aabc53aac041af307a76c Mon Sep 17 00:00:00 2001
From: Anthony Dillon <me at anthonydillon.com>
Date: Wed, 22 Nov 2017 00:45:12 +0000
Subject: [PATCH] Fix the feedback panel on the try it page

---
 content/lxd/try-it.html        |   1 -
 static/css/local.css           |  33 ++++++++++++
 static/img/starred_24.svg      | 113 +++++++++++++++++++++++++++++++++++++++++
 static/img/unstarred_24.svg    | 113 +++++++++++++++++++++++++++++++++++++++++
 static/js/tryit.js             |   8 +--
 templates/common/base.tpl.html |   1 +
 6 files changed, 261 insertions(+), 8 deletions(-)
 create mode 100644 static/img/starred_24.svg
 create mode 100644 static/img/unstarred_24.svg

diff --git a/content/lxd/try-it.html b/content/lxd/try-it.html
index 263b32c..28c416b 100644
--- a/content/lxd/try-it.html
+++ b/content/lxd/try-it.html
@@ -503,7 +503,6 @@ <h3>Conclusion</h3>
                         <form class="p-form" id="tryit_feedback_submit">
                             <div class="p-form__group">
                                 <label for="feedbackRating">Rate your experience</label>
-                                <br />
                                 <input type="hidden" class="rating rating-tooltip" id="feedbackRating" />
                             </div>
 
diff --git a/static/css/local.css b/static/css/local.css
index 75448db..0e0acfd 100644
--- a/static/css/local.css
+++ b/static/css/local.css
@@ -662,3 +662,36 @@ p:empty {
 pre {
   margin-top: .5rem;
 }
+
+
+.glyphicon {
+  position: relative;
+  top: 1px;
+  display: inline-block;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  width: 24px;
+  height: 24px;
+}
+
+.rating-symbol-background {
+  background-image: url('/static/img/unstarred_24.svg');
+  background-repeat: no-repeat;
+}
+
+.rating-symbol-foreground {
+  background-image: url('/static/img/starred_24.svg');
+  background-repeat: no-repeat;
+  position: relative;
+  top: 1px;
+  margin-top: 0;
+}
+
+#tryit_feedback_submit > .p-form__group span + span {
+  display: none;
+}
+
+.rating-symbol {
+  cursor: pointer;
+  margin-top: 1rem;
+}
\ No newline at end of file
diff --git a/static/img/starred_24.svg b/static/img/starred_24.svg
new file mode 100644
index 0000000..fa13997
--- /dev/null
+++ b/static/img/starred_24.svg
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="24"
+   height="24"
+   id="svg5918"
+   version="1.1"
+   inkscape:version="0.91pre2 r"
+   viewBox="0 0 24 24"
+   sodipodi:docname="starred_24.svg">
+  <defs
+     id="defs5920" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#dedede"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="19.428903"
+     inkscape:cx="2.0545916"
+     inkscape:cy="2.9190832"
+     inkscape:document-units="px"
+     inkscape:current-layer="g5346"
+     showgrid="true"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:snap-bbox="true"
+     inkscape:bbox-paths="true"
+     inkscape:bbox-nodes="true"
+     inkscape:snap-bbox-edge-midpoints="true"
+     inkscape:snap-bbox-midpoints="true"
+     inkscape:object-paths="true"
+     inkscape:snap-intersection-paths="true"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true"
+     inkscape:snap-midpoints="true"
+     inkscape:snap-object-midpoints="true"
+     inkscape:snap-center="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4137"
+       originx="-0.00010811021px"
+       originy="-8.999972px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5923">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-182.93849,-552.7201)">
+    <g
+       style="display:inline"
+       transform="matrix(0.66666607,0,0,0.66666668,-633.06096,6.8119427)"
+       id="g5687" />
+    <g
+       style="display:inline"
+       id="g5346"
+       transform="translate(-769.06151,404.35792)">
+      <rect
+         y="156.36218"
+         x="952"
+         height="16"
+         width="16"
+         id="rect5348"
+         style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.5, 1.5;stroke-dashoffset:0.60000002;stroke-opacity:1;marker:none;enable-background:accumulate" />
+      <g
+         style="display:inline"
+         id="g4586"
+         transform="translate(840,-160)">
+        <path
+           style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;enable-background:accumulate"
+           d="m 123.99283,309.36358 c -0.002,0.003 0.001,0.008 0,0.008 l -0.008,0 c -1.71049,2.45197 -3.10423,4.93973 -4.07551,6.81731 -2.10384,0.31117 -4.81864,0.80984 -7.47178,1.58768 -0.001,0.004 -0.003,0.007 0,0.008 -0.001,0.004 0.008,0 0.008,0 0.003,0.003 0,0.007 0,0.008 1.7427,2.40099 3.6227,4.51782 5.07373,6.04827 -0.30921,2.09328 -0.6127,4.79019 -0.63848,7.5208 0.003,0.003 0.008,3e-5 0.008,0 0.003,0.003 0.008,1.3e-4 0.008,0 2.76183,-0.95579 5.29083,-2.1156 7.16879,-3.05248 1.90871,0.96381 4.44942,2.13293 7.10378,3.03597 0.002,-0.003 0.009,0.003 0.008,0 0.002,-0.003 8e-5,-0.008 0,-0.008 0.002,-0.003 8e-5,-0.007 0,-0.008 -0.0423,-2.88106 -0.34101,-5.60093 -0.63849,-7.66789 1.48688,-1.54248 3.37124,-3.64296 5.02471,-5.92544 -5.4e-4,-0.003 -0.005,0 -0.008,0 -0.003,2.1e-4 -0.008,-0.008 -0.008,-0.008 -2.75889,-0.80616 -5.44327,-1.32856 -7.50427,-1.65323 -0.98928,-1.90965 -2.38967,-4.39035 -4.04302,-6.71043 -0.002,-1e-4 -0.006,-0.003 -0.008,0 z"
+           id="path4596"
+           inkscape:connector-curvature="0" />
+        <g
+           style="display:inline"
+           transform="matrix(0.50000001,0,0,0.50000006,-32.00001,-169.81897)"
+           id="g4590">
+          <rect
+             style="opacity:0.21171169;fill:none;stroke:none"
+             id="rect4592"
+             width="48"
+             height="48"
+             x="288"
+             y="152"
+             transform="translate(0,804.3622)" />
+        </g>
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/static/img/unstarred_24.svg b/static/img/unstarred_24.svg
new file mode 100644
index 0000000..ecde7cd
--- /dev/null
+++ b/static/img/unstarred_24.svg
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="24"
+   height="24"
+   id="svg5918"
+   version="1.1"
+   inkscape:version="0.91pre2 r"
+   viewBox="0 0 24 24"
+   sodipodi:docname="unstarred_24.svg">
+  <defs
+     id="defs5920" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#dedede"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="19.428903"
+     inkscape:cx="2.0545916"
+     inkscape:cy="2.9190832"
+     inkscape:document-units="px"
+     inkscape:current-layer="g5346"
+     showgrid="true"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:snap-bbox="true"
+     inkscape:bbox-paths="true"
+     inkscape:bbox-nodes="true"
+     inkscape:snap-bbox-edge-midpoints="true"
+     inkscape:snap-bbox-midpoints="true"
+     inkscape:object-paths="true"
+     inkscape:snap-intersection-paths="true"
+     inkscape:object-nodes="true"
+     inkscape:snap-smooth-nodes="true"
+     inkscape:snap-midpoints="true"
+     inkscape:snap-object-midpoints="true"
+     inkscape:snap-center="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4137"
+       originx="-0.00010811021px"
+       originy="-8.999972px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata5923">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-182.93849,-552.7201)">
+    <g
+       style="display:inline"
+       transform="matrix(0.66666607,0,0,0.66666668,-633.06096,6.8119427)"
+       id="g5687" />
+    <g
+       style="display:inline"
+       id="g5346"
+       transform="translate(-769.06151,404.35792)">
+      <rect
+         y="156.36218"
+         x="952"
+         height="16"
+         width="16"
+         id="rect5348"
+         style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.5, 1.5;stroke-dashoffset:0.60000002;stroke-opacity:1;marker:none;enable-background:accumulate" />
+      <g
+         style="display:inline"
+         id="g4581"
+         transform="translate(840,-160)">
+        <path
+           id="path4117"
+           d="m 123.99283,309.36358 c -0.002,0.003 0.001,0.008 0,0.008 l -0.008,0 c -1.71049,2.45197 -3.10423,4.93973 -4.07551,6.81731 -2.10384,0.31117 -4.81864,0.80984 -7.47178,1.58768 -0.001,0.004 -0.003,0.007 0,0.008 -0.001,0.004 0.008,0 0.008,0 0.003,0.003 0,0.007 0,0.008 1.7427,2.40099 3.6227,4.51782 5.07373,6.04827 -0.30921,2.09328 -0.6127,4.79019 -0.63848,7.5208 0.003,0.003 0.008,3e-5 0.008,0 0.003,0.003 0.008,1.3e-4 0.008,0 2.76183,-0.95579 5.29083,-2.1156 7.16879,-3.05248 1.90871,0.96381 4.44942,2.13293 7.10378,3.03597 0.002,-0.003 0.009,0.003 0.008,0 0.002,-0.003 8e-5,-0.008 0,-0.008 0.002,-0.003 8e-5,-0.007 0,-0.008 -0.0423,-2.88106 -0.34101,-5.60093 -0.63849,-7.66789 1.48688,-1.54248 3.37124,-3.64296 5.02471,-5.92544 -5.4e-4,-0.003 -0.005,0 -0.008,0 -0.003,2.1e-4 -0.008,-0.008 -0.008,-0.008 -2.75889,-0.80616 -5.44327,-1.32856 -7.50427,-1.65323 -0.98928,-1.90965 -2.38967,-4.39035 -4.04302,-6.71043 -0.002,-1e-4 -0.006,-0.003 -0.008,0 z m 0.0154,3.05141 0,0.003 0.36138,0.59056 c 0.83737,1.36712 1.60438,2.70541 2.19201,3.8397 l 0.38508,0.75032 0.83515,0.13003 c 1.22086,0.19235 2.68457,0.48339 4.2182,0.8324 l 0.67429,0.15315 -0.44347,0.5305 c -1.01275,1.21104 -2.01384,2.34296 -2.89274,3.2547 l -0.56797,0.58725 0.11789,0.80981 c 0.17677,1.22824 0.33275,2.71899 0.45283,4.29147 l 0.0529,0.69027 -0.63849,-0.26774 c -1.44226,-0.6049 -2.81284,-1.22816 -3.93724,-1.79592 l -0.74426,-0.37186 -0.75141,0.37242 -10e-4,0 c -1.12438,0.56091 -2.52307,1.19064 -4.01051,1.81134 l -0.64014,0.26717 0.0556,-0.69083 c 0.11844,-1.48229 0.26632,-2.90893 0.44512,-4.11957 l 0.11734,-0.80376 -0.5542,-0.58725 c -0.87941,-0.9275 -1.91138,-2.11648 -2.96546,-3.3935 l -0.44126,-0.53437 0.67704,-0.14819 c 1.48687,-0.3245 2.92122,-0.5936 4.14493,-0.77456 l 5.4e-4,0 0.84948,-0.12394 0.39112,-0.75638 c 0.59038,-1.14128 1.38502,-2.52424 2.25646,-3.95432 l 0.36083,-0.59112 z"
+           style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;enable-background:accumulate"
+           inkscape:connector-curvature="0" />
+        <g
+           id="g5011"
+           transform="matrix(0.50000001,0,0,0.50000006,-32.00001,-169.81897)"
+           style="display:inline">
+          <rect
+             transform="translate(0,804.3622)"
+             y="152"
+             x="288"
+             height="48"
+             width="48"
+             id="rect5013"
+             style="opacity:0.21171169;fill:none;stroke:none" />
+        </g>
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/static/js/tryit.js b/static/js/tryit.js
index 85ebc69..6cfa070 100644
--- a/static/js/tryit.js
+++ b/static/js/tryit.js
@@ -316,17 +316,11 @@ $(document).ready(function() {
     });
 
     $('.tabNext').click(function(){
-        $('.nav-tabs > .active').next('li').find('a').trigger('click');
-
-        if (feedback == false && $('.nav-tabs > .active').find('a').attr('href') == "#conclusion") {
+        if (feedback == false && $(this).attr('href') == "#conclusion") {
             $('#tryit_feedback').css("display", "inherit");
         }
     });
 
-    $('.tabPrevious').click(function(){
-        $('.nav-tabs > .active').prev('li').find('a').trigger('click');
-    });
-
     $('#tryit_feedback_submit').submit(function(event) {
         event.preventDefault();
 
diff --git a/templates/common/base.tpl.html b/templates/common/base.tpl.html
index 5223e99..4b052e2 100644
--- a/templates/common/base.tpl.html
+++ b/templates/common/base.tpl.html
@@ -54,6 +54,7 @@
 {% include ["common/footer." + page_language[0] + ".tpl.html", "common/footer.tpl.html"] %}
 
             <script src="/static/js/jquery.min.js"></script>
+            <script src="/static/js/bootstrap-rating.min.js"></script>
         </div>
     </body>
 </html>


More information about the lxc-devel mailing list