Fix ckeditor, uploader and add piwik
This commit is contained in:
+1
-2
@@ -6,8 +6,7 @@
|
||||
[app:main]
|
||||
use = egg:JM2L
|
||||
|
||||
pyramid.reload_templates = false
|
||||
#true
|
||||
pyramid.reload_templates = true
|
||||
pyramid.debug_authorization = false
|
||||
pyramid.debug_notfound = false
|
||||
pyramid.debug_routematch = false
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.borderbox {
|
||||
border: 1px solid #e1e4e5;
|
||||
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;"},
|
||||
'gpg_key': {'PlaceHolder':u"Ma clé gpg", "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}
|
||||
}
|
||||
%>
|
||||
@@ -63,20 +63,21 @@ DicForm = {
|
||||
|
||||
<fieldset>
|
||||
<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">
|
||||
<table class="wrapper table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="row">
|
||||
##<th></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 style="width:6em;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="container">
|
||||
<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;">
|
||||
<input type="hidden" style="width:20em;" class="form-control" name="tiersship-{{row-count-placeholder}}-year_uid"
|
||||
value="2015" /> 2015
|
||||
@@ -99,7 +100,6 @@ DicForm = {
|
||||
</tr>
|
||||
% for num, dicdata in enumerate(profil_form._fields.get("tiersship").data):
|
||||
<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;">
|
||||
<input type="hidden" class="form-control" name="tiersship-${num}-year_uid"
|
||||
value="${dicdata.get('year_uid')}" style="width:4em;" />
|
||||
@@ -141,17 +141,8 @@ DicForm = {
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<input type="submit" value="Enregistrer !" />
|
||||
<input class="btn" type="submit" value="Enregistrer !" />
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
## Handle Popover of this form
|
||||
##<script type="text/javascript">
|
||||
## % for field in profil_form._fields.keys():
|
||||
## $('#${field}-help').popover();
|
||||
## %endfor
|
||||
##</script>
|
||||
</%def>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<%
|
||||
DicForm = {
|
||||
'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>
|
||||
@@ -29,6 +29,6 @@ DicForm = {
|
||||
|
||||
<br><br>
|
||||
<script>
|
||||
var editor = CKEDITOR.replace( 'doss_presse', { autoGrow_onStartup: true, language: 'fr' } );
|
||||
## var editor = CKEDITOR.replace( 'doss_presse', { autoGrow_onStartup: true, language: 'fr' } );
|
||||
</script>
|
||||
${helpers.uploader_js()}
|
||||
##${helpers.uploader_js()}
|
||||
@@ -40,5 +40,5 @@ DicForm = {
|
||||
${helpers.uploader("poles", form.uid.data, u"Attachement" )}
|
||||
%endif
|
||||
<script>
|
||||
var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||
## var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||
</script>
|
||||
@@ -44,5 +44,5 @@ DicForm = {
|
||||
${helpers.uploader("tasks", form.uid.data, u"Attachement" )}
|
||||
%endif
|
||||
<script>
|
||||
var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||
## var editor = CKEDITOR.replace( 'description', { autoGrow_onStartup: true, language: 'fr' } );
|
||||
</script>
|
||||
@@ -216,5 +216,5 @@ if formAdd:
|
||||
for jsitem in formAdd._fields.keys():
|
||||
context._kwargs['postpone_js'].append( "$('#%s-help').popover();" % jsitem )
|
||||
%>
|
||||
${helpers.uploader_js()}
|
||||
##${helpers.uploader_js()}
|
||||
% endif
|
||||
@@ -144,9 +144,9 @@ DicForm = {
|
||||
<br>
|
||||
<br>
|
||||
|
||||
% if 'uid' in form._fields:
|
||||
${helpers.uploader_js()}
|
||||
% endif
|
||||
##% if 'uid' in form._fields:
|
||||
## ${helpers.uploader_js()}
|
||||
##% endif
|
||||
|
||||
<%def name="jsAddOn()">
|
||||
<script src="/vendor/select2/js/select2.js"></script>
|
||||
@@ -154,7 +154,7 @@ DicForm = {
|
||||
<script src="/vendor/ckeditor/ckeditor.js"></script>
|
||||
<script type="text/javascript">
|
||||
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++)
|
||||
{ year_data[i.toString()] = i.toString(); };
|
||||
|
||||
|
||||
@@ -245,8 +245,9 @@ TabJs = {'select':[], 'desc':[]}
|
||||
{% } %}
|
||||
</script>
|
||||
%if 1:
|
||||
<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
##<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
||||
##<script src="/js/main.js"></script>
|
||||
plop
|
||||
% else:
|
||||
<script src="/static/jquery.min.js"></script>
|
||||
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
|
||||
|
||||
@@ -150,4 +150,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${h.uploader_js()}
|
||||
##${h.uploader_js()}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
|
||||
<head>
|
||||
<title>JM2L 2015</title>
|
||||
<meta charset="utf-8">
|
||||
@@ -20,6 +21,8 @@
|
||||
<link rel="stylesheet" href="/static/ie6.css" type="text/css" media="screen" charset="utf-8" />
|
||||
<![endif]-->
|
||||
<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>
|
||||
<body>
|
||||
<%
|
||||
@@ -28,6 +31,8 @@ DisplayYear = request.session.get('year', 2015)
|
||||
%>
|
||||
<%def name="jsAddOn()"></%def>
|
||||
<%def name="cssAddOn()"></%def>
|
||||
${helpers.uploader_js()}
|
||||
|
||||
<div id="wrap">
|
||||
<div id="top" style="background: url( ${"/img/%s/headerbg.png" % DisplayYear} ) repeat-x scroll 0 top #ffffff;">
|
||||
<div class="align-center">
|
||||
@@ -68,7 +73,7 @@ DisplayYear = request.session.get('year', 2015)
|
||||
<li><a href="/sign/out">Me déconnecter</a></li>
|
||||
% else:
|
||||
<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
|
||||
</ul>
|
||||
</div>
|
||||
@@ -109,6 +114,7 @@ DisplayYear = request.session.get('year', 2015)
|
||||
<script src="/vendor/jquery.min.js"></script>
|
||||
<script src="/vendor/bootstrap.min.js"></script>
|
||||
<script src="/vendor/fileupload/js/jquery-uploader.min.js"></script>
|
||||
<script src="/vendor/ckeditor/ckeditor.js"></script>
|
||||
${self.jsAddOn()}
|
||||
## Then Handle Javascript
|
||||
<script>
|
||||
@@ -150,5 +156,23 @@ $.each( $('.fileupload'),
|
||||
}
|
||||
);
|
||||
</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>
|
||||
</html>
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
${helpers.uploader_js()}
|
||||
##${helpers.uploader_js()}
|
||||
<script>
|
||||
$("#place_type").select2({});
|
||||
</script>
|
||||
@@ -150,7 +150,7 @@
|
||||
Les images de taille supérieure à 300x300 pixels seront redimensionnés.
|
||||
</div>
|
||||
${helpers.uploader("users", uid, "une Photo")}
|
||||
${helpers.uploader_js()}
|
||||
##${helpers.uploader_js()}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<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 ]
|
||||
elif media_table=='tasks':
|
||||
# Use Current Year
|
||||
p = IMAGEPATH + [ 2015, media_table ] + [ linked_id ]
|
||||
p = IMAGEPATH + [ str(2015), media_table ] + [ linked_id ]
|
||||
elif media_table in ['RIB', 'Justif']:
|
||||
slug = User.by_id(linked_id).slug
|
||||
p = IMAGEPATH + ['users'] + [ slug ] + [ self.media_table ]
|
||||
@@ -143,7 +143,6 @@ class MediaUpload(MediaPath):
|
||||
if RealMime!=result['type']:
|
||||
result['error'] = 'l\'extension du fichier ne correspond pas à son contenu - '
|
||||
result['error'] += "( %s vs %s )" % (RealMime, result['type'])
|
||||
print "%s != %s" % (RealMime, result['type'])
|
||||
return False
|
||||
# Accept images and mime types listed
|
||||
if not RealMime in ACCEPTED_MIMES:
|
||||
@@ -343,7 +342,6 @@ class MediaUpload(MediaPath):
|
||||
result['name'] = os.path.basename(fieldStorage.filename)
|
||||
result['type'] = fieldStorage.type
|
||||
result['size'] = self.get_file_size(fieldStorage.file)
|
||||
print result
|
||||
if self.validate(result, fieldStorage.file):
|
||||
with open( self.mediapath(result['name'] + '.type'), 'w') as f:
|
||||
f.write(result['type'])
|
||||
@@ -391,7 +389,6 @@ class MediaView(MediaPath):
|
||||
test = f.read()
|
||||
self.request.response.content_type = test
|
||||
except IOError:
|
||||
print os.path.basename(name)+".type file not found"
|
||||
pass
|
||||
#try:
|
||||
if 1:
|
||||
|
||||
Reference in New Issue
Block a user