Real initial commit

Set real eMail-Address
This commit is contained in:
2019-12-02 13:38:49 +01:00
parent 56e8d0c48f
commit 4736ddeb82
170 changed files with 20857 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
include mixins
- var actual_background = "yellow";
mixin do_actor(actor)
- style="cursor: pointer; ";
- style_text="";
- if(actual_actor_id === actor.id) { style+="background-color: " + actual_background; style_text="font-weight: bold;" }
li(class="list-group-item", style=style, onclick="select_actor('#{actor.id}')", data-status="#{actor.status}")
span(id="#{actor.id}", style=style_text) #{actor.name}
mixin do_unit(unit)
li(class="list-group-item")
<b>#{unit.name}</b>
if unit.actors.length > 0
ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
each actor in unit.actors
+do_actor(actor)
if unit.subunits.length > 0
ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
each sub in unit.subunits
+do_unit(sub)
doctype html
html
include header
body(style="overflow: hidden;")
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid(style="margin-bottom: 18px;")
p.
Wählen Sie einen Beteiligten aus der Liste!
label
input(type="checkbox", checked, id="show_retired")
span
span Ausgeschiedene anzeigen
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
form(class="form-horizontal" method="POST", action="#{pentry_edit_base}/add_actor")
input(type="hidden", name="actual_actor_id", id="actual_actor_id", value="#{actual_actor_id}")
input(type="hidden", name="actual_actor_name", id="actual_actor_name", value="#{actual_actor_name}")
input(type="hidden", name="for_role", value="#{for_role}")
button(class="btn btn-success btn-xs", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
ul(class="list-group")
for unit in units
+do_unit(unit)
script.
if("#{actual_actor_id}" === "")
$("#submit_button").prop('disabled', true);
$("#show_retired").change(function()
{
if(this.checked)
$("[data-status='retired']").show();
else
$("[data-status='retired']").hide();
});
select_actor = function(actor_id)
{
console.log("SELECTED: " + actor_id)
actual = $("#actual_actor_id").val();
if(actual === actor_id)
{
console.log("NOTHIN CHANGED");
return;
}
$("#"+actual).css("font-weight", "normal");
$("#"+actual).parent().css("background-color", "#fff");
$("#"+actor_id).css("font-weight", "bold");
$("#"+actor_id).parent().css("background-color", "#{actual_background}");
$("#actual_actor_id").val(actor_id);
$("#actual_actor_name").val($("#"+actor_id).text());
$("#submit_button").prop('disabled', false);
}

199
views/old/email.jade Normal file
View File

@@ -0,0 +1,199 @@
include mixins
include mixins_email
doctype html
html
include header
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
script(src='/javascripts/tinymce/tinymce.min.js' )
script(src="/javascripts/validator.min.js")
script(src='/socket.io/socket.io.js')
script(src='/siofu/client.js')
body
+standard_delete_dialog("confirmDelete")
.modal.fade(id="sendEmail", role="dialog", aria-labelledby="sendEmailLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="sendEmailLabel") eMail versenden
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die eMail versendet wird ...
#sendEmail_message
#sendEmail_explanation
.modal-footer
button#sendEmail_closebutton(type="button", class="btn btn-default", data-dismiss="modal", style="display: none;") Schließen
#emailaddresschooser.sidewideoverlay(style="z-index: 5;")
.new_flex_zero
+nav_with_form("PfarrInfoSystem", "PfIS", "entryeditnav")
p.pentryedit_headline eMail-Empfänger auswählen
.new_flex_one(style="margin-bottom: 15px; padding-left: 15px; padding-right: 15px; overflow: auto;")
+email_directinput
.parishdbelemspane(style="margin-top: 5px;")
for elem in parishdb
if elem.type === "person"
+email_do_person(elem)
if elem.type === "group"
+email_do_group(elem)
.root
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
p.pentryedit_headline eMail versenden
button.btn.btn-success.btn-xs#sendbutton(style="margin-left: 15px; margin-right: 5px;", data-toggle="modal" data-target="#sendEmail") Senden
span.glyphicon.glyphicon-info-sign#sendbutton_info(aria-hidden="true", data-toggle="tooltip" data-placement="bottom" title="Sie müssen mindestens einen Empfänger sowie den Betreff angeben!")
.new_flex_one(style="margin-bottom: 15px; padding-left: 15px; padding-right: 15px; overflow: auto;")
+emaildestinationview([], [], [], true, "$('#emailinput').val('peter@halieus.de'); $('#emailaddresschooser').show();")
fieldset(id="fieldset_subject")
legend(style="font-size: 120%; margin-bottom: 0px;") Betreff
//- form#form-subject
//- .form-group
input(type="text", id="subject", class="control-label col-xs-12", oninput="update_sendbutton();")
fieldset(id="fieldset_body")
legend(style="font-size: 120%; margin-bottom: 0px;") Nachricht
textarea#bodyeditor
script.
/*$('#form-subject').validator().on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
console.log(e);
e.preventDefault();
}
});*/
$("#sendbutton").prop('disabled', 'true');
$(function () {
$('[data-toggle="tooltip"]').tooltip();
})
tinymce.editors=[];
tinymce.init({
selector: '#bodyeditor',
resize: false,
language: 'de',
plugins: 'advlist,autolink,autoresize,lists,link,image,charmap,print,preview,anchor,searchreplace,visualblocks,code,insertdatetime,media,table,contextmenu,paste',
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
autoresize_bottom_margin: 5,
autoresize_min_height: 150
});
$("#entryeditnav-form").on('submit', function(e){
console.log('FILTER SUBMIT');
e.preventDefault();
});
function show_searchbar(functiontocall) {
$("#entryeditnav-form").append("<div class='input-group'><div class='input-group-addon'><span class='glyphicon glyphicon-search'></span></div><input class='form-control' type='text' placeholder='Suche' style='display: inline;' oninput='" + functiontocall + "'></input></div>");
}
show_searchbar("adjust_visible_elems(this);"); // can always be on!!!
var __cache_to_is_filled = false;
function update_sendbutton(to_is_filled) {
if(typeof to_is_filled !== 'undefined')
__cache_to_is_filled = to_is_filled;
console.log('update_sendbutton: ', to_is_filled, __cache_to_is_filled);
if(__cache_to_is_filled && $('#subject').val() != '') {
$('#sendbutton').prop('disabled', false);
$('#sendbutton_info').hide();
}
else {
$('#sendbutton').prop('disabled', true);
$('#sendbutton_info').show();
}
}
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
console.log(full);
var sockets = io.connect(full+'/email');
var siofu = new SocketIOFileUpload(sockets);
var is_sending = false;
$('#sendEmail').on('show.bs.modal', function (e) {
is_sending = true;
$("#sendEmail_message").html("");
$("#sendEmail_explanation").html("");
$("#sendEmail_closebutton").hide();
var data = {
dest_to : get_emailaddresses_from_table("#destination_to"),
dest_cc : get_emailaddresses_from_table("#destination_cc"),
dest_bcc : get_emailaddresses_from_table("#destination_bcc"),
subject : $("#subject").val(),
body : tinymce.get('bodyeditor').getContent(),
body_raw: tinymce.get('bodyeditor').getContent({format : 'text'})
};
sockets.emit('email_send', data);
});
$("#sendEmail").on('hidden.bs.modal', function(e) {
is_sending = false;
$("#button_summary_back").show();
$("#button_summary_send").show();
});
sockets.on('email_send_result', function(result) {
console.log('RESULT', result);
$("#sendEmail_message").html(result.message);
$("#sendEmail_explanation").html(result.explanation);
$("#sendEmail_closebutton").show();
});
/*history.replaceState({step : pcalpub_steps.BACK}, document.title, location.pathname);
history.pushState({step : pcalpub_steps.SETTINGS}, 'PfIS: Terminveröffentlichung (Einstellungen)', location.pathname);*/
window.addEventListener("popstate", function(e) {
$("#entryeditnav-form").empty();
if(e.state !== null) {
console.log(e.state);
if(e.state.step === pcalpub_steps.BACK) {
console.log(location.pathname);
window.location.href = location.pathname;
}
if(e.state.step === pcalpub_steps.SETTINGS)
sockets.emit('pcalpub_show_settings', {});
else if(e.state.step === pcalpub_steps.EDITOR) {
if(current_step < pcalpub_steps.EDITOR)
pcalpub_send_html_per_email();
else
sockets.emit('pcalpub_show_html_for_email', {});
}
else if(e.state.step === pcalpub_steps.ADDRESSCHOOSER) {
if(current_step < pcalpub_steps.ADDRESSCHOOSER)
pcalpub_choose_addresses();
else if(is_sending === true)
history.forward(); // we are about to go back from SUMMARY - do not allow that if sending!!!
else
sockets.emit('pcalpub_show_addresschooser_from_saved', {});
}
else if(e.state.step === pcalpub_steps.SUMMARY && ! is_sending) {
if(current_step < pcalpub_steps.SUMMARY) {
console.log("AABB");
submit_emailaddresses();
}
else {
console.log("WRONG");
sockets.emit('pcalpub_show_summary_from_saved', {});
}
}
}
}, false);
+email_scripts("$('#emailaddresschooser').hide();", "update_sendbutton", "confirmDelete")

View File

@@ -0,0 +1,228 @@
include mixins
include mixins_email
mixin do_group(elem)
+email_do_group(elem)
mixin do_person(elem)
+email_do_person(elem)
.subroot(style="height: 100%;")
.new_flex_zero(style="padding-left: 15px; padding-right: 15px;")
p.pentryedit_subheadline Geben Sie die eMail-Adressen an. Sie können dazu aus der Pfarrdatenbank eine Person oder eine Gruppe wählen!
form(class="form-horizontal", id="form-parishdbpersongroupselector")
fieldset(id="filedset_to")
legend(style="font-size: 120%; margin-bottom: 0px;") Empfänger
#destination_to_parent
if dest_to.length > 0
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;', id="destination_to")
each empf in dest_to
tr(data-addresses="#{empf.addresses}", data-recipient-name="#{empf.recipient_name}")
td(class="the_email_recipient", width="90%") !{empf.recipient}
td
span( class="glyphicon glyphicon-trash",
aria-hidden="true",
style="color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;"
data-toggle="modal",
data-target="#confirmDelete",
data-delete-type="to", data-delete-name="#{empf.recipient_name}")
else
p <i>Keine Empfänger in dieser Kategorie angegeben.</i>
- var display_fieldset_cc = (dest_cc.length > 0 ? "" : "display: none;");
fieldset(style=display_fieldset_cc, id="fieldset_cc")
legend(style="font-size: 120%; margin-bottom: 0px;") Kopie
#destination_cc_parent
if dest_cc.length > 0
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;', id="destination_cc")
each empf in dest_cc
tr(data-addresses="#{empf.addresses}", data-recipient-name="#{empf.recipient_name}")
td(class="the_email_recipient", width="90%") !{empf.recipient}
td
span( class="glyphicon glyphicon-trash",
aria-hidden="true",
style="color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;"
data-toggle="modal",
data-target="#confirmDelete",
data-delete-type="cc", data-delete-name="#{empf.recipient_name}")
else
p <i>Keine Empfänger in dieser Kategorie angegeben.</i>
- var display_fieldset_bcc = (dest_bcc.length > 0 ? "" : "display: none;");
fieldset(style="margin-bottom: 10px;" + display_fieldset_bcc, id="fieldset_bcc")
legend(style="font-size: 120%; margin-bottom: 0px;") Blindkopie
#destination_bcc_parent
if dest_bcc.length > 0
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;', id="destination_bcc")
each empf in dest_bcc
tr(data-addresses="#{empf.addresses}", data-recipient-name="#{empf.recipient_name}")
td(class="the_email_recipient", width="90%") !{empf.recipient}
td
span( class="glyphicon glyphicon-trash",
aria-hidden="true",
style="color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;"
data-toggle="modal",
data-target="#confirmDelete",
data-delete-type="bcc", data-delete-name="#{empf.recipient-name}")
else
p <i>Keine Empfänger in dieser Kategorie angegeben.</i>
form(class="form-inline", id="form-emaileditor")
.form-group
label(for="emailinput") eMail - direkte Eingabe: &nbsp;
input(type="email", class="form-control noEnterSubmit", size="65", id="emailinput", placeholder="Gültige eMail-Adresse eingeben, dann Empfangstyp wählen und auf 'Hinzufügen' klicken", required)
select(class="form-control", id="emailinput_type")
option(value="to") An
option(value="cc") Kopie
option(value="bcc") Blindkopie
button(type="submit", class="btn btn-default") Hinzufügen
.row
.col-sm-12 &nbsp;
button(class="btn btn-warning btn-xs", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Zurück
button(class="btn btn-success btn-xs", type="button", id="button_next", onclick="go_forward_to(pcalpub_steps.SUMMARY,submit_emailaddresses);")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Weiter
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px; margin-top: 10px;")
.parishdbelemspane
for elem in parishdb
if elem.type === "person"
+do_person(elem)
if elem.type === "group"
+do_group(elem)
script.
show_searchbar("adjust_visible_elems(this);");
if(#{dest_to.length} === 0)
$("#button_next").prop('disabled', true);
$('.noEnterSubmit').keydown(function(e){
if ( e.which == 13 ) e.preventDefault();
});
function add_email_address(data) {
console.log(data);
var table_selector = "destination_" + data.dest;
var the_table = $("#"+table_selector);
console.log(the_table.length);
$("#fieldset_" + data.dest).show();
if(the_table.length === 0) {
$("#"+table_selector+"_parent").empty();
$("#"+table_selector+"_parent").append("<table width='100%' class='table table-condensed' style='margin-bottom: 10px;' id='" + table_selector + "'></table>");
the_table = $("#"+table_selector);
if(data.dest === "to")
$("#button_next").prop('disabled', false);
}
if(data.description === "")
data.description = "[als Grppe]";
var the_delete = '<span class="glyphicon glyphicon-trash" aria-hidden="true" style="color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;" data-toggle="modal", data-target="#confirmDelete", data-delete-type="' + data.dest + '", data-delete-name="' + data.name + '"></span>';
the_table.append("<tr data-addresses='" + data.address + "' data-recipient-name='" + data.name + "'><td class='the_email_recipient' width='90%;'><p style='margin-bottom: 0px;'>" + data.name + " (" + data.description + ")</p><p class='parishdbelemspane_elem_kontext', style='font-size: 80%;'>(" + data.kontext + ")</p></td><td>" + the_delete + "</td></tr>");
}
function add_email_address_group(data, elem_uid) {
var group_elem = $("#"+elem_uid);
var selects = group_elem.find('select');
console.log(selects);
selects.each(function(index) {
var selected_option = $(this).find("option:selected");
var val = selected_option.val();
console.log(val);
data.address += ";" + val;
})
console.log(data);
add_email_address(data);
}
function set_visibility_according_to_filter(substrRegex, elems) {
var actual_dn = $("#actual_elem_dn").val();
var actual_group = $("#actual_elem_group").val();
elems.each(function(index) {
var txt = $(this).data('elemname');
var show = substrRegex.test(txt);
if(show) {
$(this).show();
}
else {
$(this).hide();
}
});
}
function adjust_visible_elems(my_input) {
console.log(my_input.value);
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(my_input.value, 'i');
set_visibility_according_to_filter(substrRegex, $("[data-parishdb]"));
}
$('#confirmDelete').on('show.bs.modal', function (e) {
$etype = $(e.relatedTarget).attr('data-delete-type');
$ename = $(e.relatedTarget).attr('data-delete-name');
$(this).find('.modal-body p').text("Sind Sie sicher, dass Sie \"" + $ename + "\" aus der Empfängerliste (" + $etype + ") löschen wollen?");
// Pass form reference to modal for submission on yes/ok
var tr = $(e.relatedTarget).closest('tr');
$(this).find('.modal-footer #confirm').data('tr', tr);
$(this).find('.modal-footer #confirm').data('delete-type', $etype);
});
$('#confirmDelete').find('.modal-footer #confirm').on('click', function() {
$etype = $(this).data('delete-type');
console.log($etype);
var tr = $(this).data('tr');
if(tr.is(":last-child") && tr.is(":first-child")) {
var table = tr.closest("table");
var table_id = table.prop('id');
var t_parent = table.parent();
table.remove();
t_parent.append("<p><i>Keine Empfänger in dieser Kategorie angegeben.</i></p>");
if(table_id === "destination_to")
$("#button_next").prop('disabled', true);
}
else
tr.remove();
$('#confirmDelete').modal('hide');
});
$('#form-emaileditor').validator().on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
console.log(e);
var dest;
switch($("#emailinput_type").prop("selectedIndex")) {
case 1: dest="cc"; break;
case 2: dest="bcc"; break;
default: dest="to";
}
add_email_address({'dest': dest, 'name': $("#emailinput").val(), 'kontext': '-', 'description' : 'direkt', 'address': $("#emailinput").val()});
e.preventDefault();
}
});

471
views/old/event_edit.jade Normal file
View File

@@ -0,0 +1,471 @@
include mixins
mixin involved_list_label(name, style_label, style_headline, section_uid)
- var link_add = ( section_uid === '' ? '' : '?role='+ section_uid +'' );
- var glyphicon_class = ( section_uid === '' ? 'glyphicon-thumbs-up' : 'glyphicon-hand-right' );
legend(style=style_label)
table(width="100%")
tr
td
span(class=["glyphicon", glyphicon_class], aria-hidden="true")
span
span(style=style_headline) #{name}
td(align="right")
if section_uid !== ""
button(type="button", class="btn btn-default btn-xs", onclick="save_and_goto('#{event_href}/edit_role/#{section_uid}');")
span(class="glyphicon glyphicon-edit", aria-hidden="true", style='color: blue; display: inline;')
button( type="button", class="btn btn-default btn-xs",
data-toggle="modal", data-target="#confirmDelete", data-delete-type="Dienst", data-delete-name="#{section_name}")
span(class="glyphicon glyphicon-trash", aria-hidden="true", style='color: red; display: inline;')
+dropdown_button("Hinzufügen", "new_involved", "right")
+dropdown_button_element_href("Von Liste", 'javascript: save_and_goto("' +event_href + '/add_actor' + link_add +'");')
+dropdown_button_element_href("Aus Datenbank", "#")
+dropdown_button_element_href("Manuell", "#")
mixin involved_list(the_involved, section_name, section_uid)
.col-sm-12(style="padding-right: 0px;")
if the_involved.length === 0
p Keine Beteiligten ausgewählt.
else
table(class="table table-condensed", style="margin-bottom: 5px;")
thead
tr
th
span(style="color: grey;") Name
th
tbody
each inv in the_involved
tr(id="#{inv.uid}", data-uid="#{inv.uid}", data-role="#{section_uid}")
td(width="80%") #{inv.name}
td(align="right")
span( class="glyphicon glyphicon-trash",
aria-hidden="true",
style='color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;'
data-toggle="modal", data-target="#confirmDelete", data-delete-type="Beteiligten aus dem Bereich '#{section_name}'", data-delete-name="#{inv.name}"
)
mixin location_list(the_locations)
.col-sm-12(style="padding-right: 0px;")
if the_locations.length === 0
p Keine Orte ausgewählt.
else
table(class="table table-condensed", style="margin-bottom: 5px;")
thead
tr
th
span(style="color: grey;") Name
th
span(style="color: grey;") Signum
th
tbody
each loc in the_locations
tr(id="#{loc.uid}", data-uid="#{loc.uid}")
td(width="80%") #{loc.name}
td(widht="10%") #{loc.sign}
td(align="right")
span( class="glyphicon glyphicon-trash",
aria-hidden="true",
style='color: red; padding-right: 10px; padding-left: 10px; cursor: pointer;'
data-toggle="modal", data-target="#confirmDelete", data-delete-type="Ort", data-delete-name="#{loc.name}"
)
- var parent_event_uuid = (is_thereafter ? parent_event.uuid : "");
doctype html
html
include header
script(src='/javascripts/socket.io.js' )
script(src="/javascripts/jquery.loading.min.js")
link(href="/stylesheets/jquery.loading.min.css", rel="stylesheet")
script(src="/javascripts/validator.min.js")
body(style="overflow: hidden;")
.modal.fade(id="confirmDelete", role="dialog", aria-labelledby="confirmDeleteLabel", aria-hidden="true")
.modal-dialog
.modal-content
.modal-header
button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
h4(class="modal-title") Löschen bestätigen
.modal-body
p Sind Sie sicher, dass Sie das Ereignis löschen wollen?
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-danger", id="confirm") Löschen
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem: Ereignis bearbeiten", "dropdown_menu")
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
p Ereignis am #{date.weekday_short}, #{date.day}. #{date.month} #{date.year} #{edit_type}.
form(class="form-horizontal", role="form", id="form", method="POST", action="#{event_href}/commit")
button(class="btn btn-success btn-xs", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
.form-group
if ! is_thereafter
label(for='edit_kontext', class="col-sm-2 control-label") Kontext
.col-sm-10
.input-group
input(id="edit_kontext_dn", type="hidden", name="punit_dn", value="#{event.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{event.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="save_and_goto('#{event_href}/select_pastoralunit')") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Name
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{event.name}", required)
.help-block.with-errors
.form-group
label(for='edit_name_secondary', class="col-sm-2 control-label") Zusatz zum Namen
.col-sm-10
input(id='edit_name_secondary', type="text", class="form-control noEnterSubmit", name="edit_name_secondary", value="#{event.name_secondary}")
.help-block.with-errors
.form-group
label(for='combo_type', class="col-sm-2 control-label") Typ
.col-sm-10
select(id='combo_type', name="combo_type", class="form-control")
option(value="gdx") Gottesdienst (außergewöhnlich)
option(value="gd") Gottesdienst
option(value="publx") Öffentlich (außergewöhnlich)
option(value="publ") Öffentlich
option(value="intern") Intern
option(value="hidden") Verborgen
script.
/*switch("{event.pretty.visibility_short}")
{
case "[G+]":
$("#combo_type").val("gdx");
break;
case "[G]":
$("#combo_type").val("gd");
break;
case "[Ö+]":
$("#combo_type").val("publx");
break;
case "[Ö]":
$("#combo_type").val("publ");
break;
case "[I]":
$("#combo_type").val("intern");
break;
case "[V]":
$("#combo_type").val("hidden");
break;
}*/
$("#combo_type").val("#{event.visibility}")
if ! is_thereafter
.form-group
label(for='edit_begin', class="col-sm-2 control-label") Beginn
.col-sm-5
input(id='edit_begin', type="text", class="form-control noEnterSubmit", name="edit_begin",
pattern="([01][0-9]|2[0-3]):[0-5][0-9]",
data-error="Bitte geben Sie eine gültige Uhrzeit ein!",
data-when_end_then_start="bar",
data-when_end_then_start-error="Wenn Sie ein Ende angeben, müssen Sie auch einen Beginn angeben!",
value="#{event.start}")
.help-block.with-errors
- var disable_end = is_thereafter && parent_event.start == "";
.form-group(style="margin-bottom: 5px;")
label(for='edit_end', class="col-sm-2 control-label") Ende
.col-sm-5
input(id='edit_end', type="text", class="form-control noEnterSubmit", name="edit_end",
pattern="(([01][0-9]|2[0-3]):[0-5][0-9])|(24:00)",
data-error="Bitte geben Sie eine gültige Uhrzeit ein!",
data-end_after_start="bar",
data-end_after_start-error="Das Ende muss nach dem Beginn liegen!",
value="#{event.end}",
disabled=disable_end)
.help-block.with-errors
if disable_end
p Da das übergeordnete Ereignis keinen Beginn hat, können Sie hier kein Ende angeben!
.form-group
label(for='check_end_is_vague', class="col-sm-2 control-label", id="check_end_is_vague_label") Ende ist ungenau
.col-sm-5.checkbox
label
input(id='check_end_is_vague', type="checkbox", name="check_end_is_vague", disabled=disable_end)
script.
if($('#edit_end').val().trim().length===0)
{
$('#check_end_is_vague').prop('disabled', true);
$('#check_end_is_vague_label').css('color','grey');
}
$("#edit_end").on('keyup blur', function(){
var disable_end_is_vague = (this.value.trim().length===0);
$('#check_end_is_vague').prop('disabled', disable_end_is_vague);
$('#check_end_is_vague_label').css('color', (disable_end_is_vague ? "grey" : "black"));
});
fieldset(class="col-xs-12 col-sm-6", style="margin-bottom: 20px;", id="locations")
legend(style="font-size: 150%; margin-bottom: 10px;")
table(width="100%")
tr
td Orte
td(align="right")
+dropdown_button("Hinzufügen", "new_location", "right")
+dropdown_button_element_href("Von Liste", "javascript: save_and_goto('" + event_href +"/add_predefined_location');")
+dropdown_button_element_href("Manuell", "#")
+location_list(event.locations)
fieldset(class="col-xs-12 col-sm-6")
legend(style="font-size: 150%;") Beteiligte
fieldset(class="col-sm-12", style="padding-right: 0px;")
+involved_list_label("Allgemein", "font-size: 130%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(event.involved, "Allgemein", "")
fieldset(class="col-sm-12", style="margin-top: 15px; padding-right: 0px;")
legend(style="font-size: 130%; margin-bottom: 10px;")
table(width="100%")
tr
td
span(class=["glyphicon", "glyphicon-thumbs-up"], aria-hidden="true")
span
span(style=style_headline) <i>Dienste</i>
td(align="right")
button(type="button", class="btn btn-default btn-xs", onclick="save_and_goto('#{event_href}/add_role');")
span( class="glyphicon glyphicon-plus", aria-hidden="true")
span
span Dienst hinzufügen
if event.involved_roles.length === 0
.col-sm-12
p Keine Dienste angegeben
else
div
each role in event.involved_roles
fieldset(class="col-sm-12", style="padding-right: 0px; margin-top: 5px;", data-uid="#{role.uid}")
+involved_list_label(role.name, "font-size: 120%; margin-bottom: 5px;", "font-weight: normal; font-style: italic;", role.uid)
+involved_list(role.involved, role.name, role.uid)
fieldset(class="col-sm-12", style="margin-top: 20px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{event.description}
fieldset(class="col-sm-12", style="margin-top: 20px;")
legend(style="font-size: 150%") Anmerkungen
textarea(class="form-control", rows="5", id="area_annotations", name="area_annotations").
#{event.annotations}
br
span &nbsp;
br
span &nbsp;
br
span &nbsp;
br
span &nbsp;
br
span &nbsp;
script.
$('.noEnterSubmit').keypress(function(e){
if ( e.which == 13 ) e.preventDefault();
});
var is_thereafter = #{is_thereafter};
$(document).ready(function(){
$('#form').validator({
custom: {
end_after_start: function(el)
{
var start = "";
if(is_thereafter)
start = parent_event.start;
else
start = $('#edit_begin').val();
var end = $('#edit_end').val();
if(end.length === 0)
return true;
return Date.parse("2015-08-31T"+end) > Date.parse("2015-08-31T"+start);
},
when_end_then_start: function(el)
{
console.log("WHEN END THEN START");
var start = $('#edit_begin').val().trim();
var end = $('#edit_end').val().trim();
if(end.length > 0&& start.length===0)
return false;
return true;
}
},
errors: {
end_after_start: "Das Ende des Ereignisses muss nach dessen Beginn liegen!",
when_end_then_start: "Wenn Sie ein Ende angeben, müssen Sie auch einen Beginn angeben!"
}
}).on('invalid.bs.validator', function (e) {
console.log("INVALID");
console.log(e);
}).on('valid.bs.validator', function (e) {
console.log("VALID");
console.log(e);
})});
var sockets = io.connect();
$('#confirmDelete').on('show.bs.modal', function (e) {
$etype = $(e.relatedTarget).attr('data-delete-type');
$ename = $(e.relatedTarget).attr('data-delete-name');
$(this).find('.modal-body p').text("Sind Sie sicher, dass Sie \"" + $ename + "\" als " + $etype + " löschen wollen?");
console.log($etype);
if($etype === "Dienst")
{
var fieldset = $(e.relatedTarget).closest('fieldset');
$(this).find('.modal-footer #confirm').data('fieldset', fieldset);
}
else
{
// Pass form reference to modal for submission on yes/ok
var tr = $(e.relatedTarget).closest('tr');
$(this).find('.modal-footer #confirm').data('tr', tr);
}
$(this).find('.modal-footer #confirm').data('delete-type', $etype);
});
$('#confirmDelete').find('.modal-footer #confirm').on('click', function() {
$etype = $(this).data('delete-type');
console.log($etype);
if($etype === "Dienst")
{
var fieldset = $(this).data('fieldset');
var uid = fieldset.data('uid');
var request = {day: "#{date.date}", event: "#{event.uuid}", uid: uid, is_thereafter: is_thereafter};
if(is_thereafter)
request.parent_event = "#{parent_event_uuid}"
sockets.emit('event_remove_role', request);
}
else
{
var tr = $(this).data('tr');
var uid = tr.data('uid');
var request = {day: "#{date.date}", event: "#{event.uuid}", uid: uid, is_thereafter: is_thereafter};
if(is_thereafter)
request.parent_event = "#{parent_event_uuid}"
if($etype === "Ort")
{
sockets.emit('event_remove_location', request);
}
else
{
var role = tr.data('role');
request.role = role;
sockets.emit('event_remove_involved', request);
}
}
});
sockets.on('event_remove_involved_result', function(data) {
var tr = $('#confirmDelete').find('.modal-footer #confirm').data('tr');
if(tr.is(":last-child") && tr.is(":first-child"))
{
var table = tr.closest("table");
var t_parent = table.parent();
table.remove();
t_parent.append("<p>Keine Beteiligten ausgewählt.</p>")
}
else
tr.remove();
$('#confirmDelete').modal('hide');
});
sockets.on('event_remove_location_result', function(data) {
var tr = $('#confirmDelete').find('.modal-footer #confirm').data('tr');
if(tr.is(":last-child") && tr.is(":first-child"))
{
var table = tr.closest("table");
var t_parent = table.parent();
table.remove();
t_parent.append("<p>Keine Orte ausgewählt.</p>")
}
else
tr.remove();
$('#confirmDelete').modal('hide');
});
sockets.on('event_remove_role_result',function(data){
var fieldset = $('#confirmDelete').find('.modal-footer #confirm').data('fieldset');
var is_last_role = (fieldset.is(":last-child") && fieldset.is(":first-child"));
var f_parent = fieldset.parent();
fieldset.remove();
if(is_last_role)
f_parent.append("<div class='col-sm-12'><p>Keine Dienste angegeben.</p></div>")
$('#confirmDelete').modal('hide');
});
function save_and_goto(href) {
var event = {
uuid : "#{event.uuid}",
punit : { name : $("#edit_kontext").val(), dn : $("#edit_kontext_dn").val() },
name : $("#edit_name").val(),
name_secondary: $("#edit_name_secondary").val(),
visibility: $("#combo_type").val(),
end : $("#edit_end").val(),
end_is_vague : $("#check_end_is_vague").prop("checked"),
description : $("#area_description").val(),
annotations : $("#area_annotations").val()
};
if( ! is_thereafter)
event.start = $("#edit_begin").val();
else
event.parent_uuid = "#{parent_event_uuid}"
console.log(event);
sockets.emit('event_save', { day: "#{date.date}", event : event, is_thereafter : is_thereafter });
location.assign(href);
}
// HANDLE SIMPLE BACK
history.replaceState({direction: 'back'}, document.title, location.pathname);
history.pushState({direction: 'actual'}, document.title, location.pathname);
window.addEventListener("popstate", function(e) {
console.log(e.state);
if((e.state !== null) && (e.state.direction === "back")) {
history.replaceState(null, document.title, location.pathname);
setTimeout(function(){
location.replace("#{event_href}/cancel");
},0);
}
}, false);

133
views/old/index.jade Normal file
View File

@@ -0,0 +1,133 @@
include mixins
include mixins_day
doctype html
html
include header
script(src='/javascripts/pfiswebsocket.js')
script(src='/javascripts/runtime.js')
script(src='/templates/daycontent.js')
script(src='/templates/errorview_inlay.js')
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
body
if can_go_back === false
script.
history.pushState(null, null, location.href);
window.onpopstate = function(event) {
history.go(1);
};
.modal.fade(id="daypickerDialog", role="dialog", aria-labelledby="daypickerDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
h4(class="modal-title" id="daypickerDialogLabel") Datum anspringen
.modal-body
#datepicker()
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-success", id="confirm") Anspringen
+standard_delete_dialog("confirmDelete")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
+nav_item( "#", "active" ) Tag
+nav_item( "/timeline/" + date.date) TagZeitleiste
+nav_item( "/week/" + date.date) Woche
+nav_item( "/day/"+date.date+"/select_punits_for_view" ) Angezeigte Orte konfigurieren
+nav_item( "/info" ) Info
#dataparent.subroot.full_height(style="height: 100%; margin-top: 5px;")
+daycontent(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
script.
var ws;
$(document).ready(function() {
console.log('NOW CONNECTING');
ws = new PfISWebSocket("#{sessionuuid}");
ws.bind_standard_close_handler();
ws.bind('get_parishday_result', function(data){
console.log('day_goto_result');
history.replaceState(null, document.title, "/day/" + data.date.date + "?back=false");
var html = daycontent_template(data);
$('#dataparent').html(html);
var timeline_elem = $('.navbar-collapse > ul > li:nth(1) > a');
timeline_elem.prop('href', '/timeline/' + data.date.date);
var week_elem = $('.navbar-collapse > ul > li:nth(2) > a');
week_elem.prop('href', '/week/' + data.date.date);
console.log(week_elem);
});
ws.bind('pentry_delete_result', function(data) {
console.log("pentry_delete_result", data);
if(data.result === 'OK') {
var button = $('[data-pentry-uuid="'+ data.uuid + '"]');
var type = data.pentrytype;
var box = button.closest('.' + type);
box.remove();
}
var messages = errorview_inlay_template({ messages: data.messages, is_error: (data.result === 'OK' ? false : true), session_ended: false});
$('#daycontrol_parent').append(messages);
$('#confirmDelete').modal('hide');
});
});
function day_goto(new_date) {
console.log(new_date);
ws.send('get_parishday', {format : "day", date : new_date});
}
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
$('#daypickerDialog').on('show.bs.modal', function (e) {
date = $(e.relatedTarget).attr('data-date');
$('#datepicker').datepicker("update", date);
});
$('#daypickerDialog').find('.modal-footer #confirm').on('click', function() {
$('#daypickerDialog').modal('hide');
console.log('CLICKED');
day_goto($("#datepicker").datepicker('getFormattedDate'));
});
function toggle_pentrydetails_visibility(pentry) {
$(pentry).find(".pentry_details").toggle();
}
$('#confirmDelete').on('show.bs.modal', function (e) {
$etitle = $(e.relatedTarget).attr('data-pentry-title');
$(this).find('.modal-body p').text("Sind Sie sicher, dass Sie " + $etitle + " löschen wollen?");
$(this).find('.modal-footer #confirm').data('button', $(e.relatedTarget));
});
$('#confirmDelete').find('.modal-footer #confirm').on('click', function() {
var delete_button = $(this).data('button');
var date = delete_button.data('date');
var type = delete_button.data('pentry-type');
var uuid = delete_button.data('pentry-uuid');
console.log(date, type, uuid);
ws.send('pentry_delete', { date: date, pentrytype: type, uuid: uuid });
});

View File

@@ -0,0 +1,179 @@
include mixins
include mixins_day
doctype html
html
include header
script(src='/javascripts/socket.io.js' )
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
body(style="overflow: hidden;")
if can_go_back === false
script.
history.pushState(null, null, location.href);
window.onpopstate = function(event) {
history.go(1);
};
.modal.fade(id="daypickerDialog", role="dialog", aria-labelledby="daypickerDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
h4(class="modal-title" id="daypickerDialogLabel") Datum anspringen
.modal-body
#datepicker()
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-success", id="confirm") Anspringen
+standard_delete_dialog("confirmDelete")
//- .modal.fade(id="confirmDelete", role="dialog", aria-labelledby="confirmDeleteLabel", aria-hidden="true")
//- .modal-dialog(role="document")
//- .modal-content
//- .modal-header
//- button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
//- h4(class="modal-title", id="confirmDeleteLabel") Löschen bestätigen
//- .modal-body
//- p Sind Sie sicher, dass Sie das Ereignis löschen wollen?
//- .modal-footer
//- button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
//- button(type="button", class="btn btn-danger", id="confirm") Löschen
.root
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
+nav_item( "#", "active" ) Tag
+nav_item( "/timeline/" + date.date) TagZeitleiste
+nav_item( "/week/" + date.date) Woche
+nav_item( "/day/"+date.date+"/select_punits_for_view" ) Angezeigte Orte konfigurieren
+nav_item( "/info" ) Info
#dataparent.subroot(style="overflow: hidden; height: 100%;")
.new_flex_zero(style="margin-bottom: 15px; padding-left: 15px; padding-right: 15px;")
#daycontrol_parent
+daycontrol(date, litinfo, last_week, yesterday, tomorrow, next_week)
+messageview(messages)
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
.row
.col-xs-12.col-sm-6
fieldset(style="margin-bottom: 20px;")
legend
table(width="100%")
tr
td.
Meine Termine & Co.
td(align="right")
+dropdown_button("Neu erstellen", "new_own", "right")
- var link = "/" + date.date + "/new/edit";
+dropdown_button_element_href("Ereignis", "/event" + link)
+dropdown_button_element_href("Zu-Beachten", "/keep_in_mind" + link)
+dropdown_button_element_href("Zu-Tun", "/todo" + link)
+dropdown_button_element_href("Abwesenheit", "/away" + link)
+dropdown_button_element_href("Fahrzeugenutzung", "/vehicle_use" + link)
#activities_own
+day_activities(date, parishcal, "own")
.col-xs-12.col-sm-6
fieldset(style="margin-bottom: 20px;")
legend Andere Termine & Co.
#activities_other
+day_activities(date, parishcal, "other")
+day_birthdays(parishcal.birthdays)
script.
var sockets;
$(document).ready(function() {
console.log('NOW CONNECTING');
sockets = io.connect();
sockets.on('invalid_session_data', function(data) {
console.log('invalid_session_data', data);
alert('INVALID SESSION PROVIDED!');
});
sockets.on('day_goto_result',function(data){
console.log('day_goto_result');
if(data.result === "OK") {
var html = $(data.html);
history.replaceState(null, document.title, "/day/" + data.date + "?back=false");
$('#dataparent').html(data.html);
var timeline_elem = $('.navbar-collapse > ul > li:nth(1) > a');
timeline_elem.prop('href', '/timeline/' + data.date);
var week_elem = $('.navbar-collapse > ul > li:nth(2) > a');
week_elem.prop('href', '/week/' + data.date);
console.log(week_elem);
}
else {
$('#dataparent').html("<div class='new_flex_one' style='padding-left: 15px; padding-right: 15px;'>"+data.html+"</div>");
}
});
sockets.on('pentry_delete_result', function(data) {
console.log("pentry_delete_result");
if(data.result === 'OK') {
var button = $('[data-pentry-uuid="'+ data.uuid + '"]');
var type = data.pentrytype;
var box = button.closest('.' + type);
box.remove();
}
$('#daycontrol_parent').append(data.message);
$('#confirmDelete').modal('hide');
});
});
function day_goto(new_date) {
console.log(new_date);
sockets.emit('day_goto', {date : new_date});
}
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
$('#daypickerDialog').on('show.bs.modal', function (e) {
date = $(e.relatedTarget).attr('data-date');
$('#datepicker').datepicker("update", date);
});
$('#daypickerDialog').find('.modal-footer #confirm').on('click', function() {
$('#daypickerDialog').modal('hide');
console.log('CLICKED');
day_goto($("#datepicker").datepicker('getFormattedDate'));
});
function toggle_pentrydetails_visibility(pentry) {
$(pentry).find(".pentry_details").toggle();
}
$('#confirmDelete').on('show.bs.modal', function (e) {
$etitle = $(e.relatedTarget).attr('data-pentry-title');
$(this).find('.modal-body p').text("Sind Sie sicher, dass Sie " + $etitle + " löschen wollen?");
$(this).find('.modal-footer #confirm').data('button', $(e.relatedTarget));
});
$('#confirmDelete').find('.modal-footer #confirm').on('click', function() {
var delete_button = $(this).data('button');
var date = delete_button.data('date');
var type = delete_button.data('pentry-type');
var uuid = delete_button.data('pentry-uuid');
console.log(date, type, uuid);
sockets.emit('pentry_delete', { date: date, pentrytype: type, uuid: uuid });
});

View File

@@ -0,0 +1,94 @@
include mixins
- var actual_background = "yellow";
mixin do_location(location)
- style="cursor: pointer;";
- style_text="";
- if(actual_location_id === location.id) { style+="background-color: " + actual_background; style_text="font-weight: bold;" }
li(class="list-group-item" style=style, onclick="select_location('#{location.id}')")
table(width="100%")
tr
td(style="width: 80%;")
span(id="#{location.id}", style=style_text) #{location.name}
td
span(id="#{location.id}_sign", style=style_text) #{location.sign}
//-div(style="float: left;")
//-div(style="float: right;")
mixin do_unit(unit)
li(class="list-group-item")
<b>#{unit.name}</b>
if unit.locations.length > 0
ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
each location in unit.locations
+do_location(location)
if unit.subunits.length > 0
ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
each sub in unit.subunits
+do_unit(sub)
doctype html
html
include header
body(style="overflow: hidden;")
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid(style="margin-bottom: 18px;")
p.
Wählen Sie einen Ort aus der Liste!
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
form(class="form-horizontal" method="POST", action="#{pentry_edit_base}/add_predefined_location")
input(type="hidden", name="actual_location_id", id="actual_location_id", value="#{actual_location_id}")
input(type="hidden", name="actual_location_name", id="actual_location_name", value="#{actual_location_name}")
input(type="hidden", name="actual_location_sign", id="actual_location_sign", value="#{actual_location_sign}")
button(class="btn btn-success btn-xs", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
ul(class="list-group")
for unit in units
+do_unit(unit)
script.
if("#{actual_location_id}" === "")
$("#submit_button").prop('disabled', true);
select_location = function(location_id)
{
console.log("SELECTED: " + location_id)
actual = $("#actual_location_id").val();
if(actual === location_id)
{
console.log("NOTHIN CHANGED");
return;
}
$("#"+actual).css("font-weight", "normal");
$("#"+actual+"_sign").css("font-weight", "normal");
$("#"+actual).closest("li").css("background-color", "#fff");
$("#"+location_id).css("font-weight", "bold");
$("#"+location_id+"_sign").css("font-weight", "bold");
$("#"+location_id).closest("li").css("background-color", "#{actual_background}");
$("#actual_location_id").val(location_id);
$("#actual_location_name").val($("#"+location_id).text());
$("#actual_location_sign").val($("#"+location_id+"_sign").text());
$("#submit_button").prop('disabled', false);
}

127
views/old/oldindex.jade Normal file
View File

@@ -0,0 +1,127 @@
include mixins
doctype html
html
include header
body(style="overflow: hidden;")
- var red_class = litinfo.decoration_hint_red ? "litpanel_red" : "";
- litinfo.celebration = litinfo.celebration.replace("\\n", "<br/>");
- litinfo.celebration_add = litinfo.celebration_add.replace("\n", "<br/>");
- litinfo.infos = litinfo.infos.replace("\\n","<br/>");
- var celebration_class = "";
- if(litinfo.decoration_hint == 2) celebration_class = "litpanel_bold";
- if(litinfo.decoration_hint == 1) celebration_class = "litpanel_italic";
if can_go_back === false
script.
history.pushState(null, null, location.href);
window.onpopstate = function(event) {
history.go(1);
};
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem", "dropdown_menu")
+nav_item( "#", "active" ) Tag
+nav_item( "/week/" + date.date) Woche
+nav_item( "/day/select_punits_for_view" ) Angezeigte Orte konfigurieren
+nav_item( "/info" ) Info
input(type="checkbox" id="refreshCheck")
script.
$(function () {
if ($('#refreshCheck')[0].checked)
window.location.reload();
$('#refreshCheck')[0].checked = true;
});
.container-fluid(style="margin-bottom: 18px;")
form(id="control", action="/adjust_date" method="POST")
input(type="hidden" name="adjust_date" id="adjust_date")
table(width="100%")
tr
td(colspan=2, width="20%")
a(href="/day/#{last_week}", class="litpanel_arrow") ⇐
a(href="/day/#{yesterday}", class="litpanel_arrow") ←
td(colspan=2, style="text-align: center; width: 60%;")
a(href="/day/picker?start="+ date.date, style="color: black;")
span(class=["litpanel_day_mobile", red_class]) #{date.weekday_short},&nbsp;#{date.day}.&nbsp;#{date.month_short}&nbsp;#{date.year}
span(class=["litpanel_day_mobile_littime", red_class]) [#{litinfo.time}]
td(colspan=2, style="text-align: right; width: 20%;")
a(href="/day/#{tomorrow}", class="litpanel_arrow") →
a(href="/day/#{next_week}", class="litpanel_arrow") ⇒
tr
td(colspan=6, class="litpanel_month_week_weekday litpanel_celebration_parent")
span(class=["litpanel_celebration", celebration_class, red_class]) !{litinfo.celebration}
if litinfo.celebration_add != ""
tr
td(colspan=6, class=["litpanel_month_week_weekday", "litpanel_celebration_parent", red_class])
span(class="litpanel_celebration_add") !{litinfo.celebration_add}
if litinfo.infos != ""
tr
td(colspan=6, class="litpanel_month_week_weekday litpanel_celebration_parent")
span(class="litpanel_infos") !{litinfo.infos}
+messageview(messages)
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
.row
.col-xs-12.col-sm-6
fieldset(style="margin-bottom: 20px;")
legend
table(width="100%")
tr
td.
Meine Termine & Co.
td(align="right")
+dropdown_button("Neu erstellen", "new_own", "right")
-var link = "/" + date.date + "/new/edit";
+dropdown_button_element_href("Ereignis", "/event" + link)
+dropdown_button_element_href("Zu-Beachten", "#")
+dropdown_button_element_href("Zu-Tun", "#")
+dropdown_button_element_href("Abwesenheit", "#")
+dropdown_button_element_href("Fahrzeugenutzung", "#")
each a in parishcal.away.own
+day_away(a)
each t in parishcal.todo.own
+day_todo(t)
each k in parishcal.keep_in_mind.own
+day_keep_in_mind(k)
each v in parishcal.vehicle_use.own
+day_vehicle_use(v)
each event in parishcal.events.own
+pevent_with_thereafter(date.date, event)
.col-xs-12.col-sm-6
fieldset(style="margin-bottom: 20px;")
legend Andere Termine & Co.
each a in parishcal.away.other
+day_away(a)
each t in parishcal.todo.other
+day_todo(t)
each k in parishcal.keep_in_mind.other
+day_keep_in_mind(k)
each v in parishcal.vehicle_use.other
+day_vehicle_use(v)
each event in parishcal.events.other
+pevent_with_thereafter(date.date, event)

View File

@@ -0,0 +1,74 @@
include mixins
- var actual_background = "yellow";
mixin punit(pu)
- style="cursor: pointer; ";
- style_text="";
- if(actual_punit_dn === pu.dn) { style+="background-color: " + actual_background; style_text="font-weight: bold;" }
li(class="list-group-item", style=style, onclick="select_pastoralunit('#{pu.dn}');")
span(id="#{pu.dn}", style=style_text) #{pu.name}
if pu.subunits.length > 0
ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
each sub in pu.subunits
+punit(sub)
doctype html
html
include header
body(style="overflow: hidden;")
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid(style="margin-bottom: 18px;")
p.
Wählen Sie den zugehörigen pastoralen Kontext aus!
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
form(class="form-horizontal" method="POST", action="#{pentry_edit_base}/pastoralunit_selected")
input(type="hidden", name="actual_punit_dn", id="actual_punit_dn", value="#{actual_punit_dn}")
input(type="hidden", name="actual_punit_name", id="actual_punit_name", value="#{actual_punit_name}")
button(class="btn btn-success btn-xs", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
ul(class="list-group")
for pu in pastoralunits
+punit(pu)
script.
select_pastoralunit = function(punit_dn)
{
console.log("SELECTED: " + punit_dn)
actual = $("#actual_punit_dn").val();
if(actual === punit_dn)
{
console.log("NOTHIN CHANGED");
return;
}
actual_jquery = actual.replace(/\//g, "\\/");
$("#"+actual_jquery).css("font-weight", "normal");
$("#"+actual_jquery).parent().css("background-color", "#fff");
punit_dn_jquery = punit_dn.replace(/\//g, "\\/");
console.log(punit_dn_jquery);
$("#"+punit_dn_jquery).css("font-weight", "bold");
$("#"+punit_dn_jquery).parent().css("background-color", "#{actual_background}");
$("#actual_punit_dn").val(punit_dn);
$("#actual_punit_name").val($("#"+punit_dn_jquery).text());
}

442
views/old/pcalpub.jade Normal file
View File

@@ -0,0 +1,442 @@
- var publicationformats_string = JSON.stringify(publicationformats);
include mixins
include mixins_pcalpub
doctype html
html
include header
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
script(src='/javascripts/tinymce/tinymce.min.js' )
script(src="/javascripts/validator.min.js")
script(src='/socket.io/socket.io.js')
script(src='/siofu/client.js')
script(src='/javascripts/pfiswebsocket.js')
body(style="overflow: hidden;")
+standard_delete_dialog("confirmDelete")
.modal.fade(id="sendEmail", role="dialog", aria-labelledby="sendEmailLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="sendEmailLabel") eMail versenden
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die folgenden Schritte ausgeführt werden:
table(class="table table-condensed")
tr
td
span#status_collect(class="glyphicon glyphicon-unchecked", aria-hidden="true")
td <b>Sammle Informationen</b>
tr
td
span#status_convert(class="glyphicon glyphicon-unchecked", aria-hidden="true")
td <b>Konvertiere Daten in das DOC-Format</b>
tr
td
span#status_send(class="glyphicon glyphicon-unchecked", aria-hidden="true")
td <b>Versende eMail</b>
#sendEmail_message
#sendEmail_explanation
.modal-footer
button#sendEmail_closebutton(type="button", class="btn btn-default", data-dismiss="modal", style="display: none;") Schließen
.root
.new_flex_zero
+nav_with_form("PfarrInfoSystem", "PfIS", "entryeditnav")
.container-fluid
h1 Eine Terminveröffentlichung erstellen
.new_flex_one
.container-fluid
+pcalpubsettings(0,0,2, date, publicationformats)
script.
$("#entryeditnav-form").on('submit', function(e){
console.log('FILTER SUBMIT');
e.preventDefault();
});
function show_searchbar(functiontocall) {
$("#entryeditnav-form").append("<div class='input-group'><div class='input-group-addon'><span class='glyphicon glyphicon-search'></span></div><input class='form-control' type='text' placeholder='Suche' style='display: inline;' oninput='" + functiontocall + "'></input></div>");
}
var publicationformats = !{publicationformats_string};
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
console.log(full);
var sockets = io.connect(full+'/pcalpub');
var siofu = new SocketIOFileUpload(sockets);
function activate_datepicker() {
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
}
activate_datepicker();
function update_factories() {
var optionSelected = $("#combo_parish").prop('selectedIndex');
$("#combo_factory").empty();
for(idx = 0; idx < publicationformats[optionSelected].publicationformats.length; ++idx) {
var factory = publicationformats[optionSelected].publicationformats[idx];
$("#combo_factory").append($("<option></option>").text(factory.name));
}
update_buttons();
}
function update_buttons() {
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedFactory = $("#combo_factory").prop('selectedIndex');
var factory = publicationformats[selectedParish].publicationformats[selectedFactory];
console.log(factory);
if(factory.can_html) {
$("#btn_html").prop('disabled', false);
$("#btn_email").prop('disabled', false);
}
else {
$("#btn_html").prop('disabled', true);
$("#btn_email").prop('disabled', true);
}
if(factory.can_custom_background)
$("#fileinput").prop('disabled', false);
else
$("#fileinput").prop('disabled', true);
}
update_buttons();
// ONE SHOT FUNCTIONS BEGIN
var the_new_win;
function pcalpub_generate_html() {
console.log('btn_html');
the_new_win = window.open('', '_blank');
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedFactory = $("#combo_factory").prop('selectedIndex');
var durance = parseInt($("#combo_durance").val());
var date = $("#datepicker").datepicker('getFormattedDate');
sockets.emit('pcalpub_generate_html', { parishid : selectedParish, factoryid : selectedFactory, date: date, durance : durance, publicationformats : publicationformats});
return false;
}
sockets.on('pcalpub_generate_html_result', function(data) {
the_new_win.location=data.file;
the_new_win.document.title=data.title;
});
// Do something on upload progress:
siofu.addEventListener("progress", function(event){
var percent = event.bytesLoaded / event.file.size * 100;
//console.log("File is", percent.toFixed(2), "percent loaded");
$("#fileinput_message").text("Date zu " + percent.toFixed(2) +"% hochgeladen.")
});
function pcalpub_generate_and_view_document() {
//var mystate = save_settings();
//sockets.emit('pcalpub_generate_and_view_document', mystate);
the_new_win = window.open('', '_blank');
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedFactory = $("#combo_factory").prop('selectedIndex');
var durance = parseInt($("#combo_durance").val());
var date = $("#datepicker").datepicker('getFormattedDate');
if($("#fileinput").val() == '')
sockets.emit('pcalpub_generate_pdf', { parishid : selectedParish, factoryid : selectedFactory, date: date, durance : durance, use_background: false});
else {
siofu.submitFiles($('#fileinput').prop('files'));
}
}
siofu.addEventListener("complete", function(event){
$("#fileinput_message").text("Erfolgreich hochgeladen");
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedFactory = $("#combo_factory").prop('selectedIndex');
var durance = parseInt($("#combo_durance").val());
var date = $("#datepicker").datepicker('getFormattedDate');
sockets.emit('pcalpub_generate_pdf', { parishid : selectedParish, factoryid : selectedFactory, date: date, durance : durance, use_background: true, background_pdf: event.file.name});
});
sockets.on('pcalpub_generate_pdf_result', function(data) {
the_new_win.location=data.file;
the_new_win.document.title=data.title;
});
// ONE SHOT FUNCTIONS END
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
var pcalpub_steps = { BACK : 0, SETTINGS : 1, EDITOR : 2, ADDRESSCHOOSER : 3, SUMMARY : 4 };
var current_step = pcalpub_steps.SETTINGS;
var highest_reached_step = current_step;
sockets.on('pcalpub_show_settings_result', function(data) {
console.log('pcalpub_show_settings_result');
$(".root").children(".subroot").remove();
$(".root").append(data.html);
activate_datepicker();
update_buttons();
current_step = pcalpub_steps.SETTINGS;
//$('body').loading('stop');
});
function pcalpub_send_html_per_email() {
var mydata = {
publicationformats : publicationformats,
parishid: $("#combo_parish").prop('selectedIndex'),
factoryid: $("#combo_factory").prop('selectedIndex'),
durance: parseInt($("#combo_durance").val()),
date: $("#datepicker").datepicker('getFormattedDate')
};
console.log(mydata);
sockets.emit('pcalpub_generate_html_for_email', mydata);
}
sockets.on('pcalpub_generate_html_for_email_result', function(data) {
console.log('pcalpub_generate_html_for_email_result');
console.log(data);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
//$(".subroot > .new_flex_one").scrollTop(0);
if(highest_reached_step < pcalpub_steps.EDITOR) {
highest_reached_step = pcalpub_steps.EDITOR;
console.log('push EDITOR');
history.pushState({ step: pcalpub_steps.EDITOR }, 'PfIS: Terminveröffentlichung (HTML)', document.pathname);
}
current_step = pcalpub_steps.EDITOR;
});
/*function save_html() {
var mystate = { direction: 'html_for_email_edit_from_saved',
html : tinymce.get('html_for_email').getContent()
};
console.log(mystate);
history.replaceState(mystate, 'PfIS: Terminveröffentlichung (HTML [saved])', location.pathname);
return mystate;
}*/
function pcalpub_choose_addresses() {
var mydata = { html : tinymce.get('html_for_email').getContent() };
sockets.emit('pcalpub_show_addresschooser', mydata);
}
sockets.on('pcalpub_show_addresschooser_result', function(data) {
console.log('pcalpub_show_addresschooser_result', data.push_state);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$(".subroot > .new_flex_one").scrollTop(0);
if(highest_reached_step < pcalpub_steps.ADDRESSCHOOSER) {
highest_reached_step = pcalpub_steps.ADDRESSCHOOSER;
console.log('push ADDRESSCHOOSER');
history.pushState({ step : pcalpub_steps.ADDRESSCHOOSER }, 'PfIS: Terminveröffentlichung (Adressen wählen)', document.pathname);
}
current_step = pcalpub_steps.ADDRESSCHOOSER;
});
function submit_emailaddresses_from_table(tableid) {
var table = $(tableid);
if(table.length === 0)
return [];
var trs = table.find('tr');
console.log(trs);
var addresses = [];
trs.each(function(index) {
addresses.push({ 'addresses' : $(this).data('addresses'), 'recipient_name' : $(this).data('recipient-name'), 'recipient' : $(this).find('.the_email_recipient').html() });
});
return addresses;
}
function submit_emailaddresses() {
$("#entryeditnav-form").empty();
var data = {
dest_to : submit_emailaddresses_from_table("#destination_to"),
dest_cc : submit_emailaddresses_from_table("#destination_cc"),
dest_bcc : submit_emailaddresses_from_table("#destination_bcc")
};
if(data.dest_to.length === 0) {
// this has not to happen, but might happen, if we click 'forward' with removed email-adresses!!!
// -> go back
history.back();
return;
}
//history.replaceState({direction: 'pcalpub_addresschooser_from_saved'}, 'PfIS: Terminveröffentlichung (Adressen wählen [saved])', document.pathname);
console.log('SUBMIT EMAIL');
sockets.emit('pcalpub_show_summary', data);
}
sockets.on('pcalpub_show_summary_result', function(data) {
console.log('pcalpub_show_summary_result');
$(".root").children(".subroot").remove();
$(".root").append(data.html);
if(highest_reached_step < pcalpub_steps.SUMMARY) {
highest_reached_step = pcalpub_steps.SUMMARY;
console.log('push SUMMARY');
history.pushState({ step : pcalpub_steps.SUMMARY }, 'PfIS: Terminveröffentlichung (Zusammenfassung)', document.pathname);
}
current_step = pcalpub_steps.SUMMARY;
});
function pcalpub_generate_publication_send_html() {
sockets.emit('pcalpub_generate_publication_send_html', {});
}
/*function pcalpub_generate_publication_send_html2() {
history.replaceState({direction: 'pcalpub_summary_saved'}, 'PfIS: Terminveröffentlichung (Zusammenfassung [saved])');
sockets.emit('pcalpub_generate_publication_send_html2', {});
}
sockets.on('pcalpub_generate_publication_send_html2_result', function(data) {
$(".root").children(".subroot").remove();
$(".root").append(data.html);
history.pushState({ direction: 'pcalpub_sending2'}, 'PfIS: Terminveröffentlichung (Senden)', document.pathname);
pcalpub_generate_publication_send_html();
});*/
function go_forward_to(step , func) {
if(highest_reached_step >= step)
history.forward();
else
func();
}
var is_sending = false;
$('#sendEmail').on('show.bs.modal', function (e) {
is_sending = true;
/*history.replaceState({direction: 'pcalpub_summary_saved'}, 'PfIS: Terminveröffentlichung (Zusammenfassung [saved])');
history.pushState({direction: 'disable_back'}, document.title, location.pathname);
history.pushState({direction: 'sending'}, document.title, location.pathname);*/
$("#status_collect").prop("class", "glyphicon glyphicon-unchecked");
$("#status_convert").prop("class", "glyphicon glyphicon-unchecked");
$("#status_send").prop("class", "glyphicon glyphicon-unchecked");
$("#sendEmail_message").html("");
$("#sendEmail_explanation").html("");
$("#sendEmail_closebutton").hide();
$("#button_summary_back").hide();
$("#button_summary_send").hide();
pcalpub_generate_publication_send_html();
});
$("#sendEmail").on('hidden.bs.modal', function(e) {
is_sending = false;
$("#button_summary_back").show();
$("#button_summary_send").show();
});
sockets.on('pcalpub_generate_publication_send_html_step', function(step) {
console.log('STEP', step);
$("#" + step.id).removeClass($("#" + step.id).prop('class'));
$("#" + step.id).addClass("glyphicon " + step.glyphicon);
});
sockets.on('pcalpub_generate_publication_send_html_result', function(result) {
console.log('RESULT', result);
$("#sendEmail_message").html(result.message);
$("#sendEmail_explanation").html(result.explanation);
$("#sendEmail_closebutton").show();
/*if(result.result === "ERROR") {
$("#button_summary_back").show();
$("#button_summary_send").show();
}*/
/*if(result.result === "ERROR") {
$("#summary_title").css('color', 'red');
$("#summary_title").html("Die eMail konnte nicht erfolgreich übertragen werden. Bitte korrigieren Sie die Fehler bzw. versuchen es später noch einmal.");
}
else {
$("#summary_title").css('color', 'green');
$("#summary_title").html("Die eMail wurde erfolgreich übertragen. Sie können das Fenster nun schließen.");
}*/
//history.go(-2);
});
history.replaceState({step : pcalpub_steps.BACK}, document.title, location.pathname);
history.pushState({step : pcalpub_steps.SETTINGS}, 'PfIS: Terminveröffentlichung (Einstellungen)', location.pathname);
window.addEventListener("popstate", function(e) {
$("#entryeditnav-form").empty();
if(e.state !== null) {
console.log(e.state);
if(e.state.step === pcalpub_steps.BACK) {
console.log(location.pathname);
window.location.href = location.pathname;
}
if(e.state.step === pcalpub_steps.SETTINGS)
sockets.emit('pcalpub_show_settings', {});
else if(e.state.step === pcalpub_steps.EDITOR) {
if(current_step < pcalpub_steps.EDITOR)
pcalpub_send_html_per_email();
else
sockets.emit('pcalpub_show_html_for_email', {});
}
else if(e.state.step === pcalpub_steps.ADDRESSCHOOSER) {
if(current_step < pcalpub_steps.ADDRESSCHOOSER)
pcalpub_choose_addresses();
else if(is_sending === true)
history.forward(); // we are about to go back from SUMMARY - do not allow that if sending!!!
else
sockets.emit('pcalpub_show_addresschooser_from_saved', {});
}
else if(e.state.step === pcalpub_steps.SUMMARY && ! is_sending) {
if(current_step < pcalpub_steps.SUMMARY) {
console.log("AABB");
submit_emailaddresses();
}
else {
console.log("WRONG");
sockets.emit('pcalpub_show_summary_from_saved', {});
}
}
}
}, false);

View File

@@ -0,0 +1,75 @@
form(class="form-horizontal subroot", style="overflow: hidden; height: 100%;" role="form", id="form")
.new_flex_zero(style="padding-left: 15px; padding-right: 15px; ")
p(style="font-style: italic;") #{parish_name} <span class="glyphicon glyphicon-chevron-right", aria-hidden="true"></span> #{factory_name} <span style="font-size: 80%">(!{timespan})</span>
button(class="btn btn-warning btn-xs", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Zurück
button(class="btn btn-success btn-xs", type="button", onclick="go_forward_to(pcalpub_steps.ADDRESSCHOOSER,pcalpub_choose_addresses);")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Weiter
.row
.col-sm-12
span &nbsp;
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px; padding-bottom: 15px; height: 100%;")
textarea#html_for_email
!{html}
script.
function resize() {
console.log('resize called');
setTimeout(function () {
// Main container
var max = $('.mce-tinymce')
.parent().outerHeight();
//.css('border', 'none')
// Menubar
max += -$('.mce-menubar.mce-toolbar').outerHeight();
// Toolbar
max -= $('.mce-toolbar-grp').outerHeight();
// Statusbar
max -= $('.mce-statusbar').outerHeight();
// Random fix lawl - why 1px? no one knows
max -= 3;
// And the padding
max -= 15;
// Set the new height
$('.mce-edit-area').height(max);
}, 200);
}
tinymce.editors=[];
tinymce.init({
selector: '#html_for_email',
height: '100%',
resize: false,
autoresize: true,
init_instance_callback : function(editor) { resize(); },
language: 'de',
plugins: 'advlist,autolink,lists,link,image,charmap,print,preview,anchor,searchreplace,visualblocks,code,insertdatetime,media,table,contextmenu,paste',
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'
});
$(window).on('resize', function () {
resize();
});
// .new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
//
// .row
// fieldset(class="col-sm-12", style="margin-top: 20px;")
// legend(style="font-size: 150%") Terminmeldung
// textarea(class="form-control", rows="5", id="area_description", name="area_description").
// #{event.description}

View File

@@ -0,0 +1,30 @@
form(class="form-horizontal subroot", style="overflow: hidden; height: 100%;" role="form", id="form")
.new_flex_zero(style="padding-left: 15px; padding-right: 15px;")
h4 eMail versenden
p#summary_title(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die folgenden Schritte ausgeführt werden:
p(style="font-style: italic;") #{parish_name} <span class="glyphicon glyphicon-chevron-right", aria-hidden="true"></span> #{factory_name} <span style="font-size: 80%">(!{timespan})</span>
button#button_send_back(class="btn btn-warning btn-xs", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Zurück
.row
.col-sm-12
span &nbsp;
table(class="table table-condensed")
tr
td
span#status_collect(class="glyphicon glyphicon-unchecked", aria-hidden="true")
td <b>Sammle Informationen</b>
tr
td
span#status_convert(class="glyphicon glyphicon-unchecked", aria-hidden="true")
td <b>Konvertiere Daten in das DOC-Format</b>
tr
td
span#status_send(class="glyphicon glyphicon-unchecked", aria-hidden="true")
td <b>Versende eMail</b>
#sendEmail_message
#sendEmail_explanation

View File

@@ -0,0 +1,3 @@
include mixins_pcalpub
+pcalpubsettings(parishid, factoryid, durance, date, publicationformats)

View File

@@ -0,0 +1,49 @@
form(class="form-horizontal subroot", style="overflow: hidden; height: 100%;" role="form", id="form")
.new_flex_zero(style="padding-left: 15px; padding-right: 15px;")
p#summary_title(style="font-weight: bold; font-style: italic;") Bitte überprüfen Sie nochmal alle Angaben!
p(style="font-style: italic;") #{parish_name} <span class="glyphicon glyphicon-chevron-right", aria-hidden="true"></span> #{factory_name} <span style="font-size: 80%">(!{timespan})</span>
button#button_summary_back(class="btn btn-warning btn-xs", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Zurück
//-button#button_summary_send(class="btn btn-success btn-xs", type="button", onclick=" pcalpub_generate_publication_send_html2();")
button#button_summary_send(class="btn btn-success btn-xs", type="button", data-toggle="modal" data-target="#sendEmail")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Senden
.row
.col-sm-12
span &nbsp;
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
fieldset
legend(style="font-size: 120%; margin-bottom: 0px;") Empfänger
table(width='130%', class='table table-condensed' style='margin-bottom: 10px;')
each empf in dest_to
tr(data-addresses="#{empf.addresses}")
td !{empf.recipient}
if dest_cc.length > 0
fieldset
legend(style="font-size: 120%; margin-bottom: 0px;") Kopie
table(width='130%', class='table table-condensed' style='margin-bottom: 10px;')
each empf in dest_cc
tr(data-addresses="#{empf.addresses}")
td !{empf.recipient}
if dest_bcc.length > 0
fieldset(style="margin-bottom: 10px;")
legend(style="font-size: 120%; margin-bottom: 0px;") Blindkopie
table(width='130%', class='table table-condensed' style='margin-bottom: 10px;')
each empf in dest_bcc
tr(data-addresses="#{empf.addresses}")
td !{empf.recipient}
fieldset
legend(style="font-size: 150%; margin-bottom: 0px;") Inhalt der eMail
!{html}
script.

120
views/old/pentrymove.jade Normal file
View File

@@ -0,0 +1,120 @@
include mixins
doctype html
html
include header
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/pentrymove_parishday.js')
script(src='/javascripts/runtime.js')
link(href="/stylesheets/style_week.css", rel="stylesheet")
style.
.cell_element { display: table-cell; }
.td_new_celebration { padding-top: 10px; }
.give_margin_left { padding-left: 10px; }
@media only screen and (max-width: 768px) {
.cell_element {
display: block;
margin-bottom: 15px;
}
.td_new_celebration { padding-top: 0px; }
.give_margin_left { padding-left: 0px; }
}
body
.root
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid
h1 #{pentrytype_pretty} #{clone_or_move_pretty_verb2}
.small &raquo#{pentryname}&laquo
.small(style="white-space: nowrap; font-size: 80%;") am #{date.weekday_short}, #{date.day}. #{date.month} #{date.year}</span>
.container-fluid
p Auf welches Datum soll #{clone_or_move_pretty_verb} werden?
form(method="POST", action="/pentry/#{date.date}/#{pentrytype}/#{uuid}/#{clone_or_move}", role="form", id="form-clonemove")
input(type="hidden", name="pcalview", value="#{pcalview}")
input(type="hidden", name="new_date", id="new_date", value="#{date.date}")
button(class="btn btn-success btn-sm", type="button", onclick="checked_submit()")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span #{clone_or_move_pretty_noun}
.alert.alert-danger(style="display: none")
a(class="close", data-hide="alert") &times;
strong Fehler!
span
span Es kann nicht auf den ursprünglichen Tag #{clone_or_move_pretty_verb} werden!
//- http://eternicode.github.io/bootstrap-datepicker/
.new_flex_one(style="margin-top: 15px;", id="scroll_parent")
.container-fluid
#datepicker.cell_element(data-date="#{date.date}", style="vertical-align: top;")
.cell_element.give_margin_left(id="dayinfo", style="width: 100%;")
script.
// WebSocket setup
var ws = new PfISWebSocket("#{sessionuuid}");
ws.bind_standard_close_handler();
ws.bind('get_parishday_result',function(data){
console.log('got_parishday');
console.log(data);
var html = pentrymove_parishday_template({day: data.day } );
$("#dayinfo").html(html);
$("#scroll_parent").scrollTop(0);
});
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
$("#datepicker").on("changeDate", function(event) {
var d = $("#datepicker").datepicker('getFormattedDate');
console.log('date: ', d);
$("#new_date").val(d);
$(".alert").hide();
ws.send('get_parishday', { date: d });
});
checked_submit = function(e) {
var new_date = $("#new_date").val();
console.log(new_date);
if(new_date === "#{date.date}") {
$(".alert").show();
return;
}
$("#form-clonemove").submit();
}
$(function(){
ws.send('get_parishday', { date: "#{date.date}" });
$("[data-hide]").on("click", function(){
$("." + $(this).attr("data-hide")).hide();
/*
* The snippet above will hide all elements with the class specified in data-hide,
* i.e: data-hide="alert" will hide all elements with the alert property.
*
* Xeon06 provided an alternative solution:
* $(this).closest("." + $(this).attr("data-hide")).hide();
* Use this if are using multiple alerts with the same class since it will only find the closest element
*
* (From jquery doc: For each element in the set, get the first element that matches the selector by
* testing the element itself and traversing up through its ancestors in the DOM tree.)
*/
});
});

View File

@@ -0,0 +1,6 @@
include mixins
include mixins_week
- var celebration_printed = false;
table(width="100%")
+week_day_mobile(day)

111
views/old/roleeditor.jade Normal file
View File

@@ -0,0 +1,111 @@
include mixins
- var my_roles_string = JSON.stringify(roles);
- var my_already_defined_roles = JSON.stringify(already_defined_roles);
doctype html
html
include header
script(src="/javascripts/typeahead.jquery.min.js")
link(href="/stylesheets/mytypeahead.css", rel="stylesheet")
script(src="/javascripts/validator.min.js")
body(style="overflow: hidden;")
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid(style="margin-bottom: 18px;")
p.
Bitte geben Sie den Namen für den Dienst ein!
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
form(class="form-horizontal" method="POST", action="#{pentry_edit_base}/#{submit_dest}", id="form")
input(type="hidden", name="role_uid", value="#{role_uid}")
button(class="btn btn-success btn-xs", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
br
span &nbsp;
.form-group
label(for='role_name', class="col-sm-2 control-label") Name
.col-sm-10
input(type="text", name="role_name", id="role_name", class="col-sm-12 typeahead form-control", data-role_is_unique="bar", value="#{role_name}", required)
.help-block.with-errors
script.
var substringMatcher = function(strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function(i, str) {
if (substrRegex.test(str)) {
matches.push(str);
}
});
cb(matches);
};
};
var roles = !{my_roles_string};
$("#role_name").typeahead({
hint: true,
highlight: true,
minLength: 0
},
{
name: 'roles',
source: substringMatcher(roles)
});
var submitted = false;
$('#form').validator({
custom: {
role_is_unique: function(el)
{
var already_defined_roles = !{my_already_defined_roles};
for(idx in already_defined_roles)
{
if(already_defined_roles[idx] === $("#role_name").val())
return false;
}
return true;
}
},
errors: {
role_is_unique: "Ein Dienst mit gleichem Namen existiert bereits; bitte wählen Sie einen anderen Namen!"
}
}).on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
console.log('SUBMITTED: ');
console.log(submitted);
if(submitted)
e.preventDefault();
submitted = true;
}
});
})

336
views/old/timeline.jade Normal file
View File

@@ -0,0 +1,336 @@
include mixins
include mixins_day
doctype html
html
include header
script(src='/javascripts/socket.io.js' )
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
style.
.block-relative { position: relative; width: 100%; }
.block-absolute { position: absolute; padding-left: 2px; padding-right: 2px; padding-bottom: 2px;}
.timepoint { font-size: 80%; position: absolute; border-top-style: dotted; border-top-width: 1px; border-top-color: grey; right: -15px; left: -15px; z-index: -5; }
.event_name { font-size: 85%; font-weight: bold; font-style: italic; margin-bottom: 0px;}
.event_name_secondary { font-size: 75%; font-weight: bold; }
.event_locations { font-size: 70%; color: darkblue; font-weight: bold; margin-bottom: 0px; }
.event_involved { font-size: 70%; color: green; font-style: italic; margin-bottom: 0px; }
body(style="overflow: hidden;")
script.
history.replaceState({direction: 'back'}, document.title, "/timeline/#{date.date}?back=false");
history.pushState({direction: 'mainpage', date: "#{date.date}", scrollto: ''}, document.title, "/timeline/#{date.date}");
.modal.fade(id="daypickerDialog", role="dialog", aria-labelledby="daypickerDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
h4(class="modal-title" id="daypickerDialogLabel") Datum anspringen
.modal-body
#datepicker()
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-success", id="confirm") Anspringen
.modal.fade(id="confirmDelete", role="dialog", aria-labelledby="confirmDeleteLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
h4(class="modal-title", id="confirmDeleteLabel") Löschen bestätigen
.modal-body
p Sind Sie sicher, dass Sie das Ereignis löschen wollen?
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-danger", id="confirm") Löschen
.root(style="overflow: hidden;")
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
+nav_item( "/day/" + date.date ) Tag
+nav_item( "#", "active" ) TagZeitleiste
+nav_item( "/week/" + date.date) Woche
+nav_item( "/timeline/"+date.date+"/select_punits_for_view" ) Angezeigte Orte konfigurieren
+nav_item( "/info" ) Info
#dataparent.subroot(style="overflow: hidden; height: 100%;")
+timeline(date, litinfo, last_week, yesterday, tomorrow, next_week, messages, parishcal)
script.
var sockets;
var saved_messages = [];
var updown_button = {};
var updown_direction = "";
$(document).ready(function() {
console.log('NOW CONNECTING');
sockets = io.connect();
sockets.on('day_goto_result',function(data){
console.log('day_goto_result');
if(data.result === "OK") {
var html = $(data.html);
history.replaceState({direction: 'back'}, document.title, "/timeline/" + data.date + "?back=false");
history.pushState({direction: 'mainpage', date: data.date }, document.title, "/timeline/" + data.date) ;
$('#dataparent').html(data.html);
var day_elem = $('.navbar-collapse > ul > li:nth(0) > a');
day_elem.prop('href', '/day/' + data.date);
var week_elem = $('.navbar-collapse > ul > li:nth(2) > a');
week_elem.prop('href', '/week/' + data.date);
for(midx in saved_messages)
$('#daycontrol_parent').append(saved_messages[midx]);
saved_messages = [];
console.log(data.scrollto);
if((typeof data.scrollto !== 'undefined') && (data.scrollto !== '')) {
var the_elem = $("[data-event-uuid='" + data.scrollto + "']");
// this event (the_elem) might have been deleted!!!
if(the_elem.length > 0) {
$('#timelinebody').animate({
scrollTop: the_elem.offset().top - $("#timelinebody").offset().top
}, 1000);
}
}
}
else {
$('#dataparent').html("<div class='new_flex_one' style='padding-left: 15px; padding-right: 15px;'>"+data.html+"</div>");
}
});
sockets.on('day_show_event_result', function(data) {
console.log('day_show_event_result');
if(data.result === "OK") {
history.pushState({direction: 'day_show_event'}, document.title, location.pathname + '/' + data.event);
$('#dataparent').html(data.html);
}
else {
$('#dataparent').html("<div class='new_flex_one' style='padding-left: 15px; padding-right: 15px;'>"+data.html+"</div>");
}
});
sockets.on('pentry_delete_result', function(data) {
console.log("pentry_delete_result");
console.log(data);
if(data.pentrytype !== 'event') {
if(data.result === 'OK') {
var button = $('[data-pentry-uuid="'+ data.uuid + '"]');
var type = data.pentrytype;
var box = button.closest('.' + type);
box.remove();
}
$('#daycontrol_parent').append(data.message);
}
else {
saved_messages.push(data.message);
history.back();
}
$('#confirmDelete').modal('hide');
});
sockets.on('tevent_delete_result', function(data) {
console.log(data);
if(data.result === "OK") {
var delete_button = $('[data-event-uuid="'+ data.event + '"][data-tevent-uuid="'+ data.tevent + '"]');
console.log(delete_button);
var eventbox = delete_button.closest('.eventbox');
var number_of_children = eventbox.parent().children().length;
console.log('number_of_children: ', number_of_children);
if(number_of_children > 1) {
if(eventbox.is(':first-child')) { // disable up-button
$(eventbox.next().find("div > button:nth-child(2)")[0]).prop('disabled', true);
}
if(eventbox.is(':last-child')) { // disable down-ubtton
$(eventbox.prev().find("div > button:nth-child(3)")[0]).prop('disabled', true);
}
}
eventbox.remove();
}
else
console.log('tevent_delete_result: ', data);
$('#confirmDelete').modal('hide');
});
sockets.on('tevent_move_updown_result',function(data){
console.log(data);
/*window.location.reload();*/
/* http://stackoverflow.com/questions/3050830/reorder-list-elements-jquery */
var eventbox = updown_button.closest('.eventbox');
var other = {};
if(updown_direction === "down")
{
next = eventbox.next();
next.after(eventbox);
other = next;
}
else /* up */
{
prev = eventbox.prev();
prev.before(eventbox);
other = prev;
}
if(eventbox.is(':first-child'))
{
$(eventbox.find("div > button:nth-child(2)")[0]).prop('disabled', true);
$(eventbox.find("div > button:nth-child(3)")[0]).prop('disabled', false);
}
else
{
if(eventbox.is(':last-child'))
{
$(eventbox.find("div > button:nth-child(2)")[0]).prop('disabled', false);
$(eventbox.find("div > button:nth-child(3)")[0]).prop('disabled', true);
}
else
{
$(eventbox.find("div > button:nth-child(2)")[0]).prop('disabled', false);
$(eventbox.find("div > button:nth-child(3)")[0]).prop('disabled', false);
}
}
if(other.is(':first-child'))
{
$(other.find("div > button:nth-child(2)")[0]).prop('disabled', true);
$(other.find("div > button:nth-child(3)")[0]).prop('disabled', false);
}
else
{
if(other.is(':last-child'))
{
$(other.find("div > button:nth-child(2)")[0]).prop('disabled', false);
$(other.find("div > button:nth-child(3)")[0]).prop('disabled', true);
}
else
{
$(other.find("div > button:nth-child(2)")[0]).prop('disabled', false);
$(other.find("div > button:nth-child(3)")[0]).prop('disabled', false);
}
}
/* $('body').loading('stop'); */
});
if("#{event}" !== "")
day_show_event("#{date.date}", "#{event}");
if("#{scrollto}" !== "") {
$('#timelinebody').animate({
scrollTop: $("[data-event-uuid='#{scrollto}']").offset().top - $("#timelinebody").offset().top
}, 1000);
}
});
function day_goto(new_date, scrollto) {
console.log(new_date);
console.log('scrollto ', scrollto);
console.log((typeof scrollto !== 'undefined' ? scrollto : ''));
sockets.emit('day_goto_timeline', {date : new_date, scrollto: (typeof scrollto !== 'undefined' ? scrollto : '')});
}
function day_show_event(date, event) {
console.log('day_show_event', date, event);
history.replaceState({direction: 'mainpage', date: date, scrollto: event }, document.title, "/timeline/" + date) ;
sockets.emit('day_show_event', { date: date, event: event});
}
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
$('#daypickerDialog').on('show.bs.modal', function (e) {
date = $(e.relatedTarget).attr('data-date');
$('#datepicker').datepicker("update", date);
});
$('#daypickerDialog').find('.modal-footer #confirm').on('click', function() {
$('#daypickerDialog').modal('hide');
console.log('CLICKED');
day_goto($("#datepicker").datepicker('getFormattedDate'));
});
function toggle_pentrydetails_visibility(pentry) {
$(pentry).find(".pentry_details").toggle();
}
$('#confirmDelete').on('show.bs.modal', function (e) {
$etitle = $(e.relatedTarget).attr('data-pentry-title');
$(this).find('.modal-body p').text("Sind Sie sicher, dass Sie " + $etitle + " löschen wollen?");
$(this).find('.modal-footer #confirm').data('button', $(e.relatedTarget));
});
$('#confirmDelete').find('.modal-footer #confirm').on('click', function() {
var delete_button = $(this).data('button');
var date = delete_button.data('date');
var type = delete_button.data('pentry-type');
if(type === "tevent") {
console.log('delete tevent');
var event = delete_button.data('event-uuid');
var tevent = delete_button.data('tevent-uuid');
console.log(date, event, tevent);
sockets.emit('tevent_delete', { date: date, event: event, tevent: tevent });
return;
}
var uuid = delete_button.data('pentry-uuid');
/*if(type === "event") {
// special handling, because we can it not remove from the view, but have to go back to the view
// because this delete-button is only presented in the detail-view!!!
console.log('delete event');
sockets.emit('event_delete', { date: date, event: uuid });
return;
}*/
console.log(date, type, uuid);
sockets.emit('pentry_delete', { date: date, pentrytype: type, uuid: uuid });
});
do_tevent_move_updown = function(button, date, event, tevent, updown) {
updown_button = button;
updown_direction = updown;
sockets.emit('tevent_move_updown', { date: date, event: event, tevent: tevent, updown: updown });
}
window.addEventListener("popstate", function(e) {
console.log(e.state);
if(e.state !== null) {
if(e.state.direction === "back") {
history.go(1);
}
if(e.state.direction === "mainpage")
day_goto(e.state.date, e.state.scrollto);
}
}, false);

View File

@@ -0,0 +1,43 @@
include mixins
include mixins_day
.new_flex_zero
.container-fluid
button(class="btn btn-success btn-xs", onclick="history.back();", style="margin-bottom: 5px;")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Zurück
- var red_class = litinfo.decoration_hint_red ? "litpanel_red" : "litpanel_black";
- litinfo.celebration = litinfo.celebration.replace("\\n", "<br/>");
- litinfo.celebration_add = litinfo.celebration_add.replace("\n", "<br/>");
- litinfo.infos = litinfo.infos.replace("\\n","<br/>");
- var celebration_class = "";
- if(litinfo.decoration_hint == 2) celebration_class = "litpanel_bold";
- if(litinfo.decoration_hint == 1) celebration_class = "litpanel_italic";
form(id="control", style="min-height: min-content;")
table(width="100%")
tr
td(colspan=2, width="25%")
td(colspan=2, class=["litpanel_day_mobile_littime", red_class], style="text-align: center; width: 50%;") #{litinfo.time}
td(colspan=2, width="25%")
tr
td(colspan=2, width="25%")
td(colspan=2, style="text-align: center; width: 50%;")
p(style="white-space: nowrap; margin-bottom: 0px;", class=["litpanel_day_mobile", red_class]) #{date.weekday_short}, #{date.day}. #{date.month_short} #{date.year}
td(colspan=2, style="text-align: right; width: 25%;")
tr
td(colspan=6, class="litpanel_month_week_weekday litpanel_celebration_parent")
span(class=["litpanel_celebration", celebration_class, red_class]) !{litinfo.celebration}
if litinfo.celebration_add != ""
tr
td(colspan=6, class=["litpanel_month_week_weekday", "litpanel_celebration_parent", red_class])
span(class="litpanel_celebration_add") !{litinfo.celebration_add}
if litinfo.infos != ""
tr
td(colspan=6, class="litpanel_month_week_weekday litpanel_celebration_parent")
span(class="litpanel_infos") !{litinfo.infos}
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px; padding-top: 15px;")
+pevent_with_thereafter(date.date, event, true, "timeline")

View File

@@ -0,0 +1,4 @@
include mixins
include mixins_day
+timeline(date, litinfo, last_week, yesterday, tomorrow, next_week, messages, parishcal)

View File

@@ -0,0 +1,174 @@
include mixins
include mixins_week
doctype html
html
include header
script(src='/javascripts/socket.io.js' )
link(href="/stylesheets/bootstrap-datepicker.min.css", rel="stylesheet")
script(src='/javascripts/bootstrap-datepicker.min.js' )
script(src='/javascripts/bootstrap-datepicker.de.min.js' )
body(style="overflow: hidden;")
.modal.fade(id="daypickerDialog", role="dialog", aria-labelledby="daypickerDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
button(type="button", class="close", data-dismiss="modal", aria-hidden="true") &times;
h4(class="modal-title" id="daypickerDialogLabel") Datum anspringen
.modal-body
#datepicker()
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-success", id="confirm") Anspringen
.container-horizontal(style="overflow: hidden;")
.flex-one(style="overflow: hidden; height: 100%;")
.container-vertical
.flex-zero
+nav("PfarrInfoSystem", "dropdown_menu")
+nav_item( "/day/" + basedate ) Tag
+nav_item( "#", "active" ) Woche
+nav_item( "/week/select_punits_for_view" ) Angezeigte Orte konfigurieren
+nav_item( "/info" ) Info
.container-fluid(style="margin-bottom: 18px;")
#weekcontrol_parent
+weekcontrol(basedate, interval, last_week, next_week)
+messageview(messages)
.flex-one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
- var is_desktop = false;
if(is_desktop)
- var celebration_printed = false;
table(width="100%")
each day in days
- var red_class = day.litinfo.decoration_hint_red ? "litpanel_red" : "";
- var celebration_class = "";
- if(day.litinfo.decoration_hint == 2) celebration_class = "week_celebration_stage2";
- if(day.litinfo.decoration_hint == 1) celebration_class = "week_celebration_stage1";
- var the_date = day.date.weekday_short + ",&nbsp;" + day.date.day + ".&nbsp;" + day.date.month_short + "&nbsp;" + day.date.year;
if( ! celebration_printed)
tr
td(valign='top', width="10%")
span(class=["week_celebration", celebration_class, red_class]) !{the_date}
td(width="8%")
td
td
span(class=["week_celebration", celebration_class, red_class]) #{day.litinfo.celebration}
if day.litinfo.celebration_add != ""
br
span(class="litpanel_celebration_add") !{day.litinfo.celebration_add}
if day.litinfo.infos != ""
br
span(class="litpanel_infos") !{day.litinfo.infos}
- the_date = "";
else if(celebration_printed && day.parishcal.events.today.length === 0)
tr
td(valign='top', width="10%")
span(class=["week_celebration", celebration_class, red_class]) !{the_date}
td
td
td
each away in day.parishcal.away
+week_away(away, the_date)
- the_date = '';
each todo in day.parishcal.todo
+week_todo(todo, the_date)
- the_date = '';
each keep_in_mind in day.parishcal.keep_in_mind
+week_keep_in_mind(keep_in_mind, the_date)
- the_date = '';
each vu in day.parishcal.vehicle_use
+week_vehicle_use(vu, the_date)
- the_date = '';
each event in day.parishcal.events.today
+week_event(event, the_date)
- the_date = '';
if(day.parishcal.tomorrow)
tr
td &nbsp;
td &nbsp;
td &nbsp;
td &nbsp;
- celebration_printed = true;
- var red_class_tomorrow = day.parishcal.tomorrow.decoration_hint_red ? "litpanel_red" : "";
- var celebration_class_tomorrow = "";
- if(day.parishcal.tomorrow.decoration_hint == 2) celebration_class_tomorrow = "week_celebration_stage2";
- if(day.parishcal.tomorrow.decoration_hint == 1) celebration_class_tomorrow = "week_celebration_stage1";
tr
td
td
td
td
span(class=["week_celebration", celebration_class_tomorrow, red_class_tomorrow]) #{day.parishcal.tomorrow.celebration}
if day.parishcal.tomorrow.celebration_add != ""
br
span(class="litpanel_celebration_add") !{day.parishcal.tomorrow.celebration_add}
if day.parishcal.tomorrow.infos != ""
br
span(class="litpanel_infos") !{day.parishcal.tomorrow.infos}
- var the_date = day.date.weekday_short + ",&nbsp;" + day.date.day + ".&nbsp;" + day.date.month_short + "&nbsp;" + day.date.year;
each event in day.parishcal.events.tomorrow
+week_event(event, the_date)
- the_date = "";
else
- celebration_printed = false;
tr
td &nbsp;
td &nbsp;
td &nbsp;
td &nbsp;
else
#week_complete_parent
+week_complete_mobile(days)
script.
var sockets;
$(document).ready(function() {
console.log('NOW CONNECTING');
sockets = io.connect();
sockets.on('week_goto_result',function(data){
console.log('week_goto_result');
console.log(data);
if(data.result === "OK") {
var html = $(data.html);
console.log(html);
history.replaceState(null, document.title, "/week/" + data.basedate + "?back=false");
console.log("X");
$("#weekcontrol_parent").html(html.filter("#control"));
$("#week_complete_parent").html(html.filter("#week_complete"));
}
else {
$("#weekcontrol_parent").html(data.html);
$("#week_complete_parent").html("");
}
});
});
function week_goto(new_date) {
console.log(new_date);
sockets.emit('week_goto', {basedate : new_date});
}
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
$('#daypickerDialog').on('show.bs.modal', function (e) {
date = $(e.relatedTarget).attr('data-date');
$('#datepicker').datepicker("update", date);
});
$('#daypickerDialog').find('.modal-footer #confirm').on('click', function() {
$('#daypickerDialog').modal('hide');
console.log('CLICKED');
week_goto($("#datepicker").datepicker('getFormattedDate'));
});

View File

@@ -0,0 +1,92 @@
include mixins
doctype html
html
include header
body(style="overflow: hidden;")
div(style="display: box; height: 100%;")
div(style="-moz-box-flex: 0; box-flex: 0;")
+nav("PfarrInfoSystem", "dropdown_menu")
+nav_item( "/" ) Tag
+nav_item( "#", "active" ) Woche
+nav_item( "/select_punits_for_view?u=/week" ) Angezeigte Orte konfigurieren
+nav_item( "/info" ) Info
.container-fluid(style="margin-bottom: 18px; box-flex: 0;")
table(width="100%")
tr
td(colspan=2, width="20%")
a(href="/week/-1", class="litpanel_arrow") ←
td(colspan=2, style="text-align: center; width: 60%;")
a(href="/week/picker?d="+ basedate + "&u=/week", style="color: black;")
span(class="litpanel_day_mobile") #{interval}
td(colspan=2, style="text-align: right; width: 20%;")
a(href="/week/+1", class="litpanel_arrow") →
//-main(style="overflow: scroll; -moz-box-flex: 1; box-flex: 1; padding-left: 15pt; padding-right: 15pt;")
div(style="-moz-box-flex: 1; box-flex: 1;")
div(style="overflow: scroll; height: 100%;")
- var celebration_printed = false;
table(width="100%")
each day in days
- var red_class = day.litinfo.decoration_hint_red ? "litpanel_red" : "";
- var celebration_class = "";
- if(day.litinfo.decoration_hint == 2) celebration_class = "week_celebration_stage2";
- if(day.litinfo.decoration_hint == 1) celebration_class = "week_celebration_stage1";
- var the_date = day.date.weekday_short + ",&nbsp;" + day.date.day + ".&nbsp;" + day.date.month_short + "&nbsp;" + day.date.year;
if( ! celebration_printed)
tr(style="border-bottom:1px solid #000;")
td(valign='top', colspan=2)
span(class=["week_celebration", celebration_class, red_class]) !{the_date}
td(valign='top')
span(class=["week_celebration", celebration_class, red_class]) #{day.litinfo.celebration}
if day.litinfo.celebration_add != ""
br
span(class="litpanel_celebration_add") !{day.litinfo.celebration_add}
if day.litinfo.infos != ""
br
span(class="litpanel_infos") !{day.litinfo.infos}
else
tr
td(colspan=2, valign='top', style="border-bottom:1px solid #000;")
span(class=["week_celebration", celebration_class, red_class]) !{the_date}
td
each event in day.parishcal.events.today
+week_event_mobile(event)
if(day.parishcal.tomorrow)
tr
td &nbsp;
td &nbsp;
td &nbsp;
- celebration_printed = true;
- var red_class_tomorrow = day.parishcal.tomorrow.decoration_hint_red ? "litpanel_red" : "";
- var celebration_class_tomorrow = "";
- if(day.parishcal.tomorrow.decoration_hint == 2) celebration_class_tomorrow = "week_celebration_stage2";
- if(day.parishcal.tomorrow.decoration_hint == 1) celebration_class_tomorrow = "week_celebration_stage1";
tr(style="border-bottom:1px solid #000;")
td
td
td
span(class=["week_celebration", celebration_class_tomorrow, red_class_tomorrow]) #{day.parishcal.tomorrow.celebration}
if day.parishcal.tomorrow.celebration_add != ""
br
span(class="litpanel_celebration_add") !{day.parishcal.tomorrow.celebration_add}
if day.parishcal.tomorrow.infos != ""
br
span(class="litpanel_infos") !{day.parishcal.tomorrow.infos}
tr
td(valign='top', colspan=2, style="border-bottom:1px solid #000;")
span(class=["week_celebration", celebration_class, red_class]) !{the_date}
td
each event in day.parishcal.events.tomorrow
+week_event_mobile(event)
else
- celebration_printed = false;
tr
td &nbsp;
td &nbsp;
td &nbsp;