From: Yoan Le Clanche Date: Tue, 4 May 2021 15:11:03 +0000 (+0200) Subject: Merge branch 'dev' into no-telemeta X-Git-Tag: 2.1~66^2^2~91^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6e97fc0e777ba2dc47e7d69646596772ef871876;p=teleforma.git Merge branch 'dev' into no-telemeta --- 6e97fc0e777ba2dc47e7d69646596772ef871876 diff --cc teleforma/static/teleforma/js/application.js index 761a3790,5b7aac20..4ff122fc --- a/teleforma/static/teleforma/js/application.js +++ b/teleforma/static/teleforma/js/application.js @@@ -40,253 -40,27 +40,276 @@@ $(document).ready(function() }) } $('.tabs').tabs(); +}); + + + +/* + * Copyright (C) 2007-2012 Guillaume Pellerin, Parisson + * Copyright (c) 2011 Riccardo Zaccarelli + * Copyright (c) 2010 Olivier Guilyardi + * + * This file is part of TimeSide. + * + * TimeSide is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * TimeSide is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with TimeSide. If not, see . + * + * Authors: Riccardo Zaccarelli + * Olivier Guilyardi + */ + +/** + * Class for teleforma global functions. + * Note that the dollar sign is a reserved keyword in some browsers + * (see http://davidwalsh.name/dollar-functions) + * which might be in conflict with jQuery dollar sign. + */ + +//returns the full path of the current url location removing the last slash '/' followed by one or more '#', if any +function urlNormalized(){ + var sPath = window.location.href; + sPath = sPath.replace(/\/#*$/,""); + return sPath; +} +/** + *sets up few stuff when the page is ready (see functions below it) + */ +jQuery(document).ready(function() { + foldInfoBlocks(); + setSelectedMenu(); +}); + +/** + *function inherited from old code, never touched. Guess fixes the click on the left data table, if any + */ +function foldInfoBlocks() { + var $J = jQuery; + var extra = $J('.extraInfos'); + extra.find('.folded dl, .folded table').css('display', 'none'); + extra.find('h4').click(function() { + $J(this).parents('.extraInfos').children().toggleClass('folded').find('dl, table').toggle(100); + //toggle toggles the visibility of elements + return false; + }); +} + +/** + * Global teleforma function which sets the current selected menu according to the current url + */ +function setSelectedMenu(){ + var $J = jQuery; + var menus = $J('#menu a'); + //build collections/items from http:/site/collections/items, + //being http:/site/ = window.location.origin + + //function for normalizing paths (removes last n occurrences of the slash) + var normalize = function(str){ + return str.replace(/\/+#*$/,""); + } + + var host = window.location.host; + var protocol = window.location.protocol + var href = normalize(window.location.href); + + if(!(host) || !(protocol) || !(href)){ + return; + } + + //var pageOrigin = normalize(window.location.origin); //does not exist in FF, so: + var pageOrigin = normalize(protocol+"//"+host); + var pageHref = normalize(href); + + menus.each(function(){ + ///if we are at home, the window location href corresponds to window location origin, + //so we select only links whose link points EXACTLY to the origin (home link) + var linkHref = normalize(this.href); + var elm = $J(this); + + if(linkHref.indexOf("#") != -1){ + var reg = new RegExp("[#]+", "g"); + var baseHref = linkHref.split(reg); + linkHref = pageOrigin + "/" + baseHref[1] + } + + if(pageOrigin===pageHref){ + if(pageHref == linkHref){ + elm.addClass('active'); + }else{ + elm.removeClass('active'); + } + }else{ + //here, on the other hand, we select if a link points to a page or super page + //of the current page + if(linkHref!=pageOrigin && pageHref.match("^"+linkHref+".*")){ + elm.addClass('active'); + }else{ + elm.removeClass('active'); + } + } + + }) +} + + + + +/***************************************************************************** + * json(param, method, onSuccesFcn(data, textStatus, jqXHR), onErrorFcn(jqXHR, textStatus, errorThrown)) + * global function to senbd/retrieve data with the server + * + * param: the data to be sent or retrieved. + * param will be converted to string, escaping quotes newlines and backslashes if necessary. + * param can be a javascript string, boolean, number, dictionary and array. + * If dictionary or array, it must contain only the above mentioned recognized types. + * So, eg, {[" a string"]} is fine, {[/asd/]} not + * + * method: the json method, eg "telemeta.update_marker". See base.py + * + * onSuccesFcn(data, textStatus, jqXHR) OPTIONAL --IF MISSING, NOTHING HAPPENS -- + * A function to be called if the request succeeds with the same syntax of jQuery's ajax onSuccess function. + * The function gets passed three arguments + * The data returned from the server, formatted according to the dataType parameter; + * a string describing the status; + * and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object + * + * onErrorFcn(jqXHR, textStatus, errorThrown) OPTIONAL. --IF MISSING, THE DEFAULT ERROR DIALOG IS SHOWN-- + * A function to be called if the request fails with the same syntax of jQuery ajax onError function.. + * The function receives three arguments: + * The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, + * a string describing the type of error that occurred and + * an optional exception object, if one occurred. + * Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". + * ****************************************************************************/ + +var json = function(param,method,onSuccessFcn,onErrorFcn){ + //this function converts a javascript object to a string + var toString_ = function(string){ + if(typeof string == "string"){ + //escapes newlines quotes and backslashes + string = string.replace(/\\/g,"\\\\") + .replace(/\n/g,"\\n") + .replace(/"/g,"\\\""); + } + var array; //used for arrays and objects (see below) + if(typeof string == "boolean" || typeof string== "number" || typeof string == "string"){ + string = '"'+string+'"'; + }else if(string instanceof Array){ + array = []; + for(var i = 0;i ') + var button = $('Voir les vidéos plus anciennes').bind('click', function(){ + $this.find('tr:not(:first)').show('fast'); + buttonRow.hide(); + }); + // $this.find('tr:first').appendAfter(buttonRow); + $this.find('tr:not(:first)').hide(); + buttonRow.find('td').append(button) + buttonRow.insertAfter($this.find('tr:first')) + }) }); diff --cc teleforma/templates/registration/registration_complete.html index 9d48dda3,ce1f6e7f..3b4c0adb --- a/teleforma/templates/registration/registration_complete.html +++ b/teleforma/templates/registration/registration_complete.html @@@ -11,16 -12,11 +11,11 @@@ Vous venez de réaliser avec succès vo

- Afin de compléter votre inscription, il est nécessaire d’imprimer le formulaire ci-dessous, de le dater et le signer, et nous le retourner accompagné de deux photos d’identité à l’adresse suivante : -

+ Afin de compléter votre inscription, il est nécessaire d’imprimer le formulaire ci-dessous, de le dater et le signer, et nous le retourner à l'adresse CRFPA@pre-barreau.com - LE PRE-BARREAU
- Service inscription
- 3, rue de Nesle
- 75006 Paris -


+


- {% trans "Download" %} + {% trans "Download" %}


Une fois votre dossier reçu et confirmé par nos services, vous recevrez un mail vous invitant à procéder au règlement des arrhes par carte bancaire. Votre inscription ne sera validée qu’au terme de cette ultime étape. diff --cc teleforma/templates/teleforma/course_media.html index 8bb91ccb,1841ecd5..5c3d6b4e --- a/teleforma/templates/teleforma/course_media.html +++ b/teleforma/templates/teleforma/course_media.html @@@ -57,10 -58,10 +57,10 @@@ $(document).ready(function() {% endblock extra_javascript %} {% block module-action %} -{% if media.item.file and media.is_published or user.is_superuser or user.is_staff %} - {% if not "video" in media.mime_type or perms.telemeta.can_play_all_items or request.user_agent.os.family == 'iOS' %} +{% if media.file and media.is_published or user.is_superuser or user.is_staff %} + {% if not "video" in media.mime_type or request.user_agent.os.family == 'iOS' %} {% endif %} {% endif %} diff --cc teleforma/urls.py index 71eca43a,c2f63cf7..673104a8 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@@ -94,8 -78,11 +94,11 @@@ urlpatterns = patterns('' # Home url(r'^$', HomeRedirectView.as_view(), name="teleforma-home"), - # Unauthorized + # Flat pages + url(r'^pages/(?P.*)$', home_view.render_flatpage, name="teleforma-flatpage"), ++ # Unauthorized + url(r'^unauthorized/$', TemplateView.as_view(template_name="teleforma/unauthorized.html"), name="teleforma-unauthorized"), + - # Telemeta - url(r'^', include('telemeta.urls')), # Desk url(r'^desk/$', HomeRedirectView.as_view(), name="teleforma-desk"), diff --cc teleforma/views/core.py index 863a7caa,ce49dddd..6b8b820b --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@@ -74,7 -73,8 +73,8 @@@ from teleforma.models import from teleforma.forms import * from teleforma.models.appointment import AppointmentPeriod from teleforma.webclass.models import Webclass, WebclassSlot, WebclassRecord -from teleforma.decorators import access_required +import pages + from telemeta.views import * import jqchat.models from xlwt import Workbook diff --cc teleforma/views/crfpa.py index a9592e23,3aa08f6b..d22f1257 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@@ -36,7 -36,8 +36,8 @@@ from teleforma.models.crfpa import Para from teleforma.models.core import Period from teleforma.views.core import * from teleforma.forms import WriteForm -from telemeta.views import ProfileView +from teleforma.views.profile import ProfileView + from teleforma.decorators import access_required from registration.views import * from extra_views import CreateWithInlinesView, UpdateWithInlinesView, InlineFormSet from postman.views import WriteView as PostmanWriteView