[IMP] website: media editor: insert add button for image loader and fix try_remove don't remove image

bzr revid: chm@openerp.com-20140407074922-zri6j4u9sw52nkkw
This commit is contained in:
chm@openerp.com
2014-04-07 09:49:22 +02:00
parent 26d62c4e55
commit ee4b879536
3 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -638,7 +638,7 @@ class ir_attachment(osv.osv):
# in-document URLs are html-escaped, a straight search will not
# find them
url = werkzeug.utils.escape(attachment.website_url)
ids = Views.search(cr, uid, [('arch', 'like', url)], context=context)
ids = Views.search(cr, uid, ["|", ('arch', 'like', '"%s"' % url), ('arch', 'like', "'%s'" % url)], context=context)
if ids:
removal_blocked_by[attachment.id] = Views.read(
@@ -1429,9 +1429,6 @@
this.$('input[type=file]').click();
},
'change input[type=file]': 'file_selection',
'change input[type=text]': function () {
this.$('form').submit();
},
'submit form': 'form_submit',
//'change input.url': 'preview_image',
//'change select.image-style': 'preview_image',
@@ -153,14 +153,15 @@
<button type="button" class="btn hidden wait" disabled="disabled">Uploading...</button>
</div>
<span class="text-muted">— or —</span>
<div class="form-group">
<label for="iamgeurl">Image URL</label>
<input type="text" name="url" class="form-control url" style="width: 300px;" id="iamgeurl" placeholder="http://openerp.com"/>
<label for="iamgeurl">Image URL</label>
<div class="form-group btn-group">
<input type="text" name="url" class="form-control url" style="width: 320px; float: left;" id="iamgeurl" placeholder="http://openerp.com"/>
<button class="btn btn-primary" type="submit">Add</button>
</div>
</div>
<input type="hidden" name="func"/>
<div class="existing-attachments"/>
<div class="help-block"/>
<div class="existing-attachments"/>
</form>
</div>
<iframe src="about:blank" name="fileframe" class="hidden"/>