[extensions-web] Show a "plugin icon" for extensions without an icon by default instead of nothing
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Show a "plugin icon" for extensions without an icon by default instead of nothing
- Date: Tue, 25 Oct 2011 01:32:13 +0000 (UTC)
commit 7676eb5e745f63cad91426884f6e25d5aa728c96
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Oct 24 21:31:23 2011 -0400
Show a "plugin icon" for extensions without an icon by default instead of nothing
etc/plugin.svg | 205 ++++++++++++++++++++
.../extensions/migrations/0008_new_icon_default.py | 89 +++++++++
sweettooth/extensions/models.py | 2 +-
.../extensions/templates/extensions/detail.html | 6 -
.../templates/extensions/detail_edit.html | 9 +-
sweettooth/static/images/plugin.png | Bin 0 -> 1945 bytes
6 files changed, 296 insertions(+), 15 deletions(-)
---
diff --git a/etc/plugin.svg b/etc/plugin.svg
new file mode 100644
index 0000000..2e05f2f
--- /dev/null
+++ b/etc/plugin.svg
@@ -0,0 +1,205 @@
+<?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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="36"
+ height="36"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.1 r9760"
+ sodipodi:docname="plugin.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3976">
+ <stop
+ style="stop-color:#4e9a06;stop-opacity:1"
+ offset="0"
+ id="stop3978" />
+ <stop
+ style="stop-color:#4e9a06;stop-opacity:0"
+ offset="1"
+ id="stop3980" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3931">
+ <stop
+ style="stop-color:#eeeeec;stop-opacity:1;"
+ offset="0"
+ id="stop3933" />
+ <stop
+ style="stop-color:#eeeeec;stop-opacity:0;"
+ offset="1"
+ id="stop3935" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3931"
+ id="linearGradient3993"
+ gradientUnits="userSpaceOnUse"
+ x1="217.61458"
+ y1="343.49124"
+ x2="217.01712"
+ y2="367.02194" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3976"
+ id="linearGradient3995"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,-69.385322)"
+ x1="209.89964"
+ y1="456.35876"
+ x2="208.1378"
+ y2="444.91559" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3931"
+ id="linearGradient4051"
+ gradientUnits="userSpaceOnUse"
+ x1="217.61458"
+ y1="343.49124"
+ x2="217.01712"
+ y2="367.02194" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3976"
+ id="linearGradient4053"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,-69.385322)"
+ x1="209.89964"
+ y1="456.35876"
+ x2="208.1378"
+ y2="444.91559" />
+ <filter
+ inkscape:collect="always"
+ id="filter4077"
+ x="-0.43139305"
+ width="1.8627861"
+ y="-0.80651745"
+ height="2.6130349">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.5544576"
+ id="feGaussianBlur4079" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4083"
+ x="-0.06362069"
+ width="1.1272414"
+ y="-1.0542857"
+ height="3.1085715">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.61843439"
+ id="feGaussianBlur4085" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="4.9722332"
+ inkscape:cx="99.757859"
+ inkscape:cy="29.95778"
+ inkscape:document-units="px"
+ inkscape:current-layer="g3984"
+ showgrid="false"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1142"
+ inkscape:window-x="0"
+ inkscape:window-y="26"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <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(0,-1016.3622)">
+ <g
+ id="g3984"
+ transform="matrix(0.48483793,0,0,0.49246455,92.696046,200.50034)">
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.8;color:#000000;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter4083);enable-background:new"
+ id="path4081"
+ sodipodi:cx="20.715038"
+ sodipodi:cy="31.474871"
+ sodipodi:rx="11.664779"
+ sodipodi:ry="0.70390904"
+ d="m 32.379817,31.474871 a 11.664779,0.70390904 0 1 1 -23.3295574,0 11.664779,0.70390904 0 1 1 23.3295574,0 z"
+ transform="matrix(2.0625449,0,0,2.030603,-191.18976,1658.7222)" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.4;color:#000000;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter4077);enable-background:new"
+ id="path4055"
+ sodipodi:cx="20.614479"
+ sodipodi:cy="32.07822"
+ sodipodi:rx="4.3240128"
+ sodipodi:ry="2.312844"
+ d="m 24.938492,32.07822 a 4.3240128,2.312844 0 1 1 -8.648026,0 4.3240128,2.312844 0 1 1 8.648026,0 z"
+ transform="matrix(5.4825736,0,0,1.1703464,-265.22478,1685.6691)" />
+ <g
+ id="g4044"
+ transform="matrix(0.93590922,0,0,0.92325969,-352.83723,1356.8308)">
+ <path
+ style="color:#000000;fill:#73d216;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.39999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 218.45521,330.14286 c -6.35066,0 -11.50513,3.61124 -11.50513,8.07177 0,1.22827 2.34001,3.4341 1.09365,3.4341 -4.29802,0 -12.89406,0 -12.89406,0 -1.55105,0 -2.79972,1.26074 -2.79972,2.82677 l 0,13.11802 c 0,1.54489 -2.53488,-1.55694 -3.9918,-1.55694 -4.41785,0 -8.00547,5.19323 -8.00547,11.60524 0,6.41202 3.58762,11.61629 8.00547,11.61629 1.45572,0 3.9918,-3.10036 3.9918,-1.55693 l 0,13.6149 c 0,1.56604 1.24867,2.82678 2.79972,2.82678 l 14.32673,0 c 2.09035,0 -2.52632,-3.13558 -2.52632,-5.04624 0,-4.46053 5.15447,-8.07177 11.50513,-8.07177 6.35065,0 11.49419,3.61124 11.49419,8.07177 0,1.91066 -4.61667,5.04624 -2.52632,5.04624 l 14.12987,0 c 1.55105,0 2.79973,-1.26074 2.79973,-2.82678 l 0,-15.24913 c 0,-2.44707 -3.36931,3.19116 -5.50103,3.19116 -4.41784,0 -8.00546,-5.20427 -8.00546,-11.61629 0,-6.41201 3.58762,-11.60524 8.00546,-11.60524 2.13057,0 5.50103,5.62553 5.50103,3.18012 l 0,-14.7412 c 0,-1.56603 -1.24868,-2.82677 -2.79973,-2.82677 0,0 -8.46479,0 -12.697
19,0 -1.24637,0 1.09364,-2.20583 1.09364,-3.4341 0,-4.46053 -5.14354,-8.07177 -11.49419,-8.07177 z"
+ id="rect2987"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssssssssssssssssssssssssss" />
+ <path
+ d="m 218.46875,332.4375 c -2.73731,0 -5.21003,0.7972 -6.84375,1.9375 -1.59392,1.11252 -2.3297,2.4172 -2.375,3.71875 0.0174,0.0437 0.0391,0.0806 0.0625,0.125 0.12015,0.22829 0.35063,0.56897 0.59375,0.96875 0.18909,0.31093 0.58509,0.8103 0.75,1.65625 0.0997,0.51133 0.13038,1.4317 -0.5625,2.21875 -0.67063,0.76177 -1.58662,0.875 -2.0625,0.875 l -12.875,0 c -0.34395,0 -0.53125,0.17642 -0.53125,0.53125 l 0,13.125 c 0,0.41973 -0.0592,1.41623 -0.875,2.125 -0.8611,0.74809 -1.86185,0.66324 -2.4375,0.5 -0.88897,-0.2521 -1.38151,-0.70576 -1.75,-0.96875 -0.4383,-0.31281 -0.89705,-0.63744 -1.1875,-0.8125 -0.0759,-0.0457 -0.12276,-0.0665 -0.1875,-0.0937 -1.25191,0.0575 -2.49388,0.80727 -3.59375,2.40625 -1.1371,1.6531 -1.96875,4.13352 -1.96875,6.90625 0,2.77252 0.83214,5.22875 1.96875,6.875 1.09949,1.59249 2.34062,2.34814 3.59375,2.40625 0.0648,-0.0273 0.11169,-0.0481 0.1875,-0.0937 0.29017,-0.17484 0.74889,-0.49961 1.1875,-0.8125 0.36862,-0.26296 0.86156,-0.71665 1.75,-0.96875 0
.56439,-0.16014 1.55595,-0.23722 2.40625,0.5 0.80617,0.69896 0.90625,1.66307 0.90625,2.125 l 0,13.625 c 0,0.34077 0.24144,0.5625 0.53125,0.5625 l 10.5,0 c -0.46774,-0.67461 -1,-1.55336 -1,-2.78125 0,-3.11925 1.79926,-5.78651 4.34375,-7.5625 2.53622,-1.77022 5.86102,-2.78125 9.46875,-2.78125 3.60736,0 6.91509,1.0074 9.4375,2.78125 2.53076,1.77972 4.3125,4.45265 4.3125,7.5625 0,1.2455 -0.56761,2.11543 -1.03125,2.78125 l 10.375,0 c 0.3044,0 0.5,-0.16972 0.5,-0.5625 l 0,-11.15625 c -0.0128,0.0103 -0.0183,0.021 -0.0312,0.0312 -0.73248,0.58309 -1.73293,1.34375 -3.1875,1.34375 -3.10983,0 -5.79975,-1.82186 -7.5625,-4.375 -1.75696,-2.54476 -2.71875,-5.86994 -2.71875,-9.5 0,-3.63023 0.96263,-6.97823 2.71875,-9.53125 1.76184,-2.56134 4.45099,-4.375 7.5625,-4.375 1.45456,0 2.45515,0.76087 3.1875,1.34375 0.0129,0.0103 0.0185,0.021 0.0312,0.0312 l 0,-10.65625 c 0,-0.40648 -0.14185,-0.53125 -0.5,-0.53125 l -12.71875,0 c -0.47588,0 -1.39187,-0.11323 -2.0625,-0.875 -0.69288,-0.78705 -0.66218
,-1.70742 -0.5625,-2.21875 0.16491,-0.84595 0.56091,-1.34532 0.75,-1.65625 0.24312,-0.39978 0.4736,-0.74046 0.59375,-0.96875 0.0234,-0.0444 0.0451,-0.0813 0.0625,-0.125 -0.0462,-1.30403 -0.79412,-2.60702 -2.375,-3.71875 -1.62013,-1.13934 -4.04438,-1.9375 -6.78125,-1.9375 z"
+ id="path4023"
+ style="color:#000000;fill:none;stroke:#8ae234;stroke-width:2.04651165;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ inkscape:original="M 218.46875 331.625 C 215.57361 331.625 212.95533 332.46303 211.15625 333.71875 C 209.35717 334.97447 208.40625 336.56223 208.40625 338.21875 C 208.40625 338.05523 208.43901 338.29975 208.59375 338.59375 C 208.74849 338.88775 208.98756 339.24483 209.21875 339.625 C 209.44994 340.00517 209.70761 340.30162 209.84375 341 C 209.91182 341.34919 209.93025 342.00703 209.46875 342.53125 C 209.00725 343.05547 208.40595 343.125 208.03125 343.125 L 195.15625 343.125 C 194.39919 343.125 193.8125 343.69856 193.8125 344.46875 L 193.8125 357.59375 C 193.8125 357.99016 193.79555 358.59265 193.21875 359.09375 C 192.64195 359.59485 191.89852 359.54165 191.53125 359.4375 C 190.79671 359.22919 190.46076 358.90029 190.03125 358.59375 C 189.60174 358.28721 189.16306 357.96129 188.8125 357.75 C 188.46194 357.53871 188.18117 357.5 188.34375 357.5 C 186.71774 357.5 185.15473 358.46622 183.90625 360.28125 C 182.65777 362.09628 181.8125 364.72622 181.8125 367.65625 C 181.
8125 370.58628 182.65891 373.19336 183.90625 375 C 185.15359 376.80664 186.71424 377.78125 188.34375 377.78125 C 188.18068 377.78125 188.46193 377.74248 188.8125 377.53125 C 189.16307 377.32002 189.60167 376.99395 190.03125 376.6875 C 190.46083 376.38105 190.7973 376.05201 191.53125 375.84375 C 191.89823 375.73962 192.61007 375.68686 193.1875 376.1875 C 193.76493 376.68814 193.8125 377.29099 193.8125 377.6875 L 193.8125 391.3125 C 193.8125 392.0827 194.41908 392.6875 195.15625 392.6875 L 207.34375 392.6875 C 207.0298 392.32354 206.70858 391.98826 206.40625 391.5625 C 205.93458 390.89826 205.46875 390.16887 205.46875 389.09375 C 205.46875 386.28974 207.08987 383.8479 209.46875 382.1875 C 211.84763 380.5271 215.01323 379.5625 218.46875 379.5625 C 221.92426 379.5625 225.07313 380.52479 227.4375 382.1875 C 229.80187 383.85021 231.40625 386.29666 231.40625 389.09375 C 231.40625 390.16483 230.93686 390.86716 230.46875 391.53125 C 230.16432 391.96312 229.84657 392.31943 229.53125 3
92.6875 L 241.5625 392.6875 C 242.29967 392.6875 242.875 392.10242 242.875 391.3125 L 242.875 378.3125 C 242.45004 378.73166 242.03649 379.1603 241.53125 379.5625 C 240.81301 380.13425 240.02955 380.71875 238.84375 380.71875 C 236.05541 380.71875 233.61695 379.07473 231.96875 376.6875 C 230.32055 374.30027 229.375 371.13824 229.375 367.65625 C 229.375 364.17427 230.32169 360.98822 231.96875 358.59375 C 233.61581 356.19928 236.05192 354.5625 238.84375 354.5625 C 240.02942 354.5625 240.81311 355.14718 241.53125 355.71875 C 242.03642 356.12082 242.45002 356.54969 242.875 356.96875 L 242.875 344.46875 C 242.875 343.67885 242.31956 343.125 241.5625 343.125 L 228.84375 343.125 C 228.46905 343.125 227.86775 343.05547 227.40625 342.53125 C 226.94475 342.00703 226.96318 341.34919 227.03125 341 C 227.16739 340.30162 227.42506 340.00517 227.65625 339.625 C 227.88744 339.24483 228.12651 338.88775 228.28125 338.59375 C 228.43599 338.29975 228.46875 338.05523 228.46875 338.21875 C 228.468
75 336.55531 227.50109 334.97216 225.71875 333.71875 C 223.93641 332.46534 221.36389 331.625 218.46875 331.625 z "
+ inkscape:radius="-0.81790674"
+ sodipodi:type="inkscape:offset" />
+ <path
+ style="color:#000000;fill:none;stroke:#4e9a06;stroke-width:2.04651165;stroke-miterlimit:4;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 218.45521,330.14286 c -6.35066,0 -11.50513,3.61124 -11.50513,8.07177 0,1.22827 2.34001,3.4341 1.09365,3.4341 -4.29802,0 -12.89406,0 -12.89406,0 -1.55105,0 -2.79972,1.26074 -2.79972,2.82677 l 0,13.11802 c 0,1.54489 -2.53488,-1.55694 -3.9918,-1.55694 -4.41785,0 -8.00547,5.19323 -8.00547,11.60524 0,6.41202 3.58762,11.61629 8.00547,11.61629 1.45572,0 3.9918,-3.10036 3.9918,-1.55693 l 0,13.6149 c 0,1.56604 1.24867,2.82678 2.79972,2.82678 l 14.32673,0 c 2.09035,0 -2.52632,-3.13558 -2.52632,-5.04624 0,-4.46053 5.15447,-8.07177 11.50513,-8.07177 6.35065,0 11.49419,3.61124 11.49419,8.07177 0,1.91066 -4.61667,5.04624 -2.52632,5.04624 l 6.69651,0 7.43336,0 c 1.55105,0 2.79973,-1.26074 2.79973,-2.82678 l 0,-15.24913 c 0,-2.44707 -3.36931,3.19116 -5.50103,3.19116 -4.41784,0 -8.00546,-5.20427 -8.00546,-11.61629 0,-6.41201 3.58762,-11.60524 8.00546,-11.60524 2.13057,0 5.50103,5.62553 5.50103,3.18012 l 0,-14.7412 c 0,-1.56603 -1.24868,-2.82677 -2.79973,-2.82677 0,0 -8.46479,
0 -12.69719,0 -1.24637,0 1.09364,-2.20583 1.09364,-3.4341 0,-4.46053 -5.14354,-8.07177 -11.49419,-8.07177 z"
+ id="rect2987-9"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ssssssssssssssssscssssssssssss" />
+ <path
+ style="opacity:0.6;color:#000000;fill:url(#linearGradient4051);fill-opacity:1;stroke:none;stroke-width:1.39999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 218,335.1875 c -3.4988,0.24718 -5.3388,1.31334 -5.3388,3.8125 5.91273,8.19028 -7.62168,8.42315 -14.69241,8.3431 l 0,20.0944 28.65621,0 c -0.009,-0.24097 -0.0312,-0.47447 -0.0312,-0.71875 0,-3.48198 1.94669,-7.66803 3.59375,-10.0625 1.64706,-2.39447 5.08317,-4.03125 7.875,-4.03125 0.24635,0 0.47284,0.0174 0.6875,0.0625 l 0,-5.3444 c -13.10088,-0.91578 -18.71251,-0.0533 -13.9737,-8.3431 0,-2.66577 -2.2255,-3.8125 -6.05755,-3.8125 -0.2395,0 -0.48492,0 -0.71875,0 z"
+ id="path3843-8"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccssscccssc" />
+ <path
+ style="opacity:0.6;color:#000000;fill:url(#linearGradient4053);fill-opacity:1;stroke:none;stroke-width:1.39999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 195.96875,378.30218 0,10.81315 7.625,0 c -1.099,-4.74299 1.275,-7.65327 4.36293,-9.7958 2.79665,-1.952 6.65278,-2.16492 10.51207,-2.16492 -9.75733,-8.3351 -22.02762,-15.30034 -22.5,1.14757 z"
+ id="path3843-5"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccc" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/sweettooth/extensions/migrations/0008_new_icon_default.py b/sweettooth/extensions/migrations/0008_new_icon_default.py
new file mode 100644
index 0000000..fddc1bf
--- /dev/null
+++ b/sweettooth/extensions/migrations/0008_new_icon_default.py
@@ -0,0 +1,89 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import DataMigration
+from django.db import models
+
+class Migration(DataMigration):
+
+ def forwards(self, orm):
+ "Write your forwards methods here."
+ new_default = orm.Extension._meta.get_field_by_name('icon')[0].default
+ for ext in orm.Extension.objects.filter(icon=""):
+ ext.icon = new_default
+ ext.save()
+
+ def backwards(self, orm):
+ "Write your backwards methods here."
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'extensions.extension': {
+ 'Meta': {'object_name': 'Extension'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+ 'description': ('django.db.models.fields.TextField', [], {}),
+ 'icon': ('django.db.models.fields.files.ImageField', [], {'default': "'/static/images/plugin.png'", 'max_length': '100', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ 'screenshot': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100', 'blank': 'True'}),
+ 'slug': ('autoslug.fields.AutoSlugField', [], {'unique_with': '()', 'max_length': '50', 'populate_from': 'None', 'db_index': 'True'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200', 'db_index': 'True'})
+ },
+ 'extensions.extensionversion': {
+ 'Meta': {'unique_together': "(('extension', 'version'),)", 'object_name': 'ExtensionVersion'},
+ 'extension': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'versions'", 'to': "orm['extensions.Extension']"}),
+ 'extra_json_fields': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'shell_versions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['extensions.ShellVersion']", 'symmetrical': 'False'}),
+ 'source': ('django.db.models.fields.files.FileField', [], {'max_length': '223'}),
+ 'status': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'version': ('django.db.models.fields.IntegerField', [], {'default': '0'})
+ },
+ 'extensions.shellversion': {
+ 'Meta': {'object_name': 'ShellVersion'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'major': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'minor': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'point': ('django.db.models.fields.IntegerField', [], {})
+ }
+ }
+
+ complete_apps = ['extensions']
diff --git a/sweettooth/extensions/models.py b/sweettooth/extensions/models.py
index e1ee881..914154f 100644
--- a/sweettooth/extensions/models.py
+++ b/sweettooth/extensions/models.py
@@ -58,7 +58,7 @@ class Extension(models.Model):
def make_icon_filename(self, filename):
return os.path.join(self.uuid, "icons/", filename)
- icon = models.ImageField(upload_to=make_icon_filename, blank=True, default="")
+ icon = models.ImageField(upload_to=make_icon_filename, blank=True, default="/static/images/plugin.png")
objects = ExtensionManager()
diff --git a/sweettooth/extensions/templates/extensions/detail.html b/sweettooth/extensions/templates/extensions/detail.html
index c9b57e1..27f87ea 100644
--- a/sweettooth/extensions/templates/extensions/detail.html
+++ b/sweettooth/extensions/templates/extensions/detail.html
@@ -28,15 +28,9 @@
data-pk="{{ version.pk }}">
<div class="switch"></div>
- {% if extension.icon %}
{% block icon %}
<img src="{{ extension.icon.url }}" class="icon">
{% endblock icon %}
- {% else %}
- {% block no-icon %}
- <div class="no-icon"></div>
- {% endblock %}
- {% endif %}
{% if extension.screenshot %}
{% thumbnail extension.screenshot "300x200" as th %}
diff --git a/sweettooth/extensions/templates/extensions/detail_edit.html b/sweettooth/extensions/templates/extensions/detail_edit.html
index 48265bc..764d086 100644
--- a/sweettooth/extensions/templates/extensions/detail_edit.html
+++ b/sweettooth/extensions/templates/extensions/detail_edit.html
@@ -66,14 +66,7 @@
{% block icon %}
<div class="icon upload">
- <img src="{{ extension.icon.url }}" />
- <input type="file" accept="image/*">
-</div>
-{% endblock %}
-
-{% block no-icon %}
-<div class="icon upload placeholder">
- <div class="dummy"></div>
+ <img src="{{ extension.icon.url }}">
<input type="file" accept="image/*">
</div>
{% endblock %}
diff --git a/sweettooth/static/images/plugin.png b/sweettooth/static/images/plugin.png
new file mode 100644
index 0000000..55cb660
Binary files /dev/null and b/sweettooth/static/images/plugin.png differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]