Commit 395a5a15 authored by robin banquo's avatar robin banquo

module google agenda et framagenda

parent 089464db
$(document).ready(function () {
getAgendaId = function (type,url) {
console.log(url)
console.log(type)
if(type === "framagenda"){
return url.split("/p/")[1].split('/')[0]
}else if(type === "google calendar"){
return url.split("?src=")[1]
}
}
$('.editAgendaModal').modal()
$('.editAgendaForm').submit(function (e) {
e.preventDefault()
let sectionId = this.id.split('-')[1]
let AgendaType = $('#editAgendaForm-' + sectionId + " select[name=agendaType]").val()
let AgendaUrl = $('#editAgendaForm-' + sectionId + " input[name=agendaUrl]").val()
let AgendaId = getAgendaId(AgendaType, AgendaUrl)
console.log(AgendaId)
if(AgendaId){
if(AgendaType === 'google calendar'){
$('#agendaContainer-'+sectionId).html(
'<iframe src="https://calendar.google.com/calendar/htmlembed?src=' + AgendaId + '" style="border: 0; margin-top: -50px" width="400" height="300" frameborder="0" scrolling="no"></iframe>'
);
}else if(AgendaType === 'framagenda'){
$('#agendaContainer-'+sectionId).html(
'<iframe width="400" height="215" src="https://framagenda.org/index.php/apps/calendar/embed/' + AgendaId + '"></iframe>'
);
}
$('#uglyForm input[name=uglyForm-' + sectionId + '-agendaType]').val(AgendaType)
$('#uglyForm input[name=uglyForm-' + sectionId + '-agendaId]').val(AgendaId)
// $('#videoTypeModuleVideo-'+sectionId).html(label)
// $('#videoModuleBtn-'+sectionId).attr('href', videoUrl)
$('.editAgendaModal').modal('close')
initMainSaveBtn()
}else{
$('#errorAgenda-' + sectionId).html("le lien fourni n'est pas valide")
}
})
})
\ No newline at end of file
{
"name": "calendar",
"title": "Calendrier",
"description": "Module permettant d'ajouter un agenda Framagenda ou Google agenda",
"tags":"moduleTag-special",
"hidden": false,
"fields": {
"agendaType": {
"type": "text",
"value": "google calendar"
},
"agendaId": {
"type": "text",
"value": "%23contacts%40group.v.calendar.google.com&ctz=Europe%2FParis"
},
"title": {
"type": "text",
"value": "<h4>Agenda</h4>"
},
"content": {
"type": "text",
"value": "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet architecto assumenda consequuntur esse eum facere, illum libero molestiae nam </p>"
}
}
}
\ No newline at end of file
<div class="main-background relative module" style="overflow: hidden">
<div class="container">
<div class="section relative" style="padding-top: 60px !important;padding-bottom: 60px !important; z-index: 10">
<div class="row no-margin relative">
<div class="relative col s12 l7 " >
<check if="{{ @isAdminPage }}">
<a class="btn-floating waves-effect waves-light lightButton absolute tooltipped moduleBtn modal-trigger" href="#editAgendaModal-{{@id}}" data-position="left"
data-delay="250" data-tooltip="Importer l'agenda" style=" right: 0px; top: 0px; z-index: 1000">
<i class="material-icons">settings</i></a>
</check>
<div class="agenda-container" id="agendaContainer-{{@id}}">
<check if="{{ @fields['agendaType']['value'] == 'google calendar' }}">
<iframe src="https://calendar.google.com/calendar/htmlembed?src={{@fields['agendaId']['value']}}" style="border: 0; margin-top: -50px" width="800" height="600" frameborder="0" scrolling="no"></iframe>
</check>
<check if="{{ @fields['agendaType']['value'] == 'framagenda' }}">
<iframe width="400" height="215" src="https://framagenda.org/index.php/apps/calendar/embed/{{@fields['agendaId']['value']}}"></iframe>
</check>
</div>
</div>
<div class="col s12 l5" style="padding: 0 0 0 25px !important;">
<div class="row">
<div class="col s12 second-color title-font editable " id="moduleValue-title">
{{@fields['title']['value'] | raw}}
</div>
</div>
<div class="row">
<div class="col s12 second-color main-font editable" id="moduleValue-content" style="text-align: justify">
{{@fields['content']['value'] | raw}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<check if="{{ @isAdminPage }}">
<div id="editAgendaModal-{{@id}}" class=" editAgendaModal modal modal-fixed-header ">
<div class="modal-header" style="z-index: 6001">
<h5 class="white-text" style="padding: 15px !important; margin: 0 !important;">Editer l'agenda</h5>
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat right"><i class="material-icons white-text">clear</i></a>
</div>
<div class="modal-content ">
<div class="row tooltipped frama-purple shadow-bottom" data-position="bottom"
data-delay="250" data-tooltip="Copiez l'adresse de votre agenda" style="padding: 15px; border-radius: 5px; ">
<div class="row">
<div class="col s12 m6">
<h5 class="center-align white-text"><b>Google Calendar</b></h5>
<ul>
<li class="white-text">Rendez vous sur votre Google Calendar</li>
<li class="white-text">Cliquez sur settings en haut a droite
"<i class="material-icons white-text tiny">settings</i>"</li>
<li class="white-text">Selectionnez le calendrier de votre choix</li>
<li class="white-text">Cochez la case <i><b>Rendre disponible publiquement</b></i></li>
<li class="white-text">Cliquez sur <i><b>obtenir le lien partageable</b></i> puis copiez l'adresse
donnée
</li>
</ul>
</div>
<div class="col s12 m6">
<h5 class="center-align white-text"><b>Framagenda</b></h5>
<ul>
<li class="white-text">Rendez vous sur votre Framagenda</li>
<li class="white-text">Cochez la case <i><b>Partager un lien Accès public</b></i></li>
<li class="white-text">Cliquez sur <i><b>obtenir le lien partageable</b></i> puis copiez l'adresse
donnée
</li>
<li class="white-text">Cliquez sur "<i class="material-icons white-text tiny">link</i>" qui vous
dirigera
vers la vue publique puis copiez l'adresse en barre d'adresse
</li>
<li class="white-text">Copiez l'adresse de la barre d'adresse</li>
</ul>
</div>
</div>
<div class="row">
<div class="col s12 m6">
<img class="responsive-img no-padding no-margin" style="border-radius: 4px" src="app/views/modules/calendar/capture1.png" alt="capture d'écran youtube">
</div>
<div class="col s12 m6">
<img class="responsive-img no-padding no-margin" style="border-radius: 4px" src="app/views/modules/calendar/capture2.png" alt="capture d'écran youtube">
</div>
</div>
</div>
<p class="center-align"><i class="material-icons frama-purple-text ">warning</i></p>
<p class="frama-purple-text center-align">Les <b>Framagendas</b>ne sont pas encore compatible avec la
majorités des navigateurs et ne fonctionnent que sous firefox</p>
<form class="editAgendaForm" id="editAgendaForm-{{@id}}">
<div class="row" style="margin-top: 30px">
<div class="input-field col s12 m4">
<select name="agendaType">
<option value="google calendar" selected>Google Calendar</option>
<option value="framagenda">Framagenda</option>
</select>
<label>Sélectionnez la source de votre agenda</label>
</div>
<div class="input-field col s12 m8 ">
<input name="agendaUrl" type="url" required class="validate grey-text text-darken-3" placeholder="https://calendar.google.com/calendar/htmlembed?src=%23contacts%40group.v.calendar.google.com&ctz=Europe%2FParis">
<label for="value">Collez le lien public de votre agenda <b>ici</b></label>
</div>
</div>
<div class="row">
<div class="col s12 center-align">
<p class="frama-orange-text" id="errorAgenda-{{@id}}"></p>
</div>
<div class="col s12 center-align">
<button type="submit" class="btn frama-orange hover-frama-purple waves-effect waves-light btn">
<i class="material-icons right">done</i>Valider
</button>
</div>
</div>
</form>
</div>
</div>
</check>
\ No newline at end of file
......@@ -7,14 +7,9 @@
crossorigin=""/>
<div class="container ">
<div class="section" style="padding-top: 50px !important;padding-bottom: 50px !important;">
<div class="row no-margin">
<div class="col s12 l5 ">
<div class=" second-color main-font editable center-align" id="moduleValue-title">
{{@fields['title']['value'] | raw}}
</div>
</div>
<div class="col s12 l7 relative" style="padding-left: 30px">
<div class="row no-margin">
<div class="col s12 l7 relative" style="padding-right: 30px">
<check if="{{ @isAdminPage }}">
<a class="btn-floating waves-effect waves-light lightButton absolute tooltipped moduleBtn editMap" data-position="left"
data-delay="250" data-tooltip="Paramétrer la carte" id="#editMap-{{@id}}" style=" right: -15px; top: -25px; z-index: 1000">
......@@ -27,6 +22,13 @@
<div class='OSMap light-shadow' id="mapid-{{@id}}" style="height: 450px; border-radius: 10px" lon="{{@fields['lon']['value']}}" lat="{{@fields['lat']['value']}}"></div>
</div>
<div class="col s12 l5 ">
<div class=" second-color main-font editable center-align" id="moduleValue-title">
{{@fields['title']['value'] | raw}}
</div>
</div>
</div>
</div>
</div>
......
$(document).ready(function(){
//au click sur inerer une section
$(' .editCVImage').click(function () {
let id = this.id.split("-")[1]
$("#siteOptionsModal").modal('open')
$("a[href=#options-medias]").click()
MediaManagment.render(true, "uglyForm-"+id+"-imgUrl")
initMainSaveBtn()
})
})
\ No newline at end of file
{
"name": "separator",
"title": "barre de séparation",
"description": "Module permettant d'ajouter une barre de séparation",
"tags":"moduleTag-special",
"hidden" : false,
"fields": {
}
}
\ No newline at end of file
<div class="main-background">
<div class="container module ">
<div class="section" style="padding-top: 40px !important;padding-bottom: 40px !important;">
<div style="width: 100%; height: 3px; background-color: {{@siteOptions['theme']['second_color']}}"></div>
</div>
</div>
</div>
......@@ -747,4 +747,21 @@ height: 110px;
.socialMedia {
flex: 1
}
}
.agenda-container {
position: relative;
padding-bottom: 100%;
padding-top: -50px;
height: 0;
}
.agenda-container iframe,
.agenda-container object,
.agenda-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
\ No newline at end of file
......@@ -15,13 +15,13 @@
}
},
"theme": {
"name": "Soft",
"menu_background": "#96adc7",
"main_background": "#f6f6f6",
"main_color": "#6e6e6e",
"contrasted_color": "#f6f6f6",
"second_background": "#96adc7",
"second_color": "#364461"
"name": "Classic",
"menu_background": "#FFFFFF",
"main_background": "#FFFFFF",
"main_color": "#444444",
"contrasted_color": "#FFFFFF",
"second_background": "#009688",
"second_color": "#563529"
},
"params": {
"title": "framasite",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment