瀏覽代碼

Fix display justif issue

master
tr4ck3ur des JM2L 8 年之前
父節點
當前提交
1cd333acc0
共有 3 個文件被更改,包括 25 次插入20 次删除
  1. +5
    -9
      jm2l/templates/Staff/compta.mako
  2. +7
    -3
      jm2l/templates/helpers.mako
  3. +13
    -8
      jm2l/upload.py

+ 5
- 9
jm2l/templates/Staff/compta.mako 查看文件

@@ -3,9 +3,6 @@
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
<%namespace name="h" file="jm2l:templates/helpers.mako"/>
<%def name="jsAddOn()">
<script src="/js/jm2l.js"></script>
<script src="/vendor/ckeditor/ckeditor.js"></script>
<script src="/vendor/select2/js/select2.js"></script>
</%def>
<%def name="cssAddOn()">
<link rel="stylesheet" href="/vendor/fileupload/css/jquery.fileupload.css">
@@ -58,19 +55,18 @@
</td>
% if one_dic.has_key("Justif"):
<td style="text-align:center;">
${h.uploader("Justif", one_dic["User"]["uid"], "Justif")}
${h.uploader("Justif", one_dic["User"]["uid"], "Justif_"+one_dic["User"]["slug"], True)}
</td>
% else:
<td><i>Rien</i></td>
<td style="text-align:center;"><i>Rien</i></td>
% endif
</tr>
<tr>

% if one_dic.has_key("RIB"):
<td style="text-align:center;">
${h.uploader("RIB", one_dic["User"]["uid"], "RIB")}
${h.uploader("RIB", one_dic["User"]["uid"], "RIB_"+one_dic["User"]["slug"], True)}
</td>
% else:
<td><i>Rien</i></td>
<td style="text-align:center;"><i>Rien</i></td>
% endif
</tr>
% endfor


+ 7
- 3
jm2l/templates/helpers.mako 查看文件

@@ -217,13 +217,17 @@ TabJs = {'select':[], 'desc':[]}
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
## Wrapper pour uploader
## -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<%def name="uploader(MediaType, UID, desc=None)"> \
<%def name="uploader(MediaType, UID, desc=None, disp_only=False)"> \
<!-- The file upload form used as target for the file upload widget -->
<form class="fileupload" id="fileupload_${MediaType}" action="/uploader/${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
% if disp_only:
<form class="fileupload" id="fileupload_${MediaType}_${UID}" action="/uploader/_${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
% else:
<form class="fileupload" id="fileupload_${MediaType}_${UID}" action="/uploader/${MediaType}/${UID}/proceed" method="POST" enctype="multipart/form-data">
% endif
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<noscript><input type="hidden" name="redirect" value="/"></noscript>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="fileupload-buttonbar">
<div class="fileupload-buttonbar" ${["","style=display:none"][disp_only]}>
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>


+ 13
- 8
jm2l/upload.py 查看文件

@@ -186,6 +186,10 @@ class MediaUpload(MediaPath):
def __init__(self, request):
self.request = request
self.media_table = self.request.matchdict.get('media_table')
self.display_only = False
if self.media_table.startswith('_'):
self.display_only = True
self.media_table = self.media_table[1:]
self.linked_id = self.request.matchdict.get('uid')
if not self.linked_id.isdigit():
raise HTTPBadRequest('Wrong Parameter')
@@ -398,14 +402,15 @@ class MediaUpload(MediaPath):
info['thumbnailUrl'] = self.ExtMimeIcon(mime)
else:
info['thumbnailUrl'] = self.ExtMimeIcon(mime)
info['deleteType'] = DELETEMETHOD
info['deleteUrl'] = self.request.route_url('media_upload',
sep='',
name='',
media_table=self.media_table,
uid=self.linked_id) + '/' + name
if DELETEMETHOD != 'DELETE':
info['deleteUrl'] += '&_method=DELETE'
if not self.display_only:
info['deleteType'] = DELETEMETHOD
info['deleteUrl'] = self.request.route_url('media_upload',
sep='',
name='',
media_table=self.media_table,
uid=self.linked_id) + '/' + name
if DELETEMETHOD != 'DELETE':
info['deleteUrl'] += '&_method=DELETE'
return info
else:
return None


Loading…
取消
儲存