forked from tr4ck3ur/jm2l
Fix ckeditor, uploader and add piwik
This commit is contained in:
+1
-2
@@ -6,8 +6,7 @@
|
|||||||
[app:main]
|
[app:main]
|
||||||
use = egg:JM2L
|
use = egg:JM2L
|
||||||
|
|
||||||
pyramid.reload_templates = false
|
pyramid.reload_templates = true
|
||||||
#true
|
|
||||||
pyramid.debug_authorization = false
|
pyramid.debug_authorization = false
|
||||||
pyramid.debug_notfound = false
|
pyramid.debug_notfound = false
|
||||||
pyramid.debug_routematch = false
|
pyramid.debug_routematch = false
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.borderbox {
|
.borderbox {
|
||||||
border: 1px solid #e1e4e5;
|
border: 1px solid #e1e4e5;
|
||||||
margin: 1px 0 24px;
|
margin: 1px 0 24px;
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
@@ -55,7 +55,7 @@ DicForm = {
|
|||||||
'website': {'PlaceHolder':u"http://ma-page-web.moi","FieldStyle":"width:16em;"},
|
'website': {'PlaceHolder':u"http://ma-page-web.moi","FieldStyle":"width:16em;"},
|
||||||
'gpg_key': {'PlaceHolder':u"Ma clé gpg", "FieldStyle":"width:90%;"},
|
'gpg_key': {'PlaceHolder':u"Ma clé gpg", "FieldStyle":"width:90%;"},
|
||||||
'soc_link':{'PlaceHolder':u"#jm2l sur irc.freenode.org","FieldStyle":"width:90%;"},
|
'soc_link':{'PlaceHolder':u"#jm2l sur irc.freenode.org","FieldStyle":"width:90%;"},
|
||||||
'bio': {'PlaceHolder':u"Ma Bilibiographie", "FieldStyle":"width:95%;min-height:150px;", "fieldset":True },
|
'bio': {'PlaceHolder':u"Ma Bilibiographie", "FieldStyle":"width:95%;min-height:150px;", "fieldset":True, "ckeditor":1 },
|
||||||
'tiersship': {'Ignore':True}
|
'tiersship': {'Ignore':True}
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
@@ -63,20 +63,21 @@ DicForm = {
|
|||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Activité</legend>
|
<legend>Activité</legend>
|
||||||
|
Si vous ne trouvez pas l'entité que vous souhaitez promouvoir (Association, GULL, Entreprise, Logiciel, ...).
|
||||||
|
Vous pouvez <a href="/entity"> en ajouter une. </a>
|
||||||
|
|
||||||
<div class="repeat">
|
<div class="repeat">
|
||||||
<table class="wrapper table table-striped table-bordered" width="100%">
|
<table class="wrapper table table-striped table-bordered" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="row">
|
<tr class="row">
|
||||||
##<th></th>
|
|
||||||
<th style="width:4em;text-align:center;">Année</th>
|
<th style="width:4em;text-align:center;">Année</th>
|
||||||
<th style="width:19em;">Entitée</th>
|
<th style="width:19em;">Entité</th>
|
||||||
<th>Rôle</th>
|
<th>Rôle</th>
|
||||||
<th style="width:6em;">Action</th>
|
<th style="width:6em;">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="container">
|
<tbody class="container">
|
||||||
<tr class="row template" style="line-height:2.2em;">
|
<tr class="row template" style="line-height:2.2em;">
|
||||||
##<td><span class="move btn btn-mini btn-info">Move</span></td>
|
|
||||||
<td style="text-align:center;">
|
<td style="text-align:center;">
|
||||||
<input type="hidden" style="width:20em;" class="form-control" name="tiersship-{{row-count-placeholder}}-year_uid"
|
<input type="hidden" style="width:20em;" class="form-control" name="tiersship-{{row-count-placeholder}}-year_uid"
|
||||||
value="2015" /> 2015
|
value="2015" /> 2015
|
||||||
@@ -99,7 +100,6 @@ DicForm = {
|
|||||||
</tr>
|
</tr>
|
||||||
% for num, dicdata in enumerate(profil_form._fields.get("tiersship").data):
|
% for num, dicdata in enumerate(profil_form._fields.get("tiersship").data):
|
||||||
<tr class="row" style="padding:5px;line-height:2.2em;">
|
<tr class="row" style="padding:5px;line-height:2.2em;">
|
||||||
##<td><span class="move btn btn-mini btn-info">Move</span></td>
|
|
||||||
<td style="text-align:center;">
|
<td style="text-align:center;">
|
||||||
<input type="hidden" class="form-control" name="tiersship-${num}-year_uid"
|
<input type="hidden" class="form-control" name="tiersship-${num}-year_uid"
|
||||||
value="${dicdata.get('year_uid')}" style="width:4em;" />
|
value="${dicdata.get('year_uid')}" style="width:4em;" />
|
||||||
@@ -141,17 +141,8 @@ DicForm = {
|
|||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<input class="btn" type="submit" value="Enregistrer !" />
|
||||||
<input type="submit" value="Enregistrer !" />
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Handle Popover of this form
|
|
||||||
##<script type="text/javascript">
|
|
||||||
## % for field in profil_form._fields.keys():
|
|
||||||
## $('#${field}-help').popover();
|
|
||||||
## %endfor
|
|
||||||
##</script>
|
|
||||||
</%def>
|
</%def>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<%
|
<%
|
||||||
DicForm = {
|
DicForm = {
|
||||||
'year_uid': {'PlaceHolder':u"Mon Nom", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
|
'year_uid': {'PlaceHolder':u"Mon Nom", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
|
||||||
'doss_presse': {'PlaceHolder':u"Dossier de presse", "FieldStyle":"width:95%;min-height:600px;"},
|
'doss_presse': {'PlaceHolder':u"Dossier de presse", "FieldStyle":"width:95%;min-height:600px;", "ckeditor":"1"},
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<div>
|
<div>
|
||||||
@@ -29,6 +29,6 @@ DicForm = {
|
|||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
<script>
|
<script>
|
||||||
var editor = CKEDITOR.replace( 'doss_presse', { autoGrow_onStartup: true, language: 'fr' } );
|
## var editor = CKEDITOR.replace( 'doss_presse', { autoGrow_onStartup: true, language: 'fr' } );
|
||||||
</script>
|
</script>
|
||||||
${helpers.uploader_js()}
|
##${helpers.uploader_js()}
|
||||||
@@ -40,5 +40,5 @@ DicForm = {
|
|||||||
${helpers.uploader("poles", form.uid.data, u"Attachement" )}
|
${helpers.uploader("poles", form.uid.data, u"Attachement" )}
|
||||||
%endif
|
%endif
|
||||||
<script>
|
<script>
|
||||||
var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
## var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||||
</script>
|
</script>
|
||||||
@@ -44,5 +44,5 @@ DicForm = {
|
|||||||
${helpers.uploader("tasks", form.uid.data, u"Attachement" )}
|
${helpers.uploader("tasks", form.uid.data, u"Attachement" )}
|
||||||
%endif
|
%endif
|
||||||
<script>
|
<script>
|
||||||
var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
## var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||||
</script>
|
</script>
|
||||||
@@ -216,5 +216,5 @@ if formAdd:
|
|||||||
for jsitem in formAdd._fields.keys():
|
for jsitem in formAdd._fields.keys():
|
||||||
context._kwargs['postpone_js'].append( "$('#%s-help').popover();" % jsitem )
|
context._kwargs['postpone_js'].append( "$('#%s-help').popover();" % jsitem )
|
||||||
%>
|
%>
|
||||||
${helpers.uploader_js()}
|
##${helpers.uploader_js()}
|
||||||
% endif
|
% endif
|
||||||
@@ -144,9 +144,9 @@ DicForm = {
|
|||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
% if 'uid' in form._fields:
|
##% if 'uid' in form._fields:
|
||||||
${helpers.uploader_js()}
|
## ${helpers.uploader_js()}
|
||||||
% endif
|
##% endif
|
||||||
|
|
||||||
<%def name="jsAddOn()">
|
<%def name="jsAddOn()">
|
||||||
<script src="/vendor/select2/js/select2.js"></script>
|
<script src="/vendor/select2/js/select2.js"></script>
|
||||||
@@ -154,7 +154,7 @@ DicForm = {
|
|||||||
<script src="/vendor/ckeditor/ckeditor.js"></script>
|
<script src="/vendor/ckeditor/ckeditor.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var year_data = Array();
|
var year_data = Array();
|
||||||
var editor = CKEDITOR.replace('description', { autoGrow_onStartup: true, language: 'fr' } );
|
##var editor = CKEDITOR.replace('description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||||
for (var i=2005;i<2015;i++)
|
for (var i=2005;i<2015;i++)
|
||||||
{ year_data[i.toString()] = i.toString(); };
|
{ year_data[i.toString()] = i.toString(); };
|
||||||
|
|
||||||
|
|||||||
@@ -245,8 +245,9 @@ TabJs = {'select':[], 'desc':[]}
|
|||||||
{% } %}
|
{% } %}
|
||||||
</script>
|
</script>
|
||||||
%if 1:
|
%if 1:
|
||||||
<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
##<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
||||||
<script src="/js/main.js"></script>
|
##<script src="/js/main.js"></script>
|
||||||
|
plop
|
||||||
% else:
|
% else:
|
||||||
<script src="/static/jquery.min.js"></script>
|
<script src="/static/jquery.min.js"></script>
|
||||||
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
|
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
|
||||||
|
|||||||
@@ -150,4 +150,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${h.uploader_js()}
|
##${h.uploader_js()}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
|
||||||
<head>
|
<head>
|
||||||
<title>JM2L 2015</title>
|
<title>JM2L 2015</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
@@ -20,6 +21,8 @@
|
|||||||
<link rel="stylesheet" href="/static/ie6.css" type="text/css" media="screen" charset="utf-8" />
|
<link rel="stylesheet" href="/static/ie6.css" type="text/css" media="screen" charset="utf-8" />
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<script src="/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script>
|
<script src="/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script>
|
||||||
|
##<script id="template-download" type="text/x-tmpl" src="/vendor/fileupload/template/template-download.js"></script>
|
||||||
|
##<script id="template-upload" type="text/x-tmpl" src="/vendor/fileupload/template/template-upload.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<%
|
<%
|
||||||
@@ -28,6 +31,8 @@ DisplayYear = request.session.get('year', 2015)
|
|||||||
%>
|
%>
|
||||||
<%def name="jsAddOn()"></%def>
|
<%def name="jsAddOn()"></%def>
|
||||||
<%def name="cssAddOn()"></%def>
|
<%def name="cssAddOn()"></%def>
|
||||||
|
${helpers.uploader_js()}
|
||||||
|
|
||||||
<div id="wrap">
|
<div id="wrap">
|
||||||
<div id="top" style="background: url( ${"/img/%s/headerbg.png" % DisplayYear} ) repeat-x scroll 0 top #ffffff;">
|
<div id="top" style="background: url( ${"/img/%s/headerbg.png" % DisplayYear} ) repeat-x scroll 0 top #ffffff;">
|
||||||
<div class="align-center">
|
<div class="align-center">
|
||||||
@@ -68,7 +73,7 @@ DisplayYear = request.session.get('year', 2015)
|
|||||||
<li><a href="/sign/out">Me déconnecter</a></li>
|
<li><a href="/sign/out">Me déconnecter</a></li>
|
||||||
% else:
|
% else:
|
||||||
<li><a href="/participer-l-evenement#inscription">Je m'inscris</a></li>
|
<li><a href="/participer-l-evenement#inscription">Je m'inscris</a></li>
|
||||||
<li><a href="/sign/login">Je m'identifier</a></li>
|
<li><a href="/sign/login">Je m'identifie</a></li>
|
||||||
% endif
|
% endif
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,6 +114,7 @@ DisplayYear = request.session.get('year', 2015)
|
|||||||
<script src="/vendor/jquery.min.js"></script>
|
<script src="/vendor/jquery.min.js"></script>
|
||||||
<script src="/vendor/bootstrap.min.js"></script>
|
<script src="/vendor/bootstrap.min.js"></script>
|
||||||
<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
||||||
|
<script src="/vendor/ckeditor/ckeditor.js"></script>
|
||||||
${self.jsAddOn()}
|
${self.jsAddOn()}
|
||||||
## Then Handle Javascript
|
## Then Handle Javascript
|
||||||
<script>
|
<script>
|
||||||
@@ -150,5 +156,23 @@ $.each( $('.fileupload'),
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- Piwik -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
var _paq = _paq || [];
|
||||||
|
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
_paq.push(['enableLinkTracking']);
|
||||||
|
(function() {
|
||||||
|
var u="//stats.style-python.fr/";
|
||||||
|
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||||
|
_paq.push(['setSiteId', 4]);
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<noscript><p><img src="//stats.style-python.fr/piwik.php?idsite=4" style="border:0;" alt="" /></p></noscript>
|
||||||
|
<!-- End Piwik Code -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
${helpers.uploader_js()}
|
##${helpers.uploader_js()}
|
||||||
<script>
|
<script>
|
||||||
$("#place_type").select2({});
|
$("#place_type").select2({});
|
||||||
</script>
|
</script>
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
Les images de taille supérieure à 300x300 pixels seront redimensionnés.
|
Les images de taille supérieure à 300x300 pixels seront redimensionnés.
|
||||||
</div>
|
</div>
|
||||||
${helpers.uploader("users", uid, "une Photo")}
|
${helpers.uploader("users", uid, "une Photo")}
|
||||||
${helpers.uploader_js()}
|
##${helpers.uploader_js()}
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button>
|
<button class="btn" data-dismiss="modal" aria-hidden="true">Annuler</button>
|
||||||
|
|||||||
+1
-4
@@ -97,7 +97,7 @@ class MediaPath():
|
|||||||
p = IMAGEPATH + [ media_table ] + [ linked_id ]
|
p = IMAGEPATH + [ media_table ] + [ linked_id ]
|
||||||
elif media_table=='tasks':
|
elif media_table=='tasks':
|
||||||
# Use Current Year
|
# Use Current Year
|
||||||
p = IMAGEPATH + [ 2015, media_table ] + [ linked_id ]
|
p = IMAGEPATH + [ str(2015), media_table ] + [ linked_id ]
|
||||||
elif media_table in ['RIB', 'Justif']:
|
elif media_table in ['RIB', 'Justif']:
|
||||||
slug = User.by_id(linked_id).slug
|
slug = User.by_id(linked_id).slug
|
||||||
p = IMAGEPATH + ['users'] + [ slug ] + [ self.media_table ]
|
p = IMAGEPATH + ['users'] + [ slug ] + [ self.media_table ]
|
||||||
@@ -143,7 +143,6 @@ class MediaUpload(MediaPath):
|
|||||||
if RealMime!=result['type']:
|
if RealMime!=result['type']:
|
||||||
result['error'] = 'l\'extension du fichier ne correspond pas à son contenu - '
|
result['error'] = 'l\'extension du fichier ne correspond pas à son contenu - '
|
||||||
result['error'] += "( %s vs %s )" % (RealMime, result['type'])
|
result['error'] += "( %s vs %s )" % (RealMime, result['type'])
|
||||||
print "%s != %s" % (RealMime, result['type'])
|
|
||||||
return False
|
return False
|
||||||
# Accept images and mime types listed
|
# Accept images and mime types listed
|
||||||
if not RealMime in ACCEPTED_MIMES:
|
if not RealMime in ACCEPTED_MIMES:
|
||||||
@@ -343,7 +342,6 @@ class MediaUpload(MediaPath):
|
|||||||
result['name'] = os.path.basename(fieldStorage.filename)
|
result['name'] = os.path.basename(fieldStorage.filename)
|
||||||
result['type'] = fieldStorage.type
|
result['type'] = fieldStorage.type
|
||||||
result['size'] = self.get_file_size(fieldStorage.file)
|
result['size'] = self.get_file_size(fieldStorage.file)
|
||||||
print result
|
|
||||||
if self.validate(result, fieldStorage.file):
|
if self.validate(result, fieldStorage.file):
|
||||||
with open( self.mediapath(result['name'] + '.type'), 'w') as f:
|
with open( self.mediapath(result['name'] + '.type'), 'w') as f:
|
||||||
f.write(result['type'])
|
f.write(result['type'])
|
||||||
@@ -391,7 +389,6 @@ class MediaView(MediaPath):
|
|||||||
test = f.read()
|
test = f.read()
|
||||||
self.request.response.content_type = test
|
self.request.response.content_type = test
|
||||||
except IOError:
|
except IOError:
|
||||||
print os.path.basename(name)+".type file not found"
|
|
||||||
pass
|
pass
|
||||||
#try:
|
#try:
|
||||||
if 1:
|
if 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user