Mikhail Korobov avatar Mikhail Korobov committed a96746c

Do not show uploader in add form. Fix #4.

Comments (0)

Files changed (2)

generic_images/templates/generic_images/attached_images_inline.html

 {{ inline_admin_formset.formset.management_form }}
 <fieldset class="module">
    <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}:</h2>
-   <div id='gears-please-install' class='form-row'>
-       {% blocktrans %}
-           Please install or update Google's
-           <a href='http://gears.google.com/?action=install'>Gears</a> plugin
-           in order to enable advanced image uploader.
-       {% endblocktrans %}
-   </div>
-   <div id='gears-uploader' class='form-row'>
-        <input type='checkbox' id='gears-resize-needed' {{ inline_admin_formset.opts.max_w|yesno:"checked," }}>
-        <label for='gears-resize-needed'>{% trans "Resize if width is greater than " %}</label>
-        <input type='text' id='gears-resize-width' value='{{ inline_admin_formset.opts.max_w }}' size='4'> px
-        <br>
-        <input type='button' value='{% trans "Select images to upload" %}' id='select-handler'>
-        <input type='button' value='{% trans "Upload images" %}' id='upload-handler'>
-        <span id='upload-status'></span>
-        <span id='request-user-id'>{{ request.user.pk }}</span>
 
-        <div class='container'>
-            <div id='progress-bar'></div>
-            <div class='clear'></div>
-        </div>
+   {% if original %}
+       <div id='gears-please-install' class='form-row'>
+           {% blocktrans %}
+               Please install or update Google's
+               <a href='http://gears.google.com/?action=install'>Gears</a> plugin
+               in order to enable advanced image uploader.
+           {% endblocktrans %}
+       </div>
+       <div id='gears-uploader' class='form-row'>
+            <input type='checkbox' id='gears-resize-needed' {{ inline_admin_formset.opts.max_w|yesno:"checked," }}>
+            <label for='gears-resize-needed'>{% trans "Resize if width is greater than " %}</label>
+            <input type='text' id='gears-resize-width' value='{{ inline_admin_formset.opts.max_w }}' size='4'> px
+            <br>
+            <input type='button' value='{% trans "Select images to upload" %}' id='select-handler'>
+            <input type='button' value='{% trans "Upload images" %}' id='upload-handler'>
+            <span id='upload-status'></span>
+            <span id='request-user-id'>{{ request.user.pk }}</span>
 
-        <div id='thumbs'></div>
-   </div>
+            <div class='container'>
+                <div id='progress-bar'></div>
+                <div class='clear'></div>
+            </div>
+
+            <div id='thumbs'></div>
+       </div>
+   {% endif %}
 
    <div id='standard-inline'>
        {{ inline_admin_formset.formset.non_form_errors }}
 
 setup(
       name='django-generic-images',
-      version='0.35.6',
+      version='0.35.7',
       author='Mikhail Korobov',
       author_email='kmike84@gmail.com',
       url='http://bitbucket.org/kmike/django-generic-images/',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.