Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Use an icon to show the status of a user setting, not 'ON'/'OFF' text

Roland Geider2e9568cd3b33
diff --git a/manager/static/images/icons/status-off.svg b/manager/static/images/icons/status-off.svg
new file mode 100644
index 000000000..a7c953fe9
--- /dev/null
+++ b/manager/static/images/icons/status-off.svg
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) --><svg height="48px" id="svg7216" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.46" sodipodi:docname="drawing.svg" sodipodi:version="0.32" width="48px" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <metadata>
+ <rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <cc:Work rdf:about="">
+ <dc:title></dc:title>
+ <dc:description></dc:description>
+ <dc:subject>
+ <rdf:Bag>
+ <rdf:li>unsorted</rdf:li>
+ </rdf:Bag>
+ </dc:subject>
+ <dc:publisher>
+ <cc:Agent rdf:about="http://www.openclipart.org/">
+ <dc:title>Open Clip Art Library, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors</dc:title>
+ </cc:Agent>
+ </dc:publisher>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:rights>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:rights>
+ <dc:date></dc:date>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <cc:license rdf:resource="http://creativecommons.org/licenses/GPL/2.0/"/>
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs id="defs7218">
+ <linearGradient id="linearGradient7916">
+ <stop id="stop7918" offset="0" style="stop-color:#ffffff;stop-opacity:1;"/>
+ <stop id="stop7920" offset="1.0000000" style="stop-color:#ffffff;stop-opacity:0"/>
+ </linearGradient>
+ <linearGradient gradientTransform="matrix(1.0494758,-1.0494758,1.0494758,1.0494758,-26.939092,23.169297)" gradientUnits="userSpaceOnUse" id="linearGradient2181" inkscape:collect="always" x1="31.972097" x2="12.717501" xlink:href="#linearGradient7916" y1="17.041941" y2="36.296539"/>
+ <linearGradient id="linearGradient7955" inkscape:collect="always">
+ <stop id="stop7957" offset="0" style="stop-color:#c22f2f;stop-opacity:1"/>
+ <stop id="stop7959" offset="1" style="stop-color:#a40000;stop-opacity:1"/>
+ </linearGradient>
+ <linearGradient gradientUnits="userSpaceOnUse" id="linearGradient7961" inkscape:collect="always" x1="23.172504" x2="23.099995" xlink:href="#linearGradient7955" y1="6.0004601" y2="43.000458"/>
+ <linearGradient id="linearGradient3165">
+ <stop id="stop3167" offset="0" style="stop-color:#e78181;stop-opacity:1"/>
+ <stop id="stop8599" offset="0.25" style="stop-color:#e15f5f;stop-opacity:1"/>
+ <stop id="stop8601" offset="0.68000001" style="stop-color:#c22f2f;stop-opacity:1"/>
+ <stop id="stop3169" offset="1" style="stop-color:#a40000;stop-opacity:1"/>
+ </linearGradient>
+ <radialGradient cx="6.5734448" cy="24.500458" fx="6.5734448" fy="24.500458" gradientTransform="matrix(-2.1314195e-8,2.5479117,-4.8841578,-2.2328085e-8,144.16406,-10.748097)" gradientUnits="userSpaceOnUse" id="radialGradient7958" inkscape:collect="always" r="18.500046" xlink:href="#linearGradient3165"/>
+ <linearGradient id="linearGradient2091">
+ <stop id="stop2093" offset="0" style="stop-color:#000000;stop-opacity:1;"/>
+ <stop id="stop2095" offset="1" style="stop-color:#000000;stop-opacity:0;"/>
+ </linearGradient>
+ <radialGradient cx="23.070683" cy="35.127438" fx="23.070683" fy="35.127438" gradientTransform="matrix(0.914812,1.265023e-2,-8.21502e-3,0.213562,2.253914,27.18889)" gradientUnits="userSpaceOnUse" id="radialGradient2177" inkscape:collect="always" r="10.31934" xlink:href="#linearGradient2091"/>
+ </defs>
+ <sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="24" inkscape:cy="24" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="690" inkscape:window-width="641" inkscape:window-x="0" inkscape:window-y="25" inkscape:zoom="7" pagecolor="#ffffff" showgrid="true"/>
+ <g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
+ <path d="M 33.278212,34.94062 A 10.31934,2.320194 0 1 1 12.639532,34.94062 A 10.31934,2.320194 0 1 1 33.278212,34.94062 z" id="path1361" sodipodi:cx="22.958872" sodipodi:cy="34.94062" sodipodi:rx="10.31934" sodipodi:ry="2.320194" sodipodi:type="arc" style="opacity:0.2557078;fill:url(#radialGradient2177);fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" transform="matrix(2.2288248,0,0,1.9190478,-27.171303,-25.505284)"/>
+ <path d="M 42.5,35.000459 L 31.99991,24.000459 L 42.499911,14.000459 L 34.99991,6.5004602 L 24.499911,17.000459 L 13.999912,6.5004602 L 6.4999133,14.000459 L 16.999911,24.000459 L 6.4999133,35.000459 L 13.999912,42.500458 L 24.499911,32.000458 L 33.999911,42.500458 L 42.5,35.000459 z" id="text1314" sodipodi:nodetypes="ccccccccccccc" style="font-size:59.90107727px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#radialGradient7958);fill-opacity:1;stroke:url(#linearGradient7961);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"/>
+ <path d="M 41,35.000459 L 30.49991,24.000459 L 40.99991,14.000459 L 34.99991,8.0004592 L 24.50022,18.500459 L 13.999912,8.0004592 L 7.9999123,14.000459 L 18.499911,24.000459 L 7.9999123,35.000459 L 13.999912,41.000459 L 24.499911,30.500459 L 34,41 L 41,35.000459 z" id="path7076" sodipodi:nodetypes="ccccccccccccc" style="font-size:59.90107727px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;opacity:0.4;fill:none;fill-opacity:1;stroke:url(#linearGradient2181);stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"/>
+ </g>
+</svg>
diff --git a/manager/static/images/icons/status-on.svg b/manager/static/images/icons/status-on.svg
new file mode 100644
index 000000000..25a523f79
--- /dev/null
+++ b/manager/static/images/icons/status-on.svg
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) --><svg height="48px" id="svg7976" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:version="0.46" sodipodi:docname="drawing.svg" sodipodi:version="0.32" width="48px" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <metadata>
+ <rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <cc:Work rdf:about="">
+ <dc:title></dc:title>
+ <dc:description></dc:description>
+ <dc:subject>
+ <rdf:Bag>
+ <rdf:li>unsorted</rdf:li>
+ </rdf:Bag>
+ </dc:subject>
+ <dc:publisher>
+ <cc:Agent rdf:about="http://www.openclipart.org/">
+ <dc:title>Open Clip Art Library, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors</dc:title>
+ </cc:Agent>
+ </dc:publisher>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:rights>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:rights>
+ <dc:date></dc:date>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <cc:license rdf:resource="http://creativecommons.org/licenses/GPL/2.0/"/>
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs id="defs7978">
+ <linearGradient id="linearGradient7948" inkscape:collect="always">
+ <stop id="stop7950" offset="0" style="stop-color:#ffffff;stop-opacity:0"/>
+ <stop id="stop7952" offset="1" style="stop-color:#ffffff;stop-opacity:1"/>
+ </linearGradient>
+ <linearGradient gradientUnits="userSpaceOnUse" id="linearGradient7954" inkscape:collect="always" x1="-81.959923" x2="-91.354408" xlink:href="#linearGradient7948" y1="35.301952" y2="-8.3031855"/>
+ <linearGradient id="linearGradient1731">
+ <stop id="stop1733" offset="0" style="stop-color:#b8d67a;stop-opacity:1"/>
+ <stop id="stop1735" offset="1" style="stop-color:#789e2d;stop-opacity:1;"/>
+ </linearGradient>
+ <linearGradient gradientTransform="translate(0.5271438,-2.3199355e-2)" gradientUnits="userSpaceOnUse" id="linearGradient1455" inkscape:collect="always" x1="-85.334991" x2="-91.536674" xlink:href="#linearGradient1731" y1="-6.8188653" y2="27.080305"/>
+ <linearGradient id="linearGradient8662" inkscape:collect="always">
+ <stop id="stop8664" offset="0" style="stop-color:#000000;stop-opacity:1;"/>
+ <stop id="stop8666" offset="1" style="stop-color:#000000;stop-opacity:0;"/>
+ </linearGradient>
+ <radialGradient cx="24.837126" cy="36.421127" fx="24.837126" fy="36.421127" gradientTransform="matrix(1,0,0,0.536723,0,16.87306)" gradientUnits="userSpaceOnUse" id="radialGradient1444" inkscape:collect="always" r="15.644737" xlink:href="#linearGradient8662"/>
+ </defs>
+ <sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="17.79899" inkscape:cy="21.497325" inkscape:document-units="px" inkscape:grid-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="1000" inkscape:window-width="1680" inkscape:window-x="0" inkscape:window-y="25" inkscape:zoom="14" pagecolor="#ffffff" showgrid="true"/>
+ <g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
+ <path d="M 40.481863,36.421127 A 15.644737,8.3968935 0 1 1 9.1923885,36.421127 A 15.644737,8.3968935 0 1 1 40.481863,36.421127 z" id="path8660" sodipodi:cx="24.837126" sodipodi:cy="36.421127" sodipodi:rx="15.644737" sodipodi:ry="8.3968935" sodipodi:type="arc" style="opacity:0.20454544;fill:url(#radialGradient1444);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" transform="matrix(1.214466,0,0,0.595458,-6.1638433,20.312751)"/>
+ <g id="g1529" inkscape:label="Layer 1" transform="translate(111.7398,15.579231)">
+ <g id="g1450" transform="matrix(1.017301,-0.243559,0.243559,1.017301,-1.745715,-23.38258)">
+ <path d="M -73.881889,-4.6293179 C -74.389631,-4.8067199 -74.968019,-4.6757149 -75.352541,-4.2504169 L -91.734788,13.86571 L -97.664774,6.2884221 C -98.231838,5.7757261 -99.100737,5.8101851 -99.613436,6.3772491 L -103.90755,9.8077721 C -104.42024,10.374832 -104.37524,11.245996 -103.80818,11.75869 C -103.80818,11.75869 -93.079342,26.005593 -93.064798,26.017716 C -92.931895,26.137881 -92.782055,26.218205 -92.624431,26.277658 C -92.109522,26.471875 -91.506409,26.352506 -91.113876,25.918351 L -69.020292,1.4865271 C -68.507598,0.91946515 -68.552594,0.048303155 -69.11966,-0.46439283 L -73.40162,-4.3497839 C -73.543388,-4.4779589 -73.712642,-4.5701849 -73.881889,-4.6293179 z" id="path1542" sodipodi:nodetypes="cccccccssccccc" style="fill:url(#linearGradient1455);fill-opacity:1;fill-rule:nonzero;stroke:#42770c;stroke-width:0.95597649;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
+ <path d="M -74.978545,-3.2016699 L -83.289347,6.0212271 L -90.672863,14.143297 C -90.879108,14.271935 -90.955853,14.816814 -91.724224,14.828343 C -92.255838,14.83632 -92.301842,14.628226 -92.748497,14.162478 L -97.987967,7.5093115 C -98.568531,6.7592215 -98.553829,6.7944924 -99.185739,7.1858061 L -102.56429,9.8385081 C -103.44236,10.41927 -103.44231,10.897191 -102.70467,11.663785 C -102.70467,11.663785 -92.945374,24.597046 -92.931619,24.608516 C -92.805911,24.722171 -92.8741,24.734491 -92.355719,25.314704 C -92.023194,25.686891 -91.460716,24.892021 -91.091836,24.484045 L -69.849981,1.0476071 C -69.36818,0.51473817 -69.395599,0.51691517 -69.931971,0.031992155 L -73.780932,-3.3612149 C -74.334112,-3.8587709 -74.338372,-3.8556239 -74.978545,-3.2016699 z" id="path1544" sodipodi:nodetypes="cccscccccssccccc" style="opacity:0.4;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient7954);stroke-width:0.95597649;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/manager/static/js/workout-manager.js b/manager/static/js/workout-manager.js
index f005cb551..7faac9702 100644
--- a/manager/static/js/workout-manager.js
+++ b/manager/static/js/workout-manager.js
@@ -118,12 +118,12 @@ function set_english_ingredients()
if ( useEnglishIngredients == 0 )
{
- $('#english-ingredients-status').html('ON')
+ $('#english-ingredients-status').attr("src", "/static/images/icons/status-on.svg");
useEnglishIngredients = 1;
}
else if ( useEnglishIngredients == 1 )
{
- $('#english-ingredients-status').html('OFF')
+ $('#english-ingredients-status').attr("src", "/static/images/icons/status-off.svg");
useEnglishIngredients = 0;
}
diff --git a/nutrition/templates/view_nutrition_plan.html b/nutrition/templates/view_nutrition_plan.html
index bd1e8b5dc..df761b8e6 100644
--- a/nutrition/templates/view_nutrition_plan.html
+++ b/nutrition/templates/view_nutrition_plan.html
@@ -22,10 +22,10 @@ $(document).ready(function() {
{% if user.userprofile.show_english_ingredients %}
useEnglishIngredients = 1;
- $('#english-ingredients-status').html('ON')
+ $('#english-ingredients-status').attr("src", "{% static 'images/icons/status-on.svg' %}");
{% else %}
useEnglishIngredients = 0;
- $('#english-ingredients-status').html('OFF')
+ $('#english-ingredients-status').attr("src", "{% static 'images/icons/status-off.svg' %}");
{% endif %}
// Add a flag indicating we are using javascript. Depending on this we show a drop down list
@@ -161,7 +161,11 @@ $(document).ready(function() {
<p>
{% trans "If you find the ingredient list too short, you might want to activate the preference to also show English ingredients." %}
<a href="{% url manager.views.preferences %}" id="ajax-english-ingredients">{% trans "That's done here" %}</a>:
- <span id="english-ingredients-status"></span>
+ <img src="{% static 'images/icons/status-on.svg' %}"
+ width="20"
+ height="20"
+ alt="{% trans 'Delete nutrition plan' %}"
+ id="english-ingredients-status">
</p>
{% endif %}