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,192 @@
include mixins
- var actual_background = "yellow";
mixin do_location(location)
- style="cursor: pointer; padding-top: 5px; padding-bottom: 5px;";
- 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, data-location="true") #{location.name}
td
span(id="#{location.id}_sign", style=style_text) #{location.sign}
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)
.subroot
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
h4 Ort aus der Liste hinzufügen
form(class="form-horizontal", id="form-filter")
button(type="submit", style="display: none;")
.form-group()
label(for='edit_filter', class="col-sm-1 control-label") Filter
.col-sm-11
input(id="edit_filter", type="text", class="form-control", oninput="adjust_visible_locations(this);")
script.
$("#form-filter").on('submit', function(e){
console.log('FILTER SUBMIT');
var actual_location_name = $("#actual_location_name").val();
console.log(actual_location_name);
if(actual_location_name !== "" && $("#edit_filter").val() === actual_location_name) {
console.log("DO SUBMIT");
$("#form-locationselector").submit();
}
e.preventDefault();
});
function set_visibility_according_to_filter(substrRegex, elems) {
var actual_id = $("#actual_location_id").val();
elems.each(function(index) {
my_span = $(this);
var txt = my_span.text();
var id = my_span.prop('id');
if(substrRegex.test(txt)) {
$(this).closest('li').show();
if(actual_id === id)
$("#submit_button").prop('disabled', false);
}
else {
$(this).closest('li').hide();
if(actual_id === id)
$("#submit_button").prop('disabled', true);
}
});
}
function adjust_visible_locations(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-location='true']"));
}
form(class="form-horizontal" method="POST", action="#{pentry_edit_base}/add_predefined_location", id="form-locationselector")
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-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="goto_mainpage();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
.new_flex_one(style="padding-bottom: 200px;")
.container-fluid
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);
}
var all_locations = [];
var locationMatcher = function(locations) {
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(locations, function(i, loc) {
console.log('location: ', loc);
if (substrRegex.test(loc.name)) {
matches.push(loc);
}
});
cb(matches);
};
};
$(document).ready(function() {
$("[data-location='true']").each(function(index){
all_locations.push({id: this.id, name: this.innerText});
});
console.log(all_locations);
$("#edit_filter").typeahead({
hint: true,
highlight: true,
minLength: 1
},
{
name: 'locations',
source: locationMatcher(all_locations),
display: 'name',
limit: 15
}).bind('typeahead:select typeahead:autocomplete', function(ev, suggestion) {
console.log(suggestion);
select_location(suggestion.id);
});
$("#edit_filter").focus();
});
$("#form-locationselector").on('submit', function(e) {
var data = {
name : $("#actual_location_name").val(),
sign : $("#actual_location_sign").val(),
id : $("#actual_location_id").val()
};
add_location(data);
e.preventDefault();
});

84
views/about.jade Normal file
View File

@@ -0,0 +1,84 @@
include mixins
include mixins_day
doctype html
html
include header
body
.root
.new_flex_zero
+nav_bare("PfarrInfoSystem")
.container-fluid
h1(style="margin-top: 0px;") PfIS - PfarrInfoSystem
p.
<b>Version 2.0</b><br/>
<b>Copyright (C) Peter Fischer 2010 - 2018</b>
p.
PfIS ist lizenziert unter der GPL Version 2 oder später (siehe unten &quot;Lizenz&quot;).<br/>
Um den Quelltext zu bekommen, wenden Sie sich bitte an <a href="mailto:peter@halieus.de">peter@halieus.de</a>
hr
.new_flex_one
.container-fluid
h3(style="margin-top: 0px;") Verwendete Bibliotheken
p PfIS wäre nicht möglich ohne die Verwendung folgender freier Programm-Bibliotheken:
h4(style="margin-bottom: 2px;") Boost (http://www.boost.org)
p Verschiedene C++-Programmbibliotheken.
h4(style="margin-bottom: 2px;") websocketpp (https://github.com/zaphoyd/websocketpp)
p WebSocket-Implementierung
h4(style="margin-bottom: 2px;") Cairo, cairomm (http://www.cairographics.org)
p.
Vektororientiertes Zeichnen (für die Druckfunktion).
Ferner der C++-Wrapper.
h4(style="margin-bottom: 2px;") Pango (http://www.pango.org)
p Textsatz (für die Druckfuntion).
h4(style="margin-bottom: 2px;") Poppler (http://poppler.freedesktop.org)
p PDF-Bibliothek (Anzeige der Druckdateien).
h4(style="margin-bottom: 2px;") OpenSSL (http://www.openssl.org)
p Verschlüsselung der Daten.
h4(style="margin-bottom: 2px;") libarchive (http://code.google.com/p/libarchive)
p Datenarchivoperationen.
h4(style="margin-bottom: 2px;") (lib)bzip2 (http://www.bzip.org)
p Datenkompression.
h4(style="margin-bottom: 2px;") xz (http://tukaani.org/xz)
p Datenkompression.
h4(style="margin-bottom: 2px;") pugixml (http://www.pugixml.org)
p XML-Datenverarbeitung.
h4(style="margin-bottom: 2px;") glib (http://www.gtk.org)
p Diverse Basis-Funktionen.
h4(style="margin-bottom: 2px;") glibmm, pangomm (http://www.gtkmm.org)
p C++-Wrapper für Glib und Pango.
h4(style="margin-bottom: 2px;") Node.js (http://nodejs.org)
p.
Server-Side JavaScript, das aufbauend auf dem PfIS(JSON)Server die Benutzerschnittstelle erzeugt.
Dies wäre nicht möglich, ohne einige Node.js-Module, besonders express.js, express-session, socket.io und jade.
(Links hierzu über <a href="http://www.npmjs.com">npm</a>).
h4(style="margin-bottom: 2px;") jsoncpp (https://github.com/open-source-parsers/jsoncpp)
p Bildet die Brücke zwischen dem eigentlichen PfIS (im Sinne der Datenbank) und Node.js
h4(style="margin-bottom: 2px;") Weiteres
p Daneben die Bibliotheken, von denen die oben genannten abhängig sind.</message>
h3 Lizenz
p.
<i><b>GNU GENERAL PUBLIC LICENSE</b></i><br/>
Die Formulierung der Lizenz kann gefunden werden unter der Adresse <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">http://www.gnu.org/licenses/gpl-2.0.html</a>.

View File

@@ -0,0 +1,220 @@
include mixins
include mixins_day
- var actual_background = "yellow";
mixin do_actor(actor)
- var my_class;
- if(actor.available === false) my_class = "panel-danger";
- actual_actor_id === actor.id ? my_class = "panel-success" : my_class="panel-default";
.panel(class=my_class, id=actor.id, data-actorname=actor.name, data-actor="", data-status="#{actor.status}", data-available="#{actor.available}")
.panel-heading(onclick="select_actor('#{actor.id}');")
- var my_cursor = "cursor: pointer;";
//- actor.available ? my_cursor = "cursor: pointer;" : my_cursor = "cursor: auto;"
h4.panel-title(style=my_cursor)
| #{actor.name}
if(actor.available === false)
.small(style="color: #a94442; margin-bottom: 0px;")
i Abwesend
| &nbsp; &nbsp;
| !{actor.unavailable_reason}
if(actor.other_events_today.length > 0)
.panel-body
p(style="margin-bottom: 0px;")
| Heute bereits eingebunden in:
each ev in actor.other_events_today
+pevent_with_thereafter_timeline("", ev, false)
//- ul(style="margin-bottom: 0px; padding-inline-start: 15px;")
//- each ev in actor.other_events_today
//- li
//- i !{ev.name}
//- |
//- span.small !{ev.name_secondary}
//- .small !{ev.time}
//- if(ev.is_involved_in_mainevent === false)
//- .small [Nicht direkt in Haupt-Ereignis eingebunden.]
//- if(ev.roles !== "")
//- .small Mitwirkung: #{ev.roles}
//- if(ev.thereafterevents.length > 0)
//- ul(style="margin-bottom: 0px; padding-inline-start: 15px;")
//- each tev in ev.thereafterevents
//- li
//- i !{tev.name}
//- |
//- span.small !{ev.name_secondary}
//- .small !{tev.time}
//- if(tev.roles !== "")
//- .small Mitwirkung: #{tev.roles}
mixin do_unit(unit)
- var my_uid = generateUID();
- var my_border_color = unit.is_pastoral ? "border-color: "+ unit.color +"; " : "";
- var my_background_image = unit.is_pastoral ? "background-image: linear-gradient(to bottom,"+unit.color+" 50%, #ffffff 100%); border-color: #ffffff; background-color: #ffffff; border-top-left-radius: 0px; border-top-right-radius: 0px;" : "";
- var my_border_top_color = unit.is_pastoral ? "border-top-color: #ffffff;" : "";
- var in_class = unit.subunits.length > 0 ? "in" : "";
.panel.panel-default.panel_group_and_unit(id=my_uid, data-elemname=unit.name, data-parishdb="", data-dn=unit.dn, data-elemtype="unit", data-depth=unit.depth, style=my_border_color )
.panel-heading(style=my_background_image)
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{unit.name}
//- border-bottom: 2px solid #{elem.color};
.panel-collapse.collapse(class=in_class, id="PANEL_"+my_uid)
.panel-body(style="padding: 10px; "+my_border_top_color)
if unit.actors.length > 0
each actor in unit.actors
+do_actor(actor)
if unit.subunits.length > 0
each sub in unit.subunits
+do_unit(sub)
.subroot
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
h4 Beteiligten aus der Liste hinzufügen
label
input(type="checkbox", id="show_retired")
//- checked
span
span Ausgeschiedene anzeigen
form(class="form-horizontal", method="POST", action="", id="form_actorselector")
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", id="for_role", value="#{for_role}")
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
//- goto_mainpage();
button(class="btn btn-warning btn-sm", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
p.small(style="margin-top: 7px; margin-bottom: 0px; font-weight: bold;") Aktuell ausgewählt
p(style="font-size: 100%; font-weight: bold; margin-bottom: 0px;")
- var actual_name = (actual_actor_name === "" ? "" : actual_actor_name)
span#actual_name #{actual_name}
#errorpane
.new_flex_one(style="padding-bottom: 200px;")
.container-fluid
for unit in units
+do_unit(unit)
script.
pcal_pentry_edit_manager.show_searchbar("adjust_visible_actors(this);");
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();
});
$("[data-status='retired']").hide();
select_actor = function(actor_id)
{
console.log("SELECTED: " + actor_id);
var actual_id = $("#actual_actor_id").val();
console.log(actual_id);
if(actual_id === actor_id)
{
console.log("NOTHIN CHANGED");
return;
}
var new_panel = $("#" + actor_id).closest('.panel');
//if(new_panel.hasClass("panel-danger")) // i. e.: not available
// return;
if(actual_id !== "") {
var replace_class = "panel-default";
var old_panel = $("#" + actual_id).closest('.panel');
console.log(old_panel.data("available"));
console.log(old_panel);
if(old_panel.data("available") == false) replace_class = "panel-danger";
old_panel.removeClass('panel-success').addClass(replace_class);
}
var replace_class = 'panel-default';
if(new_panel.hasClass("panel-danger"))
replace_class = "panel-danger";
new_panel.removeClass(replace_class).addClass('panel-success');
$("#actual_actor_id").val(actor_id);
var actorname = $("#"+actor_id).data("actorname");
$("#actual_actor_name").val(actorname);
$("#actual_name").text(actorname);
$("#errorpane").empty();
$("#submit_button").prop('disabled', false);
}
function set_visibility_according_to_filter(substrRegex, elems) {
var units_are_shown = false;
if(!units_are_shown) {
$("[data-elemtype='unit']").each(function(index) {
var panel_id = "#PANEL_" + $(this).prop('id');
$(panel_id).collapse('show');
});
console.log('SHOW ALL UNITS');
units_are_shown = true;
}
var actual_id = $("#actual_actor_id").val();
elems.each(function(index) {
my_panel = $(this);
var txt = my_panel.data("actorname");
var id = my_panel.prop('id');
if(substrRegex.test(txt)) {
my_panel.show();
if(actual_id === id) {
$("#submit_button").prop('disabled', false);
$("#errorpane").empty();
}
}
else {
my_panel.hide();
if(actual_id === id) {
$("#submit_button").prop('disabled', true);
$("#errorpane").html(get_compiled_message("danger", "Auswahl ungültig", "Durch die Filterangabe wurde Ihre Auswahl ungültig!"));
}
}
});
}
function adjust_visible_actors(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-status='active']"));
if( $("#show_retired").prop('checked') ) {
set_visibility_according_to_filter(substrRegex, $("[data-status='retired']"));
}
}
$("#form_actorselector").on('submit', function(e) {
var data = {
for_role: $("#for_role").val(),
name : $("#actual_actor_name").val(),
id : $("#actual_actor_id").val()
};
pcal_pentry_edit_manager.add_involved(data);
e.preventDefault();
});

View File

@@ -0,0 +1,146 @@
include mixins
- var actual_background = "yellow";
mixin do_actor(actor)
- style="cursor: pointer; padding-top: 5px; padding-bottom: 5px;";
- 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)
.subroot
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
h4 Beteiligten aus der Liste hinzufügen
label
input(type="checkbox", checked, id="show_retired")
span
span Ausgeschiedene anzeigen
form(class="form-horizontal", id="form-filter")
.form-group
label(for='edit_filter', class="col-sm-1 control-label") Filter
.col-sm-11
input(id="edit_filter", type="text", class="form-control", oninput="adjust_visible_actors(this);")
script.
$("#form-filter").on('submit', function(e){
console.log('FILTER SUBMIT');
e.preventDefault();
});
// HINT: the 'autofocus'-attribute is obviously only interpreted once!!!
$("#edit_filter").focus();
form(class="form-horizontal", method="POST", action="#{pentry_edit_base}/add_actor", id="form-actorselector")
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", id="for_role", value="#{for_role}")
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="goto_mainpage();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
.new_flex_one(style="padding-bottom: 200px;")
.container-fluid
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);
var actual = $("#actual_actor_id").val();
console.log(actual);
if(actual === actor_id)
{
console.log("NOTHIN CHANGED");
return;
}
if(actual !== "") {
$("#"+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);
}
function set_visibility_according_to_filter(substrRegex, elems) {
var actual_id = $("#actual_actor_id").val();
elems.each(function(index) {
my_span = $(this).find(':first-child');
var txt = my_span.text();
var id = my_span.prop('id');
if(substrRegex.test(txt)) {
$(this).show();
if(actual_id === id)
$("#submit_button").prop('disabled', false);
}
else {
$(this).hide();
if(actual_id === id)
$("#submit_button").prop('disabled', true);
}
});
}
function adjust_visible_actors(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-status='active']"));
if( $("#show_retired").prop('checked') ) {
set_visibility_according_to_filter(substrRegex, $("[data-status='retired']"));
}
}
$("#form-actorselector").on('submit', function(e) {
var data = {
for_role: $("#for_role").val(),
name : $("#actual_actor_name").val(),
id : $("#actual_actor_id").val()
};
add_involved(data);
e.preventDefault();
});

167
views/attic/pcalimport.jade Normal file
View File

@@ -0,0 +1,167 @@
include mixins
doctype strict
html
include header
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/pcalimport_changes.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; }
}
.changes_details {
max-height: 250px;
overflow-y: scroll;
margin-top: 10px;
}
.day_details {
max-height: 200px;
overflow-y: scroll;
}
body
.modal.fade(id="collectUserDataDialog", role="dialog", aria-labelledby="collectUserDataDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="collectUserDataDialogLabel") Benutzer-Einträge auslesen
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Einträge der Benutzer von PfIS zusammengestellt werden ...
.modal.fade(id="confirmReject", role="dialog", aria-labelledby="confirmRejectLabel", 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="confirmRejectLabel") Ablehnung bestätigen
.modal-body
p Sind Sie sicher, dass Sie diese Änderung verwerfen wollen?
br
span Die entsprechende Datei wird vom Datenträger gelöscht!
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-danger", id="confirm") Änderung tatsächlich ablehnen
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Elemente in den Pfarrkalender importieren
p Lesen sie alle von den Nutzern von PfIS erstellten Kalender-Einträge aus bzw. importieren Sie eine Datei und entscheiden Sie, welche Einträge übernommen werden sollen.
.btn-toolbar(style="margin-bottom: 20px;")
.btn-group.btn-group-xs
button.btn.btn-primary.button-import-userdata Einträge der Nutzer auslesen
.btn-group.btn-group-xs
button.btn.btn-primary.button-import-file Datei importieren
.new_flex_one
.container-fluid#changes_parent
//- var parishid = 0;
//-each parish in parishes
//- - var my_uid = generateUID();
//- if(parish.volunteergroups.length > 0)
//- .panel.panel-default.parish-marker(style="border-width: 3px;", data-parishid=parishid)
//- .panel-heading
//- h4.panel-title(data-toggle="collapse", data-target="#PANEL_#{my_uid}", aria-expanded="false", aria-controls="PANEL_#{my_uid}", style="cursor: pointer;") #{parish.name}
//- .panel-collapse.collapse(id="PANEL_#{my_uid}")
//- .panel-body(style="padding: 10px;")
//- .container-fluid
//- .row
//- button.btn.btn-primary.btn-xs.button-select-all Alle auswählen
//- button.btn.btn-default.btn-xs.button-deselect-all Alle abwählen
//- table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
//- thead
//- tr
//- td <b>Name</b>
//- tbody
//- for grp in parish.volunteergroups
//- tr(onclick="$(this).toggleClass('group_is_selected'); update_button_volunteergroupsselected();", style="cursor: pointer;", data-dn="#{grp.dn}", data-group)
//- td #{grp.name}
//- - parishid++;
script.
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
$(".button-import-userdata").on('click', function(event) {
console.log('USERDATA');
$('#collectUserDataDialog').modal({
backdrop: 'static',
keyboard: false
});
ws.send('collect_userdata', {});
});
$(".button-import-file").on('click', function(event) {
});
ws.bind("collected_changes", function(data) {
console.log(data);
var html = pcalimport_changes_template(data);
if(data.source==="user-data")
$('#collectUserDataDialog').modal('hide');
$("#changes_parent").empty();
$("#changes_parent").html(html);
$("#changes_parent").find(".btn-success").on('click', on_click_accept);
$('html, body').scrollTop(0);
});
function on_click_accept() {
$(this).closest('.btn-group').find('.btn').attr('disabled', 'disabled');
console.log('SUCCESS CLICKED', this);
}
function update_button_volunteergroupsselected() {
if($(".group_is_selected").length > 0)
$("#button_volunteergroupsselected").removeClass("disabled");
else
$("#button_volunteergroupsselected").addClass("disabled")
}
function volunteergroupsselected() {
if($("#button_volunteergroupsselected").hasClass("disabled"))
return;
var selected_groups = [];
$("[data-parishid]").each(function(index){
var this_parish = { id: $(this).data('parishid'), selected_groups : [] };
$(this).find(".group_is_selected").each(function(index) {
this_parish.selected_groups.push($(this).data('dn'));
});
selected_groups.push(this_parish);
});
console.log(selected_groups);
console.log($("#combo_sortorder").val());
ws.send('get_volunteerslist', {sortorder: parseInt($("#combo_sortorder").val()), groups : selected_groups});
}
ws.bind('get_volunteerslist_result', function(data) {
console.log(data);
var html = volunteerslist_result_template(data);
$("#volunteerslist_list").empty();
$("#volunteerslist_list").html(html);
$("#volunteerslist").show();
$("#volunteerslist_list").parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
})

View File

@@ -0,0 +1,72 @@
include mixins_week
mixin show_changes(pentrys, n)
if(pentrys.length > 0)
fieldset
legend !{n}
each pentry in pentrys
- var my_uid = generateUID();
.panel.panel-primary(style="margin-left: 10px;")
.panel-heading
h3.panel-title(data-toggle="collapse", data-target="#"+my_uid, style="cursor: pointer;") !{pentry.name}
.small(style="font-size: 85%;")
i !{pentry.punit}
.panel-collapse.collapse(id=my_uid)
.panel-body
ul.nav.nav-tabs
each c in pentry.changes
- var cls = (c.idx === 0 ? "active" : "");
- c.tab_id = generateUID();
- var color = c.type === "new" ? "green" : (c.type==="remove" ? "red" : "gold")
li(class=cls, style="border-bottom: 3px solid " + color +";")
a(data-toggle="tab", href="#"+c.tab_id) !{c.user} !{c.tab_id}
.tab-content(style="padding-left: 10px; padding-right: 10px;")
each c in pentry.changes
- var cls = (c.idx === 0 ? "active" : "");
- var clss = ["tab-pane", cls]
div(class=clss, id=c.tab_id)
.btn-group.btn-group-sm(style="margin-top: 10px;")
button.btn.btn-success Akzeptieren
button.btn.btn-danger(data-toggle="modal", data-target="#confirmReject") Ablehnen
.changes_details
if(c.type !== "new")
if(pentry.punit !== c.punit)
p(style="margin-bottom: 10px;")
b !{c.punit}
else
p.small(style="margin-bottom: 10px;")
b Gleicher pastoraler Kontext.
if(c.diff !== "")
p(style="margin-bottom: 0px;")
b Diff
pre
code
!{c.diff}
p(style="margin-bottom: 0px;")
b Roh-Daten
pre
code
!{c.data}
mixin pday_with_changes(pday)
.panel.panel-default(data-date=pday.date)
.panel-heading
h3.panel-title(data-toggle="collapse", data-target="#PANEL_#{pday.date}", aria-expanded="false", aria-controls="PANEL_#{pday.date}", style="cursor: pointer;") !{pday.date_pretty}
.panel-collapse.collapse(id="PANEL_#{pday.date}")
.panel-body(style="padding: 10px;")
- var celebration_printed = false;
.day_details
table(width="100%")
+week_day_mobile(pday.day)
+show_changes(pday.events, "Ereignisse")
+show_changes(pday.todos, "Zu Tun")
+show_changes(pday.away, "Abwesend")
+show_changes(pday.keep_in_mind, "Zu Beachten")
+show_changes(pday.vehicle_use, "Fahrzeugbenutzung")
each day in changes
+pday_with_changes(day)

452
views/birthdaycards.jade Normal file
View File

@@ -0,0 +1,452 @@
- var formats_string = JSON.stringify(data.formats);
- var formats_volunteers_string = JSON.stringify(data.formats_volunteers)
include mixins
include mixins_birthdaycards
doctype html
html
include header
script(src="/javascripts/validator.min.js")
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/birthdaycards_personview.js')
script(src='/templates/birthdaycards_volunteerslist.js')
script(src='/templates/birthdaycards_volunteerspersonslist.js')
script(src='/javascripts/runtime.js')
style.
.send_card { background-color: yellow; }
.send_card_group { background-color: yellow; }
.send_card_volunteer { background-color: yellow; }
.textarea_in_flex_one {
padding-bottom: 15px;
margin-left: 15px;
margin-right: 15px;
height: 100%;
}
@media only screen and (max-width: 768px) {
.textarea_in_flex_one {
height: 400px;
}
}
body
#meldeweseninput.sidewideoverlay(style="z-index: 5;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "meldeweseninput_menu")
.container-fluid
h1 Geburtstagskarten erstellen
.small Adressen eingeben
p Bitte kopieren Sie in das Textfeld unten alle Zeilen aus dem Meldewesen
nav
ul.pager
li.previous
span(onclick="$('#meldeweseninput').hide(); $('html, body').scrollTop(0);") Zurück
li.next#button_proceed_meldeweseninput
span(onclick="proceed_meldeweseninput();") Weiter
div(style="flex: 1; display: flex;")
.textarea_in_flex_one(style="flex: 1;")
textarea#meldeweseninputpane(style="width: 100%; height: 100%; resize: none;", oninput="meldeweseninputpane_change();").
!{data.meldeweseninput}
#meldewesenproceeded.sidewideoverlay(style="z-index: 10;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "meldewesenproceeded_menu")
.container-fluid
h1 Geburtstagskarten erstellen
.small Daten überprüfen, Auskunfssperren bearbeiten
p Bitte überprüfen Sie unten stehende Daten und wählen Sie aus, welche Personen mit Auskunfssperre auch eine Karte erhalten sollen
nav
ul.pager
li.previous
span(onclick="$('#meldeweseninput').show(); $('#meldewesenproceeded').hide(); $('html, body').scrollTop(0);") Zurück
li.next
span(onclick="generate_cards();") Karten erstellen
.new_flex_one
.container-fluid
#meldewesenproceededpane
#volunteergroupselector.sidewideoverlay(style="z-index: 5;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "volunteergroupselector_menu")
.container-fluid
h1 Geburstagskarten erstellen
.small Ehrenamtlichengruppen auswählen
p Wählen Sie die Gruppen aus, die eine Karte bekommen sollen und bestimmen Sie, welche Personengruppen daraus eine Karte erhalten sollen
nav
ul.pager
li.previous
span(onclick="$('#volunteergroupselector').hide(); $('html, body').scrollTop(0);") Zurück
li.next.disabled#button_volunteergroupsselected
span(onclick="volunteergroupsselected();") Weiter
.new_flex_one
.container-fluid
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px; color: orange;") Einstellungen
div
b Monat
span
.form-group
.col-sm-2
select(id='combo_month', class="form-control")
option(value="1") Januar
option(value="2") Februar
option(value="3") März
option(value="4") April
option(value="5") Mai
option(value="6") Juni
option(value="7") Juli
option(value="8") August
option(value="9") September
option(value="10") Oktober
option(value="11") November
option(value="12") Dezember
.col-sm-1
select(id="combo_year", class="form-control", style="min-width: 100px;")
option(value="2015") 2015
option(value="2016") 2016
option(value="2017") 2017
option(value="2018") 2018
option(value="2019") 2019
script.
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth()+2;
if(month===13) {
year++;
month=1;
}
$("#combo_month").val(month);
$("#combo_year").val(year);
br
div(style="margin-top: 7px;")
label
input(type="checkbox", id="cb_omitt_normal_birthdays", checked, style="vertical-align: sub;")
span Schließe Geburtstagskinder aus, die eine normale Karte bekommen (würden)
br
label
input(type="checkbox", id="cb_select_persons", style="vertical-align: sub;")
span Wähle einzelne Personen aus
#volunteergroupselector_groupslist
#volunteerpersonsselector.sidewideoverlay(style="z-index: 10;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "volunteerpersonsselector_menu")
.container-fluid
h1 Geburstagskarten erstellen
.small Ehrenamtliche auswählen
p Wählen Sie die Personen aus, die eine Karte bekommen sollen
nav
ul.pager
li.previous
span(onclick="$('#volunteerpersonsselector').hide(); $('html, body').scrollTop(0);") Zurück
li.next.disabled#button_volunteerpersonsselected
span(onclick="volunteerpersonsselected();") Weiter
.new_flex_one
.container-fluid
#volunteerpersonsselector_volunteerslist
#cardspanel.sidewideoverlay(style="z-index: 15;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "cardpanel_menu")
.container-fluid
h1 Geburtstagskarten erstellen
.small Karten herunterladen
p#cardspanel_downloadhint(style="display: none;") Sie können nun die erstellten Karten herunterladen
nav
ul.pager
li.previous
span#cardspanel_backbutton Zurück
li.next.disabled
span Weiter
.new_flex_one
.container-fluid
a#cardspanel_link_cards(href="/birthdaycards/#{taskuuid}/download/cards.pdf", target="_blank", style="margin-right: 15px; display: none;")
img(src="/images/mail-read-32.png", style="margin-right: 2px;")
span Karten
a#cardspanel_link_envelopes(href="/birthdaycards/#{taskuuid}/download/envelopes.pdf", target="_blank", style="margin-right: 15px; display: none;;")
img(src="/images/mail-unread-32.png", style="margin-right: 2px;")
span Umschläge
.alert.alert-warning#cardspanel_nopersonsselectedwarning(style="display: none;")
strong Achtung
span
span Es wurden keine Karten und Umschläge erstellt, weil keine Personen den Kriterien entsprachen!
.modal.fade(id="proceedMeldewesenInputDialog", role="dialog", aria-labelledby="proceedMeldewesenInputDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="proceedMeldewesenInputDialogLabel") Meldewesendaten verarbeiten
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Daten aus dem Meldewesen verarbeitet werden ...
.modal.fade(id="generateCardsDialog", role="dialog", aria-labelledby="generateCardsDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="generateCardsDialogLabel") Geburtstagskarten und Kuverts erstellen
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während Geburtstagskarten und Kuverts erstellt werden:
p(style="font-weigth: bold") Geburtstagskarten ...
.progress
#progress_cards.progress-bar(role="progressbar", aria-valuenow="0", aria-valuemin="0", aria-valuemax="100", style="width: 0%;")
p(style="font-weigth: bold") Umschläge ...
.progress
#progress_envelopes.progress-bar(role="progressbar", aria-valuenow="0", aria-valuemin="0", aria-valuemax="100", style="width: 0%;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Geburtstagskarten erstellen
.small Grundeinstellungen
p Bitte wählen Sie Pfarrei, Adressatengruppe und Kartenformat aus
nav
ul.pager
li.previous.disabled
span Zurück
li.next
span(onclick="save_settings();") Weiter
.new_flex_one
.container-fluid
+birthdaycards_settings(data.parishes, data.parishid, data.receivers, data.formats, data.formats_volunteers, data.formatid)
script.
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
var formats = !{formats_string};
var formats_volunteers = !{formats_volunteers_string};
function update_formats() {
var optionSelected = $("#combo_receivers").prop('selectedIndex');
$("#combo_format").empty();
var the_formats = (optionSelected === 0 ? formats : formats_volunteers);
for(idx = 0; idx < the_formats.length; ++idx) {
var format = the_formats[idx];
$("#combo_format").append($("<option></option>").text(format));
}
}
function save_settings() {
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedReceivers = $("#combo_receivers").prop('selectedIndex');
var selectedFormat = $("#combo_format").prop('selectedIndex');
ws.send('save_settings', {parishid: selectedParish, receivers: selectedReceivers, formatid: selectedFormat});
}
ws.bind('save_settings_result', function(data) {
if(data.receivers === 0) {
$("#meldeweseninput").show();
}
else {
var html = birthdaycards_volunteerslist_template(data);
$("#volunteergroupselector_groupslist").empty();
$("#volunteergroupselector_groupslist").html(html);
$("#volunteergroupselector").show();
$("#volunteergroupselector_groupslist").parent().parent().scrollTop(0);
}
$('html, body').scrollTop(0);
});
function meldeweseninputpane_change() {
if($("#meldeweseninputpane").val()==="")
$("#button_proceed_meldeweseninput").addClass('disabled');
else
$("#button_proceed_meldeweseninput").removeClass('disabled');
}
meldeweseninputpane_change();
function proceed_meldeweseninput() {
if($("#button_proceed_meldeweseninput").hasClass("disabled"))
return;
//$('#proceedMeldewesenInputDialog').modal('show');
$('#proceedMeldewesenInputDialog').modal({
backdrop: 'static',
keyboard: false
});
ws.send('proceed_meldeweseninput', {input: $("#meldeweseninputpane").val()});
}
ws.bind('proceed_meldeweseninput_result', function(data) {
console.log(data);
$('#proceedMeldewesenInputDialog').modal('hide');
var html = birthdaycards_personview_template(data);
$("#meldewesenproceededpane").empty();
$("#meldewesenproceededpane").html(html);
$("#meldewesenproceeded").show();
$("#meldeweseninput").hide();
$("#meldewesenproceededpane").parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
});
function prepare_generate_cards() {
$("#cardspanel_link_cards").hide();
$("#cardspanel_link_envelopes").hide();
$("#cardspanel_downloadhint").hide();
$("#cardspanel_nopersonsselectedwarning").hide();
$("#cardspanel").show();
$('html, body').scrollTop(0);
$("#progress_envelopes").prop("aria-valuenow", 0);
$("#progress_envelopes").css("width", "0%");
$("#progress_envelopes").html("0%");
//$("#generateCardsDialog").modal('show');
$('#generateCardsDialog').modal({
backdrop: 'static',
keyboard: false
});
}
function cardspanel_go_back_to_meldewesenproceeded() {
$('#meldewesenproceeded').show();
$('#cardspanel').hide();
$('#meldewesenproceededpane').parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
}
function cardspanel_go_back_to_volunteergroupselector() {
$('#volunteergroupselector').show();
$('#cardspanel').hide();
$('#volunteergroupselector_groupslist').parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
}
function cardspanel_go_back_to_volunteerpersonsselector() {
$('#volunteerpersonsselector').show();
$('#cardspanel').hide();
$('#volunteerpersonsselector_volunteerslist').parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
}
function generate_cards() {
$("#meldewesenproceeded").hide();
prepare_generate_cards();
var send_cards_to_add = [];
$(".send_card").each(function(index) {
send_cards_to_add.push($(this).prop('id'));
});
console.log(send_cards_to_add);
$("#cardspanel_backbutton").off('click');
$("#cardspanel_backbutton").on('click', cardspanel_go_back_to_meldewesenproceeded);
ws.send('generate_cards', {send_cards_to_add: send_cards_to_add});
}
function update_button_volunteergroupsselected() {
if($(".send_card_group").length > 0)
$("#button_volunteergroupsselected").removeClass("disabled");
else
$("#button_volunteergroupsselected").addClass("disabled")
}
function volunteergroupsselected() {
if($("#button_volunteergroupsselected").hasClass("disabled"))
return;
var send_cards_to = [];
$(".send_card_group").each(function(index) {
send_cards_to.push($(this).data('dn'));
});
console.log(send_cards_to);
if($("#cb_select_persons").prop('checked'))
ws.send('get_volunteers_for_selection', {volunteergroups: send_cards_to, month: $("#combo_month").val(), year: $("#combo_year").val(), omitt_normal_birthdays: $("#cb_omitt_normal_birthdays").prop('checked')});
else {
$("#volunteergroupselector").hide();
prepare_generate_cards();
$("#cardspanel_backbutton").off('click');
$("#cardspanel_backbutton").on('click', cardspanel_go_back_to_volunteergroupselector);
ws.send('generate_cards', {volunteergroups: send_cards_to, persons: [], month: $("#combo_month").val(), year: $("#combo_year").val(), omitt_normal_birthdays: $("#cb_omitt_normal_birthdays").prop('checked')});
}
}
function update_button_volunteerpersonsselected() {
if($(".send_card_volunteer").length > 0) {
$("#button_volunteerpersonsselected").removeClass("disabled");
$("#button_volunteerpersonsselected").prop("disabled", false);
}
else {
$("#button_volunteerpersonsselected").addClass("disabled");
$("#button_volunteerpersonsselected").prop("disabled", true);
}
}
ws.bind('get_volunteers_for_selection_result', function(data) {
var html = birthdaycards_volunteerspersonslist_template(data);
$("#volunteerpersonsselector_volunteerslist").empty();
$("#volunteerpersonsselector_volunteerslist").html(html);
$("#volunteerpersonsselector").show();
$("#volunteerpersonsselector_volunteerslist").parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
})
function volunteerpersonsselected() {
if($("#button_volunteerpersonsselected").hasClass("disabled"))
return;
$("#volunteerpersonsselector").hide();
prepare_generate_cards();
$("#cardspanel_backbutton").off('click');
$("#cardspanel_backbutton").on('click', cardspanel_go_back_to_volunteerpersonsselector);
var persons = [];
$(".send_card_volunteer").each(function(index) {
persons.push($(this).data('dn'));
});
ws.send('generate_cards', {persons: persons});
}
ws.bind('generate_cards_progress', function(data) {
console.log(data);
var percent = Math.round(data.generated * 100 / data.total) ;
console.log(percent);
switch(data.step) {
case 'cards':
$("#progress_cards").prop("aria-valuenow", percent);
$("#progress_cards").css("width", percent +"%");
$("#progress_cards").html(percent +"%");
break;
case 'envelopes':
$("#progress_envelopes").prop("aria-valuenow", percent);
$("#progress_envelopes").css("width", percent +"%");
$("#progress_envelopes").html(percent +"%");
break;
};
});
ws.bind('generate_cards_result', function(data) {
console.log('generate_cards_result');
$("#generateCardsDialog").modal('hide');
if(data.number_of_cards > 0) {
$("#cardspanel_downloadhint").show();
$("#cardspanel_link_cards").show();
$("#cardspanel_link_envelopes").show();
}
else
$("#cardspanel_nopersonsselectedwarning").show();
});

View File

@@ -0,0 +1,3 @@
include mixins_birthdaycards
+birthdaycards_persons(omitted_lines, persons, persons_with_information_lock, persons_omitted)

View File

@@ -0,0 +1,13 @@
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px; color: orange;") Ehrenamtlichengruppen
p Wählen Sie die Gruppen aus, die eine Karte bekommen sollen!
button.btn.btn-primary.btn-xs(onclick="$('[data-group]').addClass('send_card_group'); update_button_volunteergroupsselected();") Alle auswählen
button.btn.btn-default.btn-xs(onclick="$('[data-group]').removeClass('send_card_group'); update_button_volunteergroupsselected();") Alle abwählen
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
thead
tr
td <b>Name</b>
tbody
for grp in volunteergroups
tr(onclick="$(this).toggleClass('send_card_group'); update_button_volunteergroupsselected();", style="cursor: pointer;", data-dn="#{grp.dn}", data-group)
td #{grp.name}

View File

@@ -0,0 +1,22 @@
if persons.lenght === 0
.alert.alert-warning
strong Achtung
span
span Es wurden keine Personen, die die Kriterien erfüllen würden, gefunden!
else
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px; color: orange;") Ehrenamtliche Geburtstagskinder
button.btn.btn-primary.btn-xs(onclick="$('[data-volunteer]').addClass('send_card_volunteer'); update_button_volunteerpersonsselected();") Alle auswählen
button.btn.btn-default.btn-xs(onclick="$('[data-volunteer]').removeClass('send_card_volunteer'); update_button_volunteerpersonsselected();") Alle abwählen
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
thead
tr
td(style="width: 50%;") <b>Name</b>
td <b>Geburtstag</b>
td <b>Alter</b>
tbody
for p in persons
tr(onclick="$(this).toggleClass('send_card_volunteer'); update_button_volunteerpersonsselected();", style="cursor: pointer;", data-dn="#{p.dn}", data-volunteer)
td #{p.name}
td #{p.birthday}
td #{p.age}

41
views/datepicker.jade Normal file
View File

@@ -0,0 +1,41 @@
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' )
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
+messageview(messages)
button(class="btn btn-success btn-xs", type="button", id="change_date", onclick='location.assign("/#{pcalview}/#{date}");')
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
//- http://eternicode.github.io/bootstrap-datepicker/
#datepicker(data-date=date)
script.
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
$("#datepicker").on("changeDate", function(event) {
var d = $("#datepicker").datepicker('getFormattedDate');
console.log(d);
$("#change_date").attr("onclick",'location.assign("/#{pcalview}/'+d+'");');
});

507
views/day.jade Normal file
View File

@@ -0,0 +1,507 @@
include mixins
include mixins_day
doctype html
html(lang="de", xml:lang="de", xmlns="http://www.w3.org/1999/xhtml")
include header
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/daycontent.js')
script(src='/templates/timelinecontent.js')
script(src='/templates/timeline_eventdetails.js')
script(src='/templates/pastoralteamcontent.js')
script(src='/templates/pfarreientimelinecontent.js')
script(src='/templates/errorview_inlay.js')
script(src='/templates/pcal/pentry_clone_move.js')
script(src='/templates/pcal/pentry_clone_move_parishday.js')
script(src='/javascripts/pcal_pentry_clone_move_manager.js')
script(src='/templates/pcal/pentry_edit.js')
script(src='/templates/pcal/edit_event.js')
script(src='/templates/pcal/edit_away.js')
script(src='/templates/pcal/edit_todo.js')
script(src='/templates/pcal/edit_keep_in_mind.js')
script(src='/templates/pcal/edit_vehicle_use.js')
script(src='/templates/actorselector_inlay.js')
script(src='/templates/pastoralunitselector_inlay.js')
script(src='/templates/locationselector_inlay.js')
script(src='/templates/locationeditor_inlay.js')
script(src='/templates/roleeditor_inlay.js')
script(src='/templates/involvededitor_inlay.js')
script(src='/templates/messageview_inlay.js')
script(src='/templates/parishdbpersongroupselector_inlay.js')
script(src='/javascripts/pcal_pentry_edit_manager.js')
script(src="/javascripts/typeahead.jquery.min.js")
link(href="/stylesheets/mytypeahead.css", rel="stylesheet")
script(src="/javascripts/validator.min.js")
script(src='/javascripts/runtime.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' )
link(href="/stylesheets/style_day.css", rel="stylesheet")
link(href="/stylesheets/style_week.css", rel="stylesheet")
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; }
/* for pentry_clone_move */
.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; }
}
/* for pentry_edit */
.panel { margin-bottom: 5px; }
.panel-title { cursor: pointer; }
//- .panel_group_and_unit { border-width: 3px; }
/* The sticky class is added to the header with JS when it reaches its scroll position */
.sticky {
position: fixed;
top: 0;
z-index: 5;
}
body
script.
console.log(history.state);
if(history.state === null || typeof history.state.direction === 'undefined')
{
history.replaceState({direction: 'back'}, document.title, "/#{viewformat}/#{date.date}?back=false");
history.pushState({direction: 'mainpage', date: "#{date.date}", scrollto: ''}, document.title, "/#{viewformat}/#{date.date}");
}
else
console.log(history.state.direction);
.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")
#pentry_clone_move_parent.sidewideoverlay(style="z-index: 5;")
#pentry_edit_parent.sidewideoverlay(style="z-index: 5;")
#daymainview.root
.new_flex_zero
+nav_main_primary(viewformat, date.date)
#dataparent.subroot.full_height(style="margin-top: 5px;")
if viewformat == "timeline"
+timeline(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
else if viewformat == "pastoralteam"
+pastoralteam(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
else if viewformat == "pfarreientimeline"
+pfarreientimeline(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
else
+daycontent(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
- var d = JSON.stringify(date);
script.
var ws;
var viewformat = "#{viewformat}";
var pcal_pentry_clone_move_manager;
var pcal_pentry_edit_manager;
var saved_messages = [];
$(document).ready(function() {
ws = new PfISWebSocket("#{sessionuuid}");
ws.bind_standard_close_handler();
pcal_pentry_clone_move_manager = new pcalPentryCloneMoveManager(ws, "#{viewformat}");
pcal_pentry_clone_move_manager.set_date(!{d});
pcal_pentry_edit_manager = new pcalPentryEditManager(ws);
pcal_pentry_edit_manager.set_date(!{d});
/*if("#{event}" !== "") {
ws.bind('open', function() {day_show_event("#{date.date}", "#{event}");});
}*/
ws.bind('get_parishday_result', function(data){
var scrollto = '';
if(history.state && history.state.scrollto)
scrollto = history.state.scrollto;
// console.log('scrollto:', scrollto);
// history.replaceState({direction: 'back'}, document.title, '/'+ viewformat + '/' + data.date.date + '?back=false');
if(history.state && history.state.date && history.state.date === data.date.date && history.state.direction === "mainpage")
{
console.log('NO new entry in history created')
}
else {
history.pushState({direction: 'mainpage', date: data.date.date }, document.title, '/'+ viewformat + '/' + data.date.date) ;
console.log('new entry in history created')
}
update_navlinks(data.date.date); // navlinks include the current date, so they must always be updated!
var html;
switch(viewformat) {
case "timeline" : html = timelinecontent_template(data); break;
case "pastoralteam" : html = pastoralteamcontent_template(data); break;
case "pfarreientimeline" : html = pfarreientimelinecontent_template(data); break;
default : html = daycontent_template(data); break;
}
$('#dataparent').html(html);
for(midx in saved_messages)
$('#daycontrol_parent').append(saved_messages[midx]);
saved_messages = [];
if((viewformat === "timeline" || viewformat === "pastoralteam" || viewformat === "pfarreientimeline") && scrollto !== '') {
var the_elem = $("[data-event-uuid='" + scrollto + "']");
// this event (the_elem) might have been deleted!!!
if(the_elem.length > 0) {
$('#timelinebody').parent().parent().animate({
scrollTop: the_elem.offset().top - $("#timelinebody").offset().top
}, 1000);
}
}
pcal_pentry_clone_move_manager.set_date(data.date);
pcal_pentry_edit_manager.set_date(data.date);
//console.log("FINISHED REDRAW", new Date());
});
ws.bind('event_details_result', function(data) {
console.log('event_details_result');
if(data.result === "OK") {
if(history.state.direction !== 'day_show_event')
if(history.state.direction === 'day_show_event_after_edit')
history.replaceState({direction: 'day_show_event', event_uuid: data.event.uuid, date: data.date.date}, document.title, location.pathname /* + '/' + data.event.uuid*/);
else
history.pushState({direction: 'day_show_event', event_uuid: data.event.uuid, date: data.date.date}, document.title, location.pathname /* + '/' + data.event.uuid*/);
var html = timeline_eventdetails_template({date : data.date, litinfo: data.litinfo, event: data.event, pcalview: viewformat} );
$('#dataparent').html(html);
}
else {
if(history.state.direction !== 'day_show_event')
history.pushState({direction: 'day_show_event', event_uuid: 'invalid', date: data.date.date}, document.title, location.pathname);
else
history.replaceState({direction: 'day_show_event', event_uuid: 'invalid', date: data.date.date}, document.title, location.pathname);
var html = errorview_inlay_template({ messages: data.messages, is_error: true, session_ended: false});
$('#dataparent').html(html);
}
});
ws.bind('pentry_delete_result', function(data) {
console.log("pentry_delete_result");
console.log(data);
var message = errorview_inlay_template({ messages: data.messages, is_error: (data.result === 'OK' ? false : true), session_ended: false});
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(message);
}
else {
saved_messages.push(message);
history.back();
}
$('#confirmDelete').modal('hide');
});
ws.bind('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');
});
function adjust_updown_buttons(teventbox) {
if(teventbox.is(':first-child'))
{
$(teventbox.find("div > button:nth-child(2)")[0]).prop('disabled', true);
$(teventbox.find("div > button:nth-child(3)")[0]).prop('disabled', false);
}
else
{
if(teventbox.is(':last-child'))
{
$(teventbox.find("div > button:nth-child(2)")[0]).prop('disabled', false);
$(teventbox.find("div > button:nth-child(3)")[0]).prop('disabled', true);
}
else
{
$(teventbox.find("div > button:nth-child(2)")[0]).prop('disabled', false);
$(teventbox.find("div > button:nth-child(3)")[0]).prop('disabled', false);
}
}
}
ws.bind('tevent_move_updown_result',function(data){
console.log(data);
// via the delete_button we can get the eventbox!
var delete_button = $('[data-event-uuid="'+ data.event + '"][data-tevent-uuid="'+ data.tevent + '"]');
var eventbox = delete_button.closest('.eventbox');
var other = {};
/* http://stackoverflow.com/questions/3050830/reorder-list-elements-jquery */
if(data.updown === "down")
{
next = eventbox.next();
next.after(eventbox);
other = next;
}
else /* up */
{
prev = eventbox.prev();
prev.before(eventbox);
other = prev;
}
adjust_updown_buttons(eventbox);
adjust_updown_buttons(other);
/* $('body').loading('stop'); */
});
if(history.state.direction === 'day_show_event' && history.state.event_uuid != 'invalid')
{
ws.bind('open', function() {day_show_event("#{date.date}", history.state.event_uuid)});
}
else if(history.state.direction === 'clone_move')
{
ws.bind('open', function() {pcal_pentry_clone_move_manager.start(history.state.pentrytype, history.state.uuid, history.state.clone_or_move);});
}
else if(history.state.direction.substr(0,12) === 'pentry_edit_')
{
ws.bind('open', function() {pcal_pentry_edit_manager.start(history.state.pentrytype, history.state.uuid);});
}
if("#{scrollto}" !== "") {
$('#timelinebody').animate({
scrollTop: $("[data-event-uuid='#{scrollto}']").offset().top - $("#timelinebody").offset().top
}, 1000);
}
});
function set_viewformat(format, new_date) {
viewformat = format;
day_goto(new_date);
}
function update_navlinks(new_date) {
var day_elem = $('.navbar-collapse > ul > li:nth(0) > a');
var tml_elem = $('.navbar-collapse > ul > li:nth(1) > a');
var pt_elem = $('.navbar-collapse > ul > li:nth(2) > a');
var pfrtl_elem = $('.navbar-collapse > ul > li:nth(3) > a');
var week_elem = $('.navbar-collapse > ul > li:nth(4) > a');
week_elem.prop('href', '/week/' + new_date);
var select_for_view_elem = $('#select_punits_for_view').closest('a');
select_for_view_elem.prop("href", "/"+ viewformat +"/"+new_date+"/select_punits_for_view");
var parishcalA4week_elem = $('#parishcalA4week').closest('a');
parishcalA4week_elem.prop("href", "/parishcalA4week/" + new_date);
switch(viewformat) {
case "timeline":
day_elem.prop("href", "javascript: set_viewformat('day', '" + new_date + "');");
day_elem.parent().removeClass("active");
pt_elem.prop("href", "javascript: set_viewformat('pastoralteam', '" + new_date + "');");
pt_elem.parent().removeClass("active");
pfrtl_elem.prop("href", "javascript: set_viewformat('pfarreientimeline', '" + new_date + "');");
pfrtl_elem.parent().removeClass("active");
tml_elem.prop("href", "#");
tml_elem.parent().addClass("active");
break;
case "pastoralteam":
day_elem.prop("href", "javascript: set_viewformat('day', '" + new_date + "');");
day_elem.parent().removeClass("active");
tml_elem.prop("href", "javascript: set_viewformat('timeline', '" + new_date + "');");
tml_elem.parent().removeClass("active");
pfrtl_elem.prop("href", "javascript: set_viewformat('pfarreientimeline', '" + new_date + "');");
pfrtl_elem.parent().removeClass("active");
pt_elem.prop("href", "#");
pt_elem.parent().addClass("active");
break;
case "pfarreientimeline":
day_elem.prop("href", "javascript: set_viewformat('day', '" + new_date + "');");
day_elem.parent().removeClass("active");
tml_elem.prop("href", "javascript: set_viewformat('timeline', '" + new_date + "');");
tml_elem.parent().removeClass("active");
pfrtl_elem.prop("href", "#");
pfrtl_elem.parent().addClass("active");
pt_elem.prop("href", "javascript: set_viewformat('pastoralteam', '" + new_date + "');");
pt_elem.parent().removeClass("active");
break;
default:
day_elem.prop("href", "#");
day_elem.parent().addClass("active");
tml_elem.prop("href", "javascript: set_viewformat('timeline', '" + new_date + "');");
tml_elem.parent().removeClass("active");
pt_elem.prop("href", "javascript: set_viewformat('pastoralteam', '" + new_date + "');");
pt_elem.parent().removeClass("active");
pfrtl_elem.prop("href", "javascript: set_viewformat('pfarreientimeline', '" + new_date + "');");
pfrtl_elem.parent().removeClass("active");
}
//console.log("UPDATED NAVLINKS", new Date());
}
function day_goto(new_date) {
ws.send('get_parishday', {format : viewformat, date : new_date});
}
function day_show_event(date, event) {
//console.log('day_show_event', date, event);
history.replaceState({direction: 'mainpage', date: date, scrollto: event }, document.title, "/" + viewformat + "/" + date) ;
//console.log(ws);
ws.send('event_details', { 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) {
if(pcal_pentry_edit_manager.is_active()) {
pcal_pentry_edit_manager.deletedialog_handle_show($(this), e);
return;
}
$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() {
if(pcal_pentry_edit_manager.is_active()) {
pcal_pentry_edit_manager.deletedialog_handle_confirm($(this));
return;
}
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);
ws.send('tevent_delete', { date: date, event: event, thereafter: tevent });
return;
}
var uuid = delete_button.data('pentry-uuid');
console.log(date, type, uuid);
ws.send('pentry_delete', { date: date, pentrytype: type, uuid: uuid });
});
do_tevent_move_updown = function(button, date, event, tevent, updown) {
ws.send('tevent_move_updown', { date: date, event: event, thereafter: tevent, updown: updown });
}
window.addEventListener("popstate", function(e) {
console.log(e.state);
if(e.state !== null) {
if(e.state.direction === "back") {
history.go(1);
return;
}
if(e.state.direction === "mainpage"){
// clone_move/edit _manager is active if user clicked on back-button in browser; handle this here:
if(pcal_pentry_clone_move_manager.is_active())
pcal_pentry_clone_move_manager.finish();
if(pcal_pentry_edit_manager.is_active())
pcal_pentry_edit_manager.finish();
day_goto(e.state.date);
return;
}
if(e.state.direction === "pentry_edit_main" && pcal_pentry_edit_manager.is_active())
{
pcal_pentry_edit_manager.show_edit_main();
return;
}
if(e.state.direction.substr(0, 12) === "pentry_edit_")
{
history.go(-1);
}
if(e.state.direction === "day_show_event_after_edit")
{
pcal_pentry_edit_manager.finish();
}
history.replaceState({direction: "mainpage", date: e.state.date}, document.title)
day_goto(e.state.date);
}
}, false);

4
views/daycontent.jade Normal file
View File

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

83
views/edit_away_main.jade Normal file
View File

@@ -0,0 +1,83 @@
include mixins
form(class="form-horizontal subroot", role="form", id="form", method="POST", action="#{away_href}/commit")
.new_flex_zero
.container-fluid(style="margin-bottom: 20px;")
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{away.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{away.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Abwesende Person
.col-sm-10
.input-group
input(id="edit_involveddb_id", type="hidden", name="involveddb_id", value="#{away.involveddb_id}")
input(id="edit_name", type="text", name="edit_name", class="form-control noDirectInput", value="#{away.name}", required)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="save_and_goto('add_actor', {role: '', actual_actor_id: '#{away.involveddb_id}', actual_actor_name : '#{away.name}'})") Ändern
.help-block.with-errors
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)
.form-group
label(for='edit_reason', class="col-sm-2 control-label") Grund
.col-sm-10
input(id='edit_reason', type="text", class="form-control noEnterSubmit", name="edit_reason", value="#{away.reason}", required)
.help-block.with-errors
script.
$('.noEnterSubmit').keydown(function(e){
if ( e.which == 13 ) e.preventDefault();
});
$('.noDirectInput').keydown(function(e) {
var target = $(e.currentTarget);
var form_group = target.closest('.form-group');
var help_block = form_group.find('.with-errors');
if(! form_group.hasClass('has-error'))
{
target.closest('.form-group').addClass('has-error');
}
if(! help_block.hasClass('has-halieus-error')) {
help_block.addClass('has-halieus-error');
help_block.append("<ul class='list-unstyled'><li>Sie müssen den 'Ändern'-Button benutzen!</li></ul>");
}
e.preventDefault();
});
$('.noDirectInput').keyup(function(e) { e.preventDefault(); });
$('.noDirectInput').keypress(function(e) { e.preventDefault(); });
$('.noDirectInput').focusout(function(e) {
var target = $(e.currentTarget);
var form_group = target.closest('.form-group');
var help_block = form_group.find('.with-errors');
help_block.empty();
help_block.removeClass('has-halieus-error');
});
$('#form').validator().on('invalid.bs.validator', function (e) {
console.log("INVALID");
console.log(e);
}).on('valid.bs.validator', function (e) {
console.log("VALID");
console.log(e);
});

245
views/edit_event_main.jade Normal file
View File

@@ -0,0 +1,245 @@
include mixins
include mixins_pentryedit
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; font-size: 80%;") Name
th
span(style="color: grey; font-size: 80%;") Signum
th
tbody
each loc in the_locations
tr(id="#{loc.uid}", data-uid="#{loc.uid}")
td(width="70%") #{loc.name}
td(widht="20%") #{loc.sign}
td(align="right", style="white-space: nowrap;")
if loc.id === "other"
span( class="glyphicon glyphicon-edit"
aria-hidden="true",
style="color: blue; cursor: pointer;",
onclick="save_and_goto('edit_location', {'location': '#{loc.uid}'});")
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 : "");
- var parent_event_start = (is_thereafter ? event.parent_start : "");
form(class="form-horizontal subroot", role="form", id="form", method="POST", action="#{event_href}/commit")
.new_flex_zero
.container-fluid(style="margin-bottom: 20px;")
input(type="hidden", name="pcalview", value="#{pcalview}")
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
if ! is_thereafter
.form-group
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('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.
$("#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-when_end_then_start="bar",
data-when_end_then_start-error="Wenn Sie ein Ende angeben, müssen Sie auch einen Beginn angeben!",
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", checked=event.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"));
});
.row
div(class="col-xs-12 col-sm-6", style="margin-bottom: 20px;")
fieldset(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('add_predefined_location', {});")
+dropdown_button_element_href("Manuell", "javascript: save_and_goto('add_location', {});")
+location_list(event.locations)
#messageview_locations
if messages.locations.length > 0
+messageview(messages.locations)
fieldset(class="col-xs-12 col-sm-6", id="involved")
legend(style="font-size: 150%;") Beteiligte
div(class="col-sm-12", style="padding-right: 0px;")
fieldset
+involved_list_label("Allgemein", "font-size: 130%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(event.involved, "Allgemein", "")
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)
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('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
div(class="col-sm-12", style="padding-right: 0px; margin-top: 5px;")
fieldset(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)
div(id="messageview_involved_" + role.uid)
if messages.involved[role.uid] && messages.involved[role.uid].length > 0
+messageview(messages.involved[role.uid])
.row
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}
.row
fieldset(class="col-sm-12", style="margin-top: 20px; padding-bottom: 200px;")
legend(style="font-size: 150%") Anmerkungen
textarea(class="form-control", rows="5", id="area_annotations", name="area_annotations").
#{event.annotations}
script.
$('.noEnterSubmit').keypress(function(e){
if ( e.which == 13 ) e.preventDefault();
});
$('#form').validator({
custom: {
end_after_start: function(el)
{
var start = "";
console.log(#{is_thereafter})
if(#{is_thereafter})
start = "#{parent_event_start}";
else
start = $('#edit_begin').val();
var end = $('#edit_end').val();
console.log(start);
console.log(end);
if(end.length === 0)
return;
if (Date.parse("2015-08-31T"+end) <= Date.parse("2015-08-31T"+start))
return "Das Ende des Ereignisses muss nach dessen Beginn liegen!";
},
when_end_then_start: function(el)
{
if(#{is_thereafter})
return;
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 "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);
});

View File

@@ -0,0 +1,73 @@
include mixins
form(class="form-horizontal subroot", role="form", id="form", method="POST", action="#{keep_in_mind_href}/commit")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{keep_in_mind.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{keep_in_mind.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Kurzbeschreibung
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{keep_in_mind.name}", required)
.help-block.with-errors
.row
fieldset(class="col-sm-12", style="margin-top: 20px; padding-bottom: 200px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{keep_in_mind.description}
script.
$('.noEnterSubmit').keydown(function(e){
if ( e.which == 13 ) e.preventDefault();
});
$('.noDirectInput').keydown(function(e) {
var target = $(e.currentTarget);
var form_group = target.closest('.form-group');
var help_block = form_group.find('.with-errors');
if(! form_group.hasClass('has-error'))
{
target.closest('.form-group').addClass('has-error');
}
if(! help_block.hasClass('has-halieus-error')) {
help_block.addClass('has-halieus-error');
help_block.append("<ul class='list-unstyled'><li>Sie müssen den 'Ändern'-Button benutzen!</li></ul>");
}
e.preventDefault();
});
$('.noDirectInput').keyup(function(e) { e.preventDefault(); });
$('.noDirectInput').keypress(function(e) { e.preventDefault(); });
$('.noDirectInput').focusout(function(e) {
var target = $(e.currentTarget);
var form_group = target.closest('.form-group');
var help_block = form_group.find('.with-errors');
help_block.empty();
help_block.removeClass('has-halieus-error');
});
$('#form').validator().on('invalid.bs.validator', function (e) {
console.log("INVALID");
console.log(e);
}).on('valid.bs.validator', function (e) {
console.log("VALID");
console.log(e);
});

56
views/edit_todo_main.jade Normal file
View File

@@ -0,0 +1,56 @@
include mixins
include mixins_pentryedit
form(class="form-horizontal subroot", role="form", id="form", method="POST", action="#{todo_href}/commit")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{todo.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{todo.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Kurzbeschreibung
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{todo.name}", required)
.help-block.with-errors
.row
fieldset(class="col-sm-12", style="margin-top: 10px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{todo.description}
.row(style="margin-bottom: 75px;")
div(class="col-sm-12", style="margin-top: 20px;", id="involved")
fieldset
+involved_list_label("Beteiligte", "font-size: 150%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(todo.involved, "Beteiligte", "")
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)
script.
$('.noEnterSubmit').keypress(function(e){
if ( e.which == 13 ) e.prtodoDefault();
});
$('#form').validator().on('invalid.bs.validator', function (e) {
console.log("INVALID");
console.log(e);
}).on('valid.bs.validator', function (e) {
console.log("VALID");
console.log(e);
});

View File

@@ -0,0 +1,63 @@
include mixins
include mixins_pentryedit
form(class="form-horizontal subroot", role="form", id="form", method="POST", action="#{vehicle_use_href}/commit")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
button(class="btn btn-success btn-xs", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{vehicle_use.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{vehicle_use.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='combo_vehicle', class="col-sm-2 control-label") Typ
.col-sm-10
select(id='combo_vehicle', name="combo_vehicle", class="form-control")
each v in vehicles
option(value="#{v.id}") <b>#{v.name}</b> (#{v.pretty.unit})
script.
$("#combo_vehicle").val("#{vehicle_use.vehicle_id}")
.form-group
label(for='edit_name', class="col-sm-2 control-label") Kurzbeschreibung
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{vehicle_use.name}", required)
.help-block.with-errors
.row
fieldset(class="col-sm-12", style="margin-top: 10px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{vehicle_use.description}
.row(style="margin-bottom: 75px;")
div(class="col-sm-12", style="margin-top: 20px;", id="involved")
fieldset
+involved_list_label("Beteiligte", "font-size: 150%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(vehicle_use.involved, "Beteiligte", "")
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)
script.
$('.noEnterSubmit').keypress(function(e){
if ( e.which == 13 ) e.prvehicle_useDefault();
});
$('#form').validator().on('invalid.bs.validator', function (e) {
console.log("INVALID");
console.log(e);
}).on('valid.bs.validator', function (e) {
console.log("VALID");
console.log(e);
});

238
views/email.jade Normal file
View File

@@ -0,0 +1,238 @@
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='/javascripts/pfiswebsocket.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;")
.root
.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", style="color: red;", 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, "history.pushState({direction: 'emailchooser'}, document.title, location.pathname); $('#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", style="margin-top: 5px;")
legend(style="font-size: 120%; margin-bottom: 0px;") Nachricht
textarea#bodyeditor
fieldset(style="margin-top: 5px;")
legend(style="font-size: 120%; margin-bottom: 0px;") Anhänge
span(style="font-size: 65%; margin-left: 2px;") Zum Hinzufügen auf den Button unten klicken!
#attachments_parent
p <i>Keine Anhänge vorhanden.</i>
//- 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}")
input(type="file", id="fileupload", style="margin-top: 0px;")
p#upload_pending_indicator(style='display: none; text-style: italic;') Datei wird hochgeladen...
//- button#fileuploadbutton(type="button", class="btn btn-default btn-xs", onclick="do_fileupload();", disabled) Datei hochladen
script.
$("#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 ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
$("#fileupload").on('change', function(e){
var files=$("#fileupload").prop('files');
/*if(files.length === 0)
$("#fileuploadbutton").prop('disabled', true);
else
$("#fileuploadbutton").prop('disabled', false);*/
do_fileupload();
});
function do_fileupload() {
var files=$("#fileupload").prop('files');
if(files.length === 0)
return;
console.log(files);
console.log(files.length);
$("#upload_pending_indicator").show();
// $("#fileuploadbutton").prop('disabled', true);
for (var i = 0, numFiles = files.length; i < numFiles; i++) {
var file = files[i];
console.log(file.name);
console.log(file.size);
console.log(file.type);
var reader = new FileReader();
reader.onload = (function(aFile) { return function(e) {
var data = {
name : aFile.name,
size : aFile.size,
type : aFile.type,
content : e.target.result,
uid : generateUID()
};
ws.send('fileupload', data);
}})(file);
reader.readAsDataURL(file);
}
$("#fileupload").val('');
}
ws.bind('fileupload_result', function(data) { console.log(data); add_attachment(data)});
function add_attachment(file) {
var the_table = $("#attachments");
if(the_table.length === 0) {
$("#attachments_parent").empty();
// <thead><tr><td width='75%'><span style='color: grey; font-size: 80%;'>Name</span></td><td width='20%'><span style='color: grey; font-size: 80%;'>Typ</span></td><td width='5%'></td></tr></thead>
$("#attachments_parent").append("<table width='100%' class='table table-condensed' style='margin-bottom: 0px;' id='attachments'></table>");
the_table = $("#attachments");
}
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="Anhang", data-delete-name="' + file.name + '"></span>';
// width='90%'
the_table.append("<tr id='" + file.uid + "'><td><p style='margin-bottom: 0px;'>" + file.name + "</p><p class='parishdbelemspane_elem_kontext', style='font-size: 80%;'>(" + file.type + ")</p></td><td width='5%'>" + the_delete + "</td></tr>");
$("#upload_pending_indicator").hide();
}
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'})
};
ws.send('email_send', data);
});
$("#sendEmail").on('hidden.bs.modal', function(e) {
is_sending = false;
$("#button_summary_back").show();
$("#button_summary_send").show();
});
ws.bind('email_send_result', function(result) {
console.log('RESULT', result);
$("#sendEmail_message").html(result.message);
$("#sendEmail_explanation").html(result.explanation);
$("#sendEmail_closebutton").show();
});
history.pushState ({direction: 'main'}, document.title, location.pathname);
window.addEventListener("popstate", function(e) {
if(e.state !== null) {
console.log(e.state);
if(e.state.direction === 'main')
$('#emailaddresschooser').hide();
else if(e.state.direction === 'emailchooser')
$('#emailaddresschooser').show();
}
}, 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();
}
});

View File

@@ -0,0 +1,10 @@
include mixins
include mixins_email
+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)

6
views/error.jade Normal file
View File

@@ -0,0 +1,6 @@
extends layout
block content
h1= message
h2= error.status
pre #{error.stack}

3
views/error_inlay.jade Normal file
View File

@@ -0,0 +1,3 @@
h1= message
h2= error.name
pre #{error.stack}

24
views/errorview.jade Normal file
View File

@@ -0,0 +1,24 @@
include mixins
doctype html
html
include header
body(style="overflow: hidden;")
.root(style="overflow: hidden;")
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid
h4 Beim Bearbeiten Ihrer Anfrage sind Fehler aufgetreten!
each message in messages
div(class=["alert", "alert-" + message.type], role="alert")
strong #{message.title}
span
span #{message.message}
p.
Sie können versuchen, einfach <a href="javascript: location.reload()">diese Seite neu zu laden</a>, auf die <a href="/">Startseite</a> zurückzukommen oder sich neu
<a href="/login">einzuloggen</a>.

View File

@@ -0,0 +1,20 @@
include mixins
- var add_class = is_error ? "" : "alert-dismissible";
if is_error === true
h4 Beim Bearbeiten Ihrer Anfrage sind Fehler aufgetreten!
each message in messages
div(class=["alert", "alert-" + message.type, add_class], role="alert")
if is_error === false
button(type="button", class="close", data-dismiss="alert", aria-label="Close")
span(aria-hidden="true") &times;
strong #{message.title}
span
span #{message.message}
if session_ended === true
p.
Sie können versuchen, einfach <a href="javascript: location.reload()">diese Seite neu zu laden</a>, auf die <a href="/">Startseite</a> zurückzukommen oder sich neu
<a href="/login">einzuloggen</a>.

187
views/event_details.jade Normal file
View File

@@ -0,0 +1,187 @@
include mixins
include mixins_day
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")
body(style="overflow: hidden;")
.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")
.container-fluid
button(class="btn btn-success btn-xs", onclick="location.assign('/day/#{date}?back=false');", style="margin-bottom: 5px;")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Zurück
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
+pevent_with_thereafter(date, event, { details: true, links: true, clickable: false, pcalview: "day"} )
script.
$('#confirmDelete').on('show.bs.modal', function (e) {
$etype = $(e.relatedTarget).attr('data-event-type');
$ename = $(e.relatedTarget).attr('data-event-name');
$(this).find('.modal-body p').text("Sind Sie sicher, dass Sie das " + $etype + " \"" + $ename + "\" löschen wollen?");
$(this).find('.modal-footer #confirm').data('button', $(e.relatedTarget));
});
/*history.pushState(null, null, location.href);
window.onpopstate = function(event) {
history.go(1);
};*/
var sockets = io.connect();
var delete_button = {};
$('#confirmDelete').find('.modal-footer #confirm').on('click', function() {
delete_button = $(this).data('button');
console.log(delete_button);
$etype = delete_button.attr('data-event-type');
if($etype === "Ereignis") {
var form = delete_button.closest("form");
form.submit();
return;
}
var date = delete_button.data('date');
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 });
});
sockets.on('tevent_delete_result', function(data) {
console.log(data);
if(data.result === "OK") {
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');
});
var updown_button = {};
var updown_direction = "";
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'); */
});
do_tevent_move_updown = function(button, date, event, tevent, updown) {
updown_button = button;
updown_direction = updown;
/* $('body').loading(); */
sockets.emit('tevent_move_updown', { date: date, event: event, tevent: tevent, updown: updown });
}
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("/day/#{date}?back=false");
},0);
}
}, false);

View File

@@ -0,0 +1,443 @@
include mixins
- var parent_event_uuid = (pentrytype === "tevent" ? parent_event.uuid : "");
- var pentryfunction = (pentrytype === "tevent" ? "event" : pentrytype);
- var generateUID = function() { return "a"+("000000" + (Math.random()*Math.pow(36,6) << 0).toString(36)).slice(-6) };
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/typeahead.jquery.min.js")
link(href="/stylesheets/mytypeahead.css", rel="stylesheet")
script(src="/javascripts/validator.min.js")
link(href="/stylesheets/style_day.css", rel="stylesheet")
style.
.panel { margin-bottom: 5px; }
.panel-title { cursor: pointer; }
//- .panel_group_and_unit { border-width: 3px; }
body
.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_with_form("PfarrInfoSystem", "PfIS", "entryeditnav")
.container-fluid
h1 #{pentrytype_pretty} #{edit_type}
.small #{date.weekday_short}, #{date.day}. #{date.month} #{date.year}
.subroot(style="height: 100%;")
.container-fluid
p Lade Kalendereintrag ...
script.
var scroll_top = 0;
var scroll_top_body = 0;
$('.noEnterSubmit').keypress(function(e){
if ( e.which == 13 ) e.preventDefault();
});
$("#entryeditnav-form").on('submit', function(e){
console.log('FILTER SUBMIT');
e.preventDefault();
});
function get_compiled_message(type, headline, message) {
return '<div class="alert alert-' + type + '" role="alert"><strong>'+ headline +'</strong> ' + message + '</div>';
};
var sockets = io.connect();
function compile_data_for_socketio(custom) {
var data = {
pentrytype : "#{pentrytype}",
day: "#{date.date}",
pentry: "#{pentry.uuid}",
pcalview : "#{pcalview}",
data : custom
};
if("#{pentrytype}" === "tevent") {
data.parent_event = "#{parent_event_uuid}";
}
return data;
}
function goto_mainpage() {
$('body').loading();
console.log("#{pentryfunction}");
sockets.emit("get_rendered_#{pentryfunction}", compile_data_for_socketio({}));
}
$(document).ready(function(){
goto_mainpage();
console.log('NOW EMITTING');
});
function set_pastoralunit(data) {
$('body').loading();
sockets.emit('pentry_set_pastoralunit', compile_data_for_socketio({punit: data}));
}
function add_location(data) {
$('body').loading();
sockets.emit('pentry_add_location', compile_data_for_socketio({location: data}));
}
function edit_location(data) {
$('body').loading();
sockets.emit('pentry_edit_location', compile_data_for_socketio({location: data}));
}
function add_involved(data) {
$('body').loading();
sockets.emit('pentry_add_involved', compile_data_for_socketio({involved: data}));
}
function edit_involved(data) {
$('body').loading();
sockets.emit('pentry_edit_involved', compile_data_for_socketio({involved: data}));
}
function add_role(data) {
$('body').loading();
sockets.emit('event_add_role', compile_data_for_socketio({role: data}));
};
function edit_role(data) {
$('body').loading();
sockets.emit('event_edit_role', compile_data_for_socketio({role: data}));
};
sockets.on('get_rendered_pentry_result', function(data) {
console.log('get_rendered_pentry_result');
history.replaceState({direction: 'back'}, document.title, location.pathname);
history.pushState({direction: 'mainpage'}, document.title, location.pathname);
$("#entryeditnav-form").empty();
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$(".subroot > .new_flex_one").scrollTop(scroll_top);
$("html, body").scrollTop(scroll_top_body);
scroll_top = 0;
scroll_top_body = 0;
$('body').loading('stop');
});
$('#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');
sockets.emit('event_remove_role', compile_data_for_socketio({role: uid}));
}
else {
var tr = $(this).data('tr');
var uid = tr.data('uid');
if($etype === "Ort") {
sockets.emit('pentry_remove_location', compile_data_for_socketio({location: uid}));
}
else {
var role = tr.data('role');
sockets.emit('pentry_remove_involved', compile_data_for_socketio({role: role, involved: uid}));
}
}
});
sockets.on('pentry_remove_involved_result', function(data) {
if(data.result === "OK") {
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');
$('#messageview_involved_' + data.role).append(data.html);
});
sockets.on('pentry_remove_location_result', function(data) {
if(data.result === "OK") {
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');
$('#messageview_locations').append(data.html);
});
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_tevent() {
var event = {
uuid : "#{pentry.uuid}",
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()
};
return event;
}
function save_event() {
event = save_tevent();
event.start = $("#edit_begin").val();
return event;
}
function save_away() {
var away = {
uuid : "#{pentry.uuid}",
reason: $("#edit_reason").val()
};
return away;
}
function save_keep_in_mind() {
var keep_in_mind = {
uuid : "#{pentry.uuid}",
name : $("#edit_name").val(),
description: $("#area_description").val()
};
return keep_in_mind;
}
function save_todo() {
var todo = {
uuid : "#{pentry.uuid}",
name : $("#edit_name").val(),
description: $("#area_description").val()
};
return todo;
}
function save_vehicle_use() {
var vehicle_use = {
uuid : "#{pentry.uuid}",
name : $("#edit_name").val(),
description: $("#area_description").val(),
vehicle_id: $("#combo_vehicle").val()
};
return vehicle_use;
}
function save_and_goto(subpage, subpage_data) {
$('body').loading();
var data = {};
data["#{pentryfunction}"] = save_#{pentrytype}();
sockets.emit('#{pentryfunction}_save', compile_data_for_socketio(data));
console.log('subpage: ', subpage);
console.log('subbpage_data: ', subpage_data);
scroll_top = $(".subroot > .new_flex_one").scrollTop();
scroll_top_body = $("html, body").scrollTop();
switch(subpage) {
case "select_pastoralunit":
sockets.emit('render_pastoralunitselector', compile_data_for_socketio({}));
break;
case "add_predefined_location":
sockets.emit('render_locationselector', compile_data_for_socketio({}));
break;
case "add_location":
sockets.emit('render_locationeditor', compile_data_for_socketio({ type: "add" }));
break;
case "edit_location":
sockets.emit('render_locationeditor', compile_data_for_socketio({ type: "edit", location: subpage_data.location }));
break;
case "add_actor":
sockets.emit('render_actorselector', compile_data_for_socketio(subpage_data));
break;
case "add_role":
sockets.emit('render_roleeditor', compile_data_for_socketio({type: "add"}));
break;
case "edit_role":
sockets.emit('render_roleeditor', compile_data_for_socketio({type: "edit", role: subpage_data.role}));
break;
case "add_involved":
sockets.emit('render_involvededitor', compile_data_for_socketio({type: "add", role: subpage_data.role}));
break;
case "edit_involved":
sockets.emit('render_involvededitor', compile_data_for_socketio({type: "edit", role: subpage_data.role, involved: subpage_data.involved}));
break;
case "add_parishdbpersongroup":
sockets.emit('render_parishdbpersongroupselector', compile_data_for_socketio({role: subpage_data.role}));
break;
}
}
sockets.on('render_locationselector_result', function(data) {
console.log('got locationselector');
history.pushState({direction: 'locationselector'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
sockets.on('render_locationeditor_result', function(data) {
console.log('got locationeditor');
history.pushState({direction: 'locationeditor'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
sockets.on('render_pastoralunitselector_result', function(data) {
console.log('got pastoralunitsecelcotr');
history.pushState({direction: 'pastoralunitselector'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
sockets.on('render_actorselector_result', function(data) {
console.log('got actorselector');
history.pushState({direction: 'actorselector'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
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>");
}
/*function show_submitbutton(id, functioncall, extrahtml) {
console.log(functioncall);
$("#entryeditnav-form").append('<button style="display: inline-block;" class="btn btn-success disabled" type="button" id="'+id+'" ' + extrahtml + ' onclick="' + functioncall + '"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button>');
}*/
sockets.on('render_parishdbpersongroupselector_result', function(data) {
console.log('got parishdbpersongroupselector');
history.pushState({direction: 'parishdbpersongroupselector'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
sockets.on('render_involvededitor_result', function(data) {
console.log('got involvededitor');
history.pushState({direction: 'involvededitor'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
sockets.on('render_roleeditor_result', function(data) {
console.log('got roleeditor');
history.pushState({direction: 'roleeditor'}, document.title, location.pathname);
$(".root").children(".subroot").remove();
$(".root").append(data.html);
$("html, body").scrollTop(0);
$(".root").scrollTop(0);
$('body').loading('stop');
});
// HANDLE SIMPLE BACK
// history.replaceState({direction: 'back'}, document.title, location.pathname);
// history.pushState({direction: 'mainpage'}, document.title, location.pathname);
window.addEventListener("popstate", function(e) {
console.log(e.state);
if(e.state !== null) {
if(e.state.direction === "back") {
history.replaceState(null, document.title, location.pathname);
setTimeout(function(){
location.replace("#{pentry_href}/cancel?pcalview=#{pcalview}");
},0);
}
if(e.state.direction === "mainpage")
goto_mainpage();
}
}, false);

16
views/header.jade Normal file
View File

@@ -0,0 +1,16 @@
head
title PfarrInfoSystem
meta( charset='utf-8' )
meta( http-equiv='X-UA-Compatible', content='IE=edge' )
meta( name='viewport', content='width=device-width, initial-scale=1.0' )
meta( name='description', content='PfarrInfoSystem (C) Peter Fischer 2010-2018' )
//- Bootswatch Theme
//-link(href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css", rel="stylesheet")
//-link(href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css", rel="stylesheet")
link(href="/stylesheets/bootstrap.min.css", rel="stylesheet")
link(href="/stylesheets/bootstrap-theme.min.css", rel="stylesheet")
link(href="/stylesheets/style.css", rel="stylesheet")
//-script(src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js')
//-script(src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js")
script(src='/javascripts/jquery-3.1.0.min.js')
script(src="/javascripts/bootstrap.min.js")

View File

@@ -0,0 +1,162 @@
include mixins
form.form-horizontal.subroot#form-involvededitor
.new_flex_zero(style="padding-bottom: 20px;")
.container-fluid
h4 Beteiligten aus manuellen Angaben hinzufügen
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
.new_flex_one(style="padding-bottom: 200px;")
.container-fluid
.form-group
label(for='edit_group', class="col-sm-2 control-label") Gruppe
.col-sm-10
input(id='edit_group', type="text", class="form-control noEnterSubmit", value="#{involved.group}")
.help-block.with-errors
.form-group
label(for='edit_surname', class="col-sm-2 control-label") Nachname
.col-sm-10
input(id='edit_surname', type="text", class="form-control noEnterSubmit", value="#{involved.surname}", required)
.help-block.with-errors
.form-group
label(for='edit_forename', class="col-sm-2 control-label") Vorname
.col-sm-10
input(id='edit_forename', type="text", class="form-control noEnterSubmit", value="#{involved.forename}")
.help-block.with-errors
.form-group
label(for='edit_street', class="col-sm-2 control-label") Straße
.col-sm-10
input(id='edit_street', type="text", class="form-control noEnterSubmit", value="#{involved.street}")
.help-block.with-errors
.form-group
label(for='edit_street_nr', class="col-sm-2 control-label") Hausnummer
.col-sm-3
input(id='edit_street_nr', type="text", class="form-control noEnterSubmit", value="#{involved.street_nr}")
.help-block.with-errors
.form-group
label(for='edit_postalcode', class="col-sm-2 control-label") Postleitzahl
.col-sm-3
input(id='edit_postalcode', type="text", class="form-control noEnterSubmit", value="#{involved.postalcode}")
.help-block.with-errors
.form-group
label(for='edit_location', class="col-sm-2 control-label") Ort
.col-sm-10
input(id='edit_location', type="text", class="form-control noEnterSubmit", value="#{involved.location}")
.help-block.with-errors
.form-group
label(for='edit_email', class="col-sm-2 control-label") eMail
.col-sm-10
input(id='edit_email', type="email", class="form-control noEnterSubmit", value="#{involved.email}")
.help-block.with-errors
.form-group
label(for='edit_telephonenumber', class="col-sm-2 control-label") Telefonnummer
.col-sm-10
input(id='edit_telephonenumber', type="tel", class="form-control noEnterSubmit", value="#{involved.telephonenumber}", required)
.help-block.with-errors
script.
var all_locations = [
{plz: "96050", loc: "Bamberg"},
{plz: "96450", loc: "Coburg"},
{plz: "96465", loc: "Neustadt bei Coburg"},
{plz: "96472", loc: "Rödental"},
{plz: "96487", loc: "Dörfles-Esbach"}
];
var locationMatcher = function(locations) {
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(locations, function(i, loc) {
console.log('location: ', loc);
if (substrRegex.test(loc.plz)) {
matches.push(loc);
}
});
cb(matches);
};
};
$("#edit_postalcode").typeahead({
hint: true,
highlight: true,
minLength: 2
},
{
name: 'locations',
source: locationMatcher(all_locations),
display: 'plz',
limit: 15
}).bind('typeahead:select typeahead:autocomplete', function(ev, suggestion) {
console.log(suggestion);
$("#edit_location").val(suggestion.loc);
});
// KEEP IN SYNC WITH involved.cpp 'construct_name'
function construct_involved_name(data) {
var group_given = data.group.length > 0;
return (group_given ? data.group + " [" : "") +
data.surname + (data.surname.length === 0 || data.forename.length === 0 ? "" : ", ") + data.forename +
(group_given ? "]" : "");
}
$('#form-involvededitor').validator().on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
e.preventDefault();
var data = {
for_role: "#{for_role}",
id : "other",
group : $("#edit_group").val(),
forename: $("#edit_forename").val(),
surname : $("#edit_surname").val(),
street : $("#edit_street").val(),
street_nr: $("#edit_street_nr").val(),
postalcode: $("#edit_postalcode").val(),
location: $("#edit_location").val(),
email: $("#edit_email").val(),
telephonenumber: $("#edit_telephonenumber").val()
};
data.name = construct_involved_name(data);
switch("#{type}") {
case "add":
pcal_pentry_edit_manager.add_involved(data);
break;
case "edit":
data.uid = "#{involved.uid}";
pcal_pentry_edit_manager.edit_involved(data);
break;
}
}
});

245
views/labelprinter.jade Normal file
View File

@@ -0,0 +1,245 @@
- var formats_string = JSON.stringify(data.formats);
include mixins
include mixins_labelprinter
doctype html
html
include header
script(src="/javascripts/validator.min.js")
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/labelprinter_nothandledlines.js')
script(src='/javascripts/runtime.js')
style.
.textarea_in_flex_one {
padding-bottom: 15px;
margin-left: 15px;
margin-right: 15px;
height: 100%;
}
@media only screen and (max-width: 768px) {
.textarea_in_flex_one {
height: 400px;
}
}
body
#meldeweseninput.sidewideoverlay(style="z-index: 5;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "meldeweseninput_menu")
.container-fluid
h1 Etiketten erstellen
.small Adressen eingeben
p Bitte kopieren Sie in das Textfeld unten alle Zeilen aus dem Meldewesen
nav
ul.pager
li.previous
span(onclick="$('#meldeweseninput').hide(); $('html, body').scrollTop(0);") Zurück
li.next#button_proceed_meldeweseninput
span(onclick="proceed_meldeweseninput();") Weiter
div(style="flex: 1; display: flex;")
.textarea_in_flex_one(style="flex: 1;")
textarea#meldeweseninputpane(style="width: 100%; height: 100%; resize: none;", oninput="meldeweseninputpane_change();").
!{data.meldeweseninput}
#meldewesenproceeded.sidewideoverlay(style="z-index: 10;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "meldewesenproceeded_menu")
.container-fluid
h1 Etiketten erstellen
.small Daten überprüfen
p Bitte überprüfen Sie unten stehende Daten - dass keine Zeile übersprungen wurde, die nicht hätte übersprungen werden dürfen
nav
ul.pager
li.previous
span(onclick="$('#meldeweseninput').show(); $('#meldewesenproceeded').hide(); $('html, body').scrollTop(0);") Zurück
li.next
span(onclick="generate_labels();") Etiketten erstellen
.new_flex_one
.container-fluid
#meldewesenproceededpane
#labelspanel.sidewideoverlay(style="z-index: 15;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "cardpanel_menu")
.container-fluid
h1 Etiketten erstellen
.small Etiketten herunterladen
p#labelspanel_downloadhint(style="display: none;") Sie können nun die erstellten Etiketten herunterladen
nav
ul.pager
li.previous
span#labelspanel_backbutton Zurück
li.next.disabled
span Weiter
.new_flex_one
.container-fluid
a#labelspanel_link_labels(href="/labelprinter/#{taskuuid}/download/labels.pdf", target="_blank", style="margin-right: 15px; display: none;")
img(src="/images/mail-read-32.png", style="margin-right: 2px;")
span Etiketten
a#labelspanel_link_postmen(href="/labelprinter/#{taskuuid}/download/postmen.html", target="_blank", style="margin-right: 15px; display: none;")
img(src="/images/mail-unread-32.png", style="margin-right: 2px;")
span Austräger-zu-ID-Tabelle
.modal.fade(id="proceedMeldewesenInputDialog", role="dialog", aria-labelledby="proceedMeldewesenInputDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="proceedMeldewesenInputDialogLabel") Meldewesendaten verarbeiten
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Daten aus dem Meldewesen verarbeitet werden ...
.modal.fade(id="generateLabelsDialog", role="dialog", aria-labelledby="generateLabelsDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="generateLabelsDialogLabel") Etiketten erstellen
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Etiketten erstellt werden:
p(style="font-weigth: bold") Etiketten ...
.progress
#progress_labels.progress-bar(role="progressbar", aria-valuenow="0", aria-valuemin="0", aria-valuemax="100", style="width: 0%;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Etiketten erstellen
.small Grundeinstellungen
p Bitte wählen Sie Pfarrei, Etiketten-Format und weitere Einstellungen
nav
ul.pager
li.previous.disabled
span Zurück
li.next
span(onclick="save_settings();") Weiter
.new_flex_one
.container-fluid
+labelprinter_settings(data.parishes, data.parishid, data.formats, data.formatid, data.last_field_is_postman, data.generate_detailed_postmeninfo)
script.
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
var formats = !{formats_string};
function save_settings() {
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedFormat = $("#combo_format").prop('selectedIndex');
var last_field_is_postman = $("#check_last_field_is_postman").prop('checked');
var generate_detailed_postmeninfo = $('#check_generate_detailed_postmeninfo').prop('checked');
ws.send('save_settings', {parishid: selectedParish, formatid: selectedFormat, last_field_is_postman: last_field_is_postman, generate_detailed_postmeninfo: generate_detailed_postmeninfo});
}
ws.bind('save_settings_result', function(data) {
if(data.result === "ERROR") {
alert(data.message);
return;
}
$("#meldeweseninput").show();
$('html, body').scrollTop(0);
});
function meldeweseninputpane_change() {
if($("#meldeweseninputpane").val()==="")
$("#button_proceed_meldeweseninput").addClass('disabled');
else
$("#button_proceed_meldeweseninput").removeClass('disabled');
}
meldeweseninputpane_change();
function proceed_meldeweseninput() {
if($("#button_proceed_meldeweseninput").hasClass("disabled"))
return;
$('#proceedMeldewesenInputDialog').modal({
backdrop: 'static',
keyboard: false
});
ws.send('proceed_meldeweseninput', {input: $("#meldeweseninputpane").val()});
}
ws.bind('proceed_meldeweseninput_result', function(data) {
console.log(data);
$('#proceedMeldewesenInputDialog').modal('hide');
if(data.result === "ERROR") {
alert(data.message);
return;
}
var html = labelprinter_nothandledlines_template(data);
$("#meldewesenproceededpane").empty();
$("#meldewesenproceededpane").html(html);
$("#meldewesenproceeded").show();
$("#meldeweseninput").hide();
$("#meldewesenproceededpane").parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
});
function labelspanel_go_back_to_meldewesenproceeded() {
$('#meldewesenproceeded').show();
$('#labelspanel').hide();
$('#meldewesenproceededpane').parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
}
function generate_labels() {
$("#meldewesenproceeded").hide();
$("#labelspanel_link_labels").hide();
$("#labelspanel_link_postmen").hide();
$("#labelspanel_downloadhint").hide();
$("#labelspanel").show();
$('html, body').scrollTop(0);
$("#progress_labels").prop("aria-valuenow", 0);
$("#progress_labels").css("width", "0%");
$("#progress_labels").html("0%");
$('#generateLabelsDialog').modal({
backdrop: 'static',
keyboard: false
});
$("#labelspanel_backbutton").off('click');
$("#labelspanel_backbutton").on('click', labelspanel_go_back_to_meldewesenproceeded);
ws.send('generate_labels', {});
}
ws.bind('generate_labels_progress', function(data) {
console.log(data);
var percent = Math.round(data.generated * 100 / data.total) ;
console.log(percent);
$("#progress_labels").prop("aria-valuenow", percent);
$("#progress_labels").css("width", percent +"%");
$("#progress_labels").html(percent +"%");
});
ws.bind('generate_labels_result', function(data) {
console.log('generate_labels_result');
$("#generateLabelsDialog").modal('hide');
if(data.result === "ERROR") {
alert(data.message);
return;
}
$("#labelspanel_downloadhint").show();
$("#labelspanel_link_labels").show();
if(data.have_postmeninfo)
$("#labelspanel_link_postmen").show();
else
$("#labelspanel_link_postmen").hide();
});

View File

@@ -0,0 +1,3 @@
include mixins_labelprinter
+labelprinter_omitted_lines(omitted_lines)

7
views/layout.jade Normal file
View File

@@ -0,0 +1,7 @@
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content

View File

@@ -0,0 +1,64 @@
include mixins
form(class="form-horizontal subroot", id="form-locationeditor")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
h4 Ort aus manuellen Angaben hinzufügen
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
.new_flex_one
.container-fluid
.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", value="#{location.name}", required)
.help-block.with-errors
.form-group
label(for='edit_sign', class="col-sm-2 control-label") Signum
.col-sm-2
input(id='edit_sign', type="text", class="form-control noEnterSubmit", maxlength="5", value="#{location.sign}")
.help-block.with-errors
script.
/*show_submitbutton("submit-btn-locationeditor", "$('#form-locationeditor').submit();","");
function update_submitbutton() {
console.log($("#submit_button").hasClass('disabled'));
$("#submit-btn-locationeditor").toggleClass('disabled', $("#submit_button").hasClass('disabled'));
}*/
$('#form-locationeditor').validator().on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
e.preventDefault();
var data = {
id : "other",
name : $("#edit_name").val(),
sign : $("#edit_sign").val(),
uid : "#{location.uid}"
};
pcal_pentry_edit_manager.#{type}_location(data);
}
});/*.on('validated.bs.validator', function(e) {
console.log('validated');
update_submitbutton();
});
update_submitbutton();*/

View File

@@ -0,0 +1,175 @@
include mixins
mixin do_location(location)
- var my_class;
- actual_location_id === location.id ? my_class = "panel-success" : my_class="panel-default";
.panel(class=my_class, id=location.id, data-locationname=location.name, data-locationsign=location.sign, data-location="")
.panel-heading(onclick="select_location('#{location.id}');")
h4.panel-title
table(width="100%")
tr
td(style="width: 80%;")
span(style=style_text) #{location.name}
td
span(style=style_text) #{location.sign}
mixin do_city(city)
- var my_uid = generateUID();
.panel.panel-primary.panel_group_and_unit(id=my_uid, data-elemname=city.name, data-parishdb="", data-elemtype="city")
.panel-heading
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{city.name}
//- border-bottom: 2px solid #{elem.color};
.panel-collapse.collapse(id="PANEL_"+my_uid)
.panel-body(style="padding: 10px; "+my_border_top_color)
each location in city.locations
+do_location(location)
mixin do_unit(unit)
- var my_uid = generateUID();
- var my_border_color = unit.is_pastoral ? "border-color: "+ unit.color +"; " : "";
- var my_background_image = unit.is_pastoral ? "background-image: linear-gradient(to bottom,"+unit.color+" 50%, #ffffff 100%); border-color: #ffffff; background-color: #ffffff; border-top-left-radius: 0px; border-top-right-radius: 0px;" : "";
- var my_border_top_color = unit.is_pastoral ? "border-top-color: #ffffff;" : "";
- var in_class = unit.subunits.length > 0 ? "in" : "";
.panel.panel-default.panel_group_and_unit(id=my_uid, data-elemname=unit.name, data-parishdb="", data-dn=unit.dn, data-elemtype="unit", data-depth=unit.depth, style=my_border_color )
.panel-heading(style=my_background_image)
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{unit.name}
//- border-bottom: 2px solid #{elem.color};
.panel-collapse.collapse(class=in_class, id="PANEL_"+my_uid)
.panel-body(style="padding: 10px; "+my_border_top_color)
if unit.cities.length > 0
//- ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
//- each location in unit.locations
//- +do_location(location)
each city in unit.cities
+do_city(city)
if unit.subunits.length > 0
//- ul(class="list-group", style="margin-left: 12px; margin-bottom: 0px;")
each sub in unit.subunits
+do_unit(sub)
.subroot
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
h4 Ort aus der Liste hinzufügen
script.
function set_visibility_according_to_filter(substrRegex, elems) {
var units_are_shown = false;
if(!units_are_shown) {
$("[data-elemtype='unit'],[data-elemtype='city']").each(function(index) {
var panel_id = "#PANEL_" + $(this).prop('id');
$(panel_id).collapse('show');
});
console.log('SHOW ALL UNITS');
units_are_shown = true;
}
var actual_id = $("#actual_location_id").val();
elems.each(function(index) {
my_panel = $(this);
var txt = my_panel.data("locationname");
var id = my_panel.prop('id');
if(substrRegex.test(txt)) {
my_panel.show();
if(actual_id === id) {
$("#submit_button").prop('disabled', false);
$("#errorpane").empty();
}
}
else {
my_panel.hide();
if(actual_id === id) {
$("#submit_button").prop('disabled', true);
$("#errorpane").html(get_compiled_message("danger", "Auswahl ungültig", "Durch die Filterangabe wurde Ihre Auswahl ungültig!"));
}
}
});
}
function adjust_visible_locations(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-location]"));
}
form(class="form-horizontal" method="POST", action="#{pentry_edit_base}/add_predefined_location", id="form-locationselector")
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-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
p.small(style="margin-top: 7px; margin-bottom: 0px; font-weight: bold;") Aktuell ausgewählt
p(style="font-size: 100%; font-weight: bold; margin-bottom: 0px;")
span#actual_name -
#errorpane
.new_flex_one(style="padding-bottom: 200px;")
.container-fluid
//- ul(class="list-group")
for unit in units
+do_unit(unit)
script.
pcal_pentry_edit_manager.show_searchbar("adjust_visible_locations(this);");
if("#{actual_location_id}" === "")
$("#submit_button").prop('disabled', true);
select_location = function(location_id)
{
console.log("SELECTED: " + location_id)
actual_id = $("#actual_location_id").val();
if(actual_id === location_id)
{
console.log("NOTHIN CHANGED");
return;
}
if(actual_id !== '')
$("#" + actual_id).closest('.panel').removeClass('panel-success').addClass('panel-default');
var new_panel = $("#" + location_id).closest('.panel');
new_panel.removeClass('panel-default').addClass('panel-success');
$("#actual_location_id").val(location_id);
var locname = $("#"+location_id).data("locationname");
var locsign = $("#"+location_id).data("locationsign");
$("#actual_location_name").val(locname);
$("#actual_location_sign").val(locsign);
if(locsign != "")
locname = locname + " (" + locsign + ")";
$("#actual_name").text(locname);
$("#errorpane").empty();
$("#submit_button").prop('disabled', false);
}
$("#form-locationselector").on('submit', function(e) {
var data = {
name : $("#actual_location_name").val(),
sign : $("#actual_location_sign").val(),
id : $("#actual_location_id").val()
};
pcal_pentry_edit_manager.add_location(data);
e.preventDefault();
});

28
views/login.jade Normal file
View File

@@ -0,0 +1,28 @@
doctype strict
html
head
link(rel='stylesheet', href='/stylesheets/style.css')
link(href="/stylesheets/bootstrap.min.css", rel="stylesheet")
link(href="/stylesheets/bootstrap-theme.min.css", rel="stylesheet")
body
form.form-horizontal(method="post", action="/login", role="form", style="margin-top: 15px;")
.form-group
label.col-sm-1.control-label(for="ID1") ID1
.col-sm-5
input.form-control(type="text", name="ID1", id="ID1")
.form-group
label.col-sm-1.control-label(for="ID2") ID2
.col-sm-5
input.form-control(type="password", name="ID2", id="ID2")
.form-group
label.col-sm-1.control-label(for="ID3") ID3
.col-sm-5
input.form-control(type="password", name="ID3", id="ID3")
.from-group
.col-sm-1
button.btn.btn-success.btn-sm(type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span OK

View File

@@ -0,0 +1,9 @@
include mixins
each message in messages
div(class=["alert", "alert-dismissible", "alert-" + message.type], role="alert")
button(type="button", class="close", data-dismiss="alert", aria-label="Close")
span(aria-hidden="true") &times;
strong #{message.title}
span
span #{message.message}

165
views/mixins.jade Normal file
View File

@@ -0,0 +1,165 @@
//- Navbar mixins
mixin nav_bare(name, style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar", "navbar-" + style] )
.navbar-header
a.navbar-brand(href="#")= name
ul.nav.navbar-nav
block
mixin nav_main(name, id, style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar", "navbar-" + style] )
.container-fluid
.navbar-header
button.navbar-toggle.collapsed( type="button", data-toggle="collapse", data-target="#" + id, aria-expanded="false", aria-controls="navbar")
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href="#")= name
.collapse.navbar-collapse( id=id )
block
mixin nav_main_collapse()
ul.nav.navbar-nav(onclick="$(this).closest('.collapse').collapse('hide');")
block
mixin nav_main_dropdown_right(name)
ul.nav.navbar-nav.navbar-right
li.dropdown
a.dropdown-toggle( href="#", data-toggle="dropdown", role="button", aria-expanded="false" )= name
span.caret
ul.dropdown-menu( role="menu" )
block
mixin nav_main_primary(viewformat, date)
+nav_main("PfarrInfoSystem", "nav_main_primary")
+nav_main_collapse()
if viewformat === "day"
+nav_item( "#", "active" ) Tag
+nav_item( "javascript: set_viewformat('timeline', '" + date +"');") TagZeitleiste
+nav_item( "javascript: set_viewformat('pastoralteam', '" + date +"');") Pastoralteam
+nav_item( "javascript: set_viewformat('pfarreientimeline', '" + date +"');") Pfarreien
+nav_item( "/week/" + date) Woche
else if viewformat === "timeline"
+nav_item( "javascript: set_viewformat('day', '" + date +"');") Tag
+nav_item( "#", "active" ) TagZeitleiste
+nav_item( "javascript: set_viewformat('pastoralteam', '" + date +"');") Pastoralteam
+nav_item( "javascript: set_viewformat('pfarreientimeline', '" + date +"');") Pfarreien
+nav_item( "/week/" + date) Woche
else if viewformat === "pastoralteam"
+nav_item( "javascript: set_viewformat('day', '" + date +"');") Tag
+nav_item( "javascript: set_viewformat('timeline', '" + date +"');") TagZeitleiste
+nav_item( "#", "active" ) Pastoralteam
+nav_item( "javascript: set_viewformat('pfarreientimeline', '" + date +"');") Pfarreien
+nav_item( "/week/" + date) Woche
else if viewformat === "pfarreientimeline"
+nav_item( "javascript: set_viewformat('day', '" + date +"');") Tag
+nav_item( "javascript: set_viewformat('timeline', '" + date +"');") TagZeitleiste
+nav_item( "javascript: set_viewformat('pastoralteam', '" + date +"');") Pastoralteam
+nav_item( "#", "active" ) Pfarreien
+nav_item( "/week/" + date) Woche
else
+nav_item( "/day/" + date ) Tag
+nav_item( "/timeline/" + date ) TagZeitleiste
+nav_item( "/pastoralteam/" + date ) Pastoralteam
+nav_item( "/pfarreientimeline/" + date) Pfarreien
+nav_item( "#", "active" ) Woche
+nav_main_dropdown_right("Extras")
+nav_item_new_window( "/parishdb" ) Pfarrdatenbank
+nav_item_new_window( "/volunteerslist" ) Ehrenamtlichenliste
+nav_divider
+nav_item_new_window( "/parishcalA4week/" + date)
#parishcalA4week A4-Wochenübersicht
+nav_divider
+nav_item( "/" + viewformat + "/"+date+"/select_punits_for_view" )
#select_punits_for_view Angezeigte Orte konfigurieren ...
+nav_divider
+nav_item( "/about" ) Über Pfis ...
mixin nav(name, id, style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar", "navbar-" + style] )
.container-fluid
.navbar-header
button.navbar-toggle.collapsed( type="button", data-toggle="collapse", data-target="#" + id, aria-expanded="false", aria-controls="navbar")
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href="#")= name
.collapse.navbar-collapse( id=id )
ul.nav.navbar-nav
block
mixin nav_with_form(name, shortname, id, style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar", "navbar-" + style] )
.container-fluid
.navbar-header
a.navbar-brand.hidden-xs(href="#")= name
a.navbar-brand.visible-xs(href="#")= shortname
form.form-inline.navbar-form.pull-left(id=id+"-form")
mixin nav_item(href, active)
li(class=active): a( href=href )
block
mixin nav_item_new_window(href, active)
li(class=active): a( href=href, target="_blank" )
block
mixin nav_item_dropdown(href, active)
li(class=["dropdown", active])
a.dropdown-toggle( href=href, data-toggle="dropdown", role="button", aria-expanded="false" )= attributes.label
span.caret
ul.dropdown-menu( role="menu" )
block
mixin nav_divider
li.divider
mixin nav_header
li.dropdown-header
block
//- End navbar mixins
mixin dropdown_button(name, id, menupos)
- var menupos_real = (typeof menupos === 'undefined') ? "left" : menupos
.dropdown(style="display: inline;")
button(class=["btn", "btn-default", "btn-xs", "dropdown-toggle"], type="button", id=id, data-toggle="dropdown", aria-haspopup="true", aria-expanded="false")
span #{name}
span
span(class="caret")
ul(class=["dropdown-menu", "dropdown-menu-" + menupos_real], aria-labelledby=id)
block
mixin dropdown_button_element_href(name, href)
li
a(href=href) #{name}
mixin messageview(messages)
each message in messages
div(class=["alert", "alert-dismissible", "alert-" + message.type], role="alert")
button(type="button", class="close", data-dismiss="alert", aria-label="Close")
span(aria-hidden="true") &times;
strong #{message.title}
span
span #{message.message}
mixin standard_delete_dialog(id)
.modal.fade(id=id, role="dialog", aria-labelledby=id+"Label", 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=id+"Label") 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

View File

@@ -0,0 +1,96 @@
mixin birthdaycards_settings(parishes, parishid, receivers, formats, formats_volunteers, formatid)
form(class="form-horizontal", role="form", id="form")
.form-group
label(for='combo_parish', class="col-sm-2 control-label") Pfarrei
.col-sm-10
select(id='combo_parish', class="form-control")
- var id=0;
- each parish in parishes
option(value="#{id}") #{parish.name}
- id++;
script.
$("#combo_parish").val("#{parishid}")
.form-group
label(for='combo_receivers', class="col-sm-2 control-label") Adressaten
.col-sm-10
select(id='combo_receivers', class="form-control", onchange="update_formats();")
option(value="0") Gläubige allgemein
option(value="1") Ehrenamtliche
script.
$("#combo_receivers").val("#{receivers}")
.form-group
label(for='combo_format', class="col-sm-2 control-label") Format
.col-sm-10
select(id='combo_format', class="form-control")
- var id=0;
- var real_formats = (receivers === 0 ? formats : formats_volunteers)
- each format in real_formats
option(value="#{id}") #{format}
- id++;
script.
$("#combo_format").val("#{formatid}")
mixin birthdaycards_persons(omitted_lines, persons, persons_with_information_lock, persons_omitted)
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px; color: orange;") Personen, die eine Karte bekommen sollten, aber eine Auskunfssperre haben
p Wählen Sie die Personen aus, die trotzdem eine Karte bekommen sollen!
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
thead
tr
td(width='25%') <b>Name</b>
td <b>Geburtstag</b>
td <b>Alter</b>
td <b>Straße</b>
td <b>Wohnort</b>
tbody
for p in persons_with_information_lock
- the_class = p.send_card ? 'send_card' : '';
tr(id="#{p.uuid}", class=[the_class], onclick="$(this).toggleClass('send_card');", style="cursor: pointer;")
td #{p.surname}, #{p.forename}
td #{p.birthday}
td #{p.age}
td #{p.street} #{p.streetnr}
td #{p.location}
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px; color: green;") Personen, die eine Karte bekommen
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
thead
tr
td(width='25%') <b>Name</b>
td <b>Geburtstag</b>
td <b>Alter</b>
td <b>Straße</b>
td <b>Wohnort</b>
tbody
for p in persons
tr
td #{p.surname}, #{p.forename}
td #{p.birthday}
td #{p.age}
td #{p.street} #{p.streetnr}
td #{p.location}
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px; color: red;") Personen, die KEINE Karte bekommen (nicht das 'richtige' Alter haben)
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
thead
tr
td(width='25%') <b>Name</b>
td <b>Geburtstag</b>
td <b>Alter</b>
td <b>Straße</b>
td <b>Wohnort</b>
tbody
for p in persons_omitted
tr
td #{p.surname}, #{p.forename}
td #{p.birthday}
td #{p.age}
td #{p.street} #{p.streetnr}
td #{p.location}
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px;") Übersprungene Zeilen
div(style="margin-left: 10px; background-color: lightgrey;")
p.
!{omitted_lines}

560
views/mixins_day.jade Normal file
View File

@@ -0,0 +1,560 @@
mixin daycontent(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
.new_flex_zero
.container-fluid(style="margin-bottom: 15px;")
#daycontrol_parent
+daycontrol(date, litinfo, last_week, yesterday, tomorrow, next_week)
+messageview(messages)
.new_flex_one
.container-fluid
.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";
//- "/event" + link
+dropdown_button_element_href("Ereignis", "javascript: pcal_pentry_edit_manager.start(\"event\", \"new\");")
+dropdown_button_element_href("Zu-Beachten", "javascript: pcal_pentry_edit_manager.start(\"keep_in_mind\", \"new\");")
+dropdown_button_element_href("Zu-Tun", "javascript: pcal_pentry_edit_manager.start(\"todo\", \"new\");")
+dropdown_button_element_href("Abwesenheit", "javascript: pcal_pentry_edit_manager.start(\"away\", \"new\");")
+dropdown_button_element_href("Fahrzeugenutzung", "javascript: pcal_pentry_edit_manager.start(\"vehicle_use\", \"new\");")
li.divider(role="separator")
li
a(href="/pcalpub", target="_blank") Neue Terminveröffentlichung
li
a(href="/email", target="_blank") Neue eMail
li
a(href="/birthdaycards", target="_blank") Geburtstagskarten erstellen
li
a(href="/labelprinter", target="_blank") Etiketten erstellen
li
a(href="/patenurkunde", target="_blank") Patenurkunde erstellen
#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)
mixin daycontrol(date, litinfo, last_week, yesterday, tomorrow, next_week)
- var red_class = litinfo.decoration_hint_red ? "litpanel_red" : "litpanel_black";
- litinfo.celebration = litinfo.celebration.replace(/\n/g, "<br/>");
- litinfo.celebration_add = litinfo.celebration_add.replace(/\n/g, "<br/>");
- litinfo.infos = litinfo.infos.replace(/\n/g,"<br/>");
- var celebration_class = "";
- if(litinfo.decoration_hint == 2) celebration_class = "litpanel_bold";
- if(litinfo.decoration_hint == 1) celebration_class = "litpanel_italic";
div(id="control")
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%")
a(href="javascript: day_goto('#{last_week}')", class="litpanel_arrow")
span(class="glyphicon glyphicon-fast-backward", aria-hidden="true")
a(href="javascript: day_goto('#{yesterday}')", class="litpanel_arrow", style="margin-left: 20px;")
span(class="glyphicon glyphicon-step-backward", aria-hidden="true")
td(colspan=2, style="text-align: center; width: 50%;")
a(href="#", style="white-space: nowrap;", data-toggle="modal", data-target="#daypickerDialog", data-date="#{date.date}", 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%;")
a(href="javascript: day_goto('#{tomorrow}')", class="litpanel_arrow", style="margin-right: 20px;")
span(class="glyphicon glyphicon-step-forward", aria-hidden="true")
a(href="javascript: day_goto('#{next_week}')", class="litpanel_arrow")
span(class="glyphicon glyphicon-fast-forward", aria-hidden="true")
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}
block
mixin day_activities(date, parishcal, key)
each a in parishcal.away[key]
+day_away(date.date, a, "day")
each t in parishcal.todo[key]
+day_todo(date.date, t, "day")
each k in parishcal.keep_in_mind[key]
+day_keep_in_mind(date.date, k, "day")
each v in parishcal.vehicle_use[key]
+day_vehicle_use(date.date, v, "day")
each event in parishcal.events[key]
+pevent_with_thereafter(date.date, event)
mixin pevent_with_thereafter(date, event, options = { details: false, links: false, clickable: true, pcalview: "day" })
if(options.clickable === false)
- var onclick_func = ""
- var cursor = "default"
else
- var onclick_func = "day_show_event('" + date + "', '" + event.uuid + "');"
//- var onclick_func = "location.assign('/event/" + date + "/" + event.uuid + "');"
- var cursor = "pointer"
.eventbox.pcal_pentry(style='background-color: ' + event.pretty.punit_color + '; cursor: ' + cursor + ';', onclick=onclick_func, data-pentryuuid=event.uuid, data-pentryname=event.name + event.pretty.name_secondary, data-pentryaddname="", data-eventstart=event.start)
.eventbox_punit_name #{event.punit.name}
if(event.pretty.involved_backgroundstripes !== "")
div(style="background: " + event.pretty.involved_backgroundstripes +"; height: 5px; margin-bottom: 2px;")
div(style="display: flex; justify-content: space-between;")
.eventbox_time #{event.pretty.time}
.eventbox_visibility #{event.pretty.visibility_short}
p.eventbox_name #{event.name}
span.eventbox_name_secondary #{event.pretty.name_secondary}
if(event.pretty.locations.length === 0)
p.eventbox_locations(style='font-size: 8pt;') <i>Keine Orte angegeben.</i>
else
p.eventbox_locations !{event.pretty.locations}
p.eventbox_involved !{event.pretty.involved}
if(options.details === true)
if event.description.length > 0
- event.description = event.description.replace(/\n/g, "<br/>");
p.eventbox_description !{event.description}
//- else
//- p(style="margin-top: 2px; margin-bottom: 2px;") dESCriptio
if event.annotations.length > 0
- event.annotations = event.annotations.replace(/\n/g, "<br/>");
p.eventbox_annotations !{event.annotations}
//- else
//- p(style="font-size: 90%;") ANN
if(options.links === true)
//- location.assign('/event/#{date}/#{event.uuid}/edit?pcalview=#{options.pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_edit_manager.start(\"event\", \"#{event.uuid}\");")
span(class="glyphicon glyphicon-edit", aria-hidden="true", style="color: blue;")
span
span Bearbeiten
//- location.assign('/pentry/#{date}/event/#{event.uuid}/clone?pcalview=#{options.pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_clone_move_manager.start(\"event\", \"#{event.uuid}\", 'clone');")
span(class="glyphicon glyphicon-copy", aria-hidden="true", style="color: green;")
span
span Klonen
//- location.assign('/pentry/#{date}/event/#{event.uuid}/move?pcalview=#{options.pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_clone_move_manager.start(\"event\", \"#{event.uuid}\", 'move');")
span(class="glyphicon glyphicon-transfer", aria-hidden="true", style="color: orange;")
span
span Verschieben
//- /event/#{date}/#{event.uuid}/delete
form(method="POST", action="", style="display: inline;")
//- input(type="hidden" name="u" value="#{u}")
button(type="button", class="btn btn-default btn-xs", data-toggle="modal", data-target="#confirmDelete", data-event-type="Ereignis", data-event-name="#{event.name}", data-date="#{date}", data-pentry-type="event", data-pentry-uuid="#{event.uuid}", data-pentry-title="das Ereignis \"#{event.name}\"")
span(class="glyphicon glyphicon-trash", aria-hidden="true", style="color: red;")
span
span Löschen
span
//- location.assign('/tevent/#{date}/#{event.uuid}/new/edit?pcalview=#{options.pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_edit_manager.start('tevent','new');")
span(class="glyphicon glyphicon-plus", aria-hidden="true")
span
span Folgeereignis erstellen
div
- var tev_count = 0
each tev in event.thereafter
- tev_count++;
.eventbox(style='background-color: ' + event.pretty.punit_color + '; margin-left: 20px; margin-right: 0px; cursor: ' + cursor + ';', onclick=onclick_func)
if(tev.pretty.involved_backgroundstripes !== "")
div(style="background: " + tev.pretty.involved_backgroundstripes +"; height: 5px; margin-bottom: 2px;")
div(style="display: flex; justify-content: space-between;")
.eventbox_time #{tev.pretty.time}
.eventbox_visibility #{tev.pretty.visibility_short}
p.eventbox_name #{tev.name}
span.eventbox_name_secondary #{tev.pretty.name_secondary}
if(tev.pretty.locations.length === 0)
p.eventbox_locations(style='font-size: 8pt;') <i>Keine Orte angegeben.</i>
else
p.eventbox_locations !{tev.pretty.locations}
if tev.pretty.involved != ""
p.eventbox_involved !{tev.pretty.involved}
if(options.details === true)
if(tev.description != "")
- tev.description = tev.description.replace(/\n/g, "<br/>");
p.eventbox_description !{tev.description}
//- else
//- span dESCriptio
//- br
if(tev.annotations != "")
- tev.annotations = tev.annotations.replace(/\n/g, "<br/>");
p.eventbox_annotations !{tev.annotations}
//- else
//- span(style="font-size: 90%;") ANN
//- br
if(options.links === true)
div
//- location.assign('/tevent/#{date}/#{event.uuid}/#{tev.uuid}/edit?pcalview=#{options.pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_edit_manager.start('tevent', '#{tev.uuid}');")
span(class="glyphicon glyphicon-edit", aria-hidden="true", style="color: blue;")
span
span Bearbeiten
//- if(event.thereafter.length > 1 && tev_count != 1)
- var disable_up = (event.thereafter.length < 2 || tev_count === 1)
button(class="btn btn-default btn-xs", type="button", onclick="do_tevent_move_updown($(this), '#{date}', '#{event.uuid}', '#{tev.uuid}', 'up');", disabled=disable_up)
span(class="glyphicon glyphicon-arrow-up", aria-hidden="true", style="color: green;")
span
span Nach oben
//- if(event.thereafter.length > 1 && tev_count != event.thereafter.length)
- var disable_down = (event.thereafter.length < 2 || tev_count === event.thereafter.length);
button(class="btn btn-default btn-xs", type="button", onclick="do_tevent_move_updown($(this), '#{date}', '#{event.uuid}', '#{tev.uuid}', 'down');", disabled=disable_down)
span(class="glyphicon glyphicon-arrow-down", aria-hidden="true", style="color: green;")
span
span Nach unten
button(class="btn btn-default btn-xs", type="button", data-toggle="modal", data-target="#confirmDelete", data-event-type="Folgeereignis", data-event-name="#{tev.name}", data-date="#{date}", data-event-uuid="#{event.uuid}", data-tevent-uuid="#{tev.uuid}", data-pentry-type="tevent", data-pentry-uuid="#{tev.uuid}", data-pentry-title="das Folgeereignis \"#{tev.name}\"")
span(class="glyphicon glyphicon-trash", aria-hidden="true", style="color: red;")
span
span Löschen
mixin pevent_with_thereafter_timeline(date, event, clickable)
if(typeof clickable === 'undefined' || clickable === true)
- var onclick_func = "day_show_event('" + date + "', '" + event.uuid + "');"
- var cursor = "pointer"
else
- var onclick_func = ""
- var cursor = "default"
div(style='height: ' + event.height + 'px; background-color: lightgrey; border-radius: 15px;')
.eventbox(style='cursor: ' + cursor + '; background-color: ' + event.pretty.punit_color + ';', onclick=onclick_func)
if(event.pretty.involved_backgroundstripes !== "")
div(style="background: " + event.pretty.involved_backgroundstripes +"; height: 5px; margin-bottom: 1px;")
div(style="display: flex; justify-content: space-between;")
.timelineevent_time #{event.pretty.time_short}
.timelineevent_visibility #{event.pretty.visibility_short}
p.timelineevent_name #{event.name}
span.timelineevent_name_secondary #{event.pretty.name_secondary}
if(event.pretty.locations.length > 0)
p.timelineevent_locations !{event.pretty.locations}
if(event.pretty.involved.length > 0)
p.timelineevent_involved !{event.pretty.involved}
div
- var tev_count = 0
each tev in event.thereafter
- tev_count++;
.eventbox(style='background-color: ' + event.pretty.punit_color + '; margin-left: 20px; margin-right: 0px; cursor: ' + cursor + ';', onclick=onclick_func)
if(tev.pretty.involved_backgroundstripes !== "")
div(style="background: " + tev.pretty.involved_backgroundstripes +"; height: 5px; margin-bottom: 1px;")
div(style="display: flex; justify-content: space-between;")
.timelineevent_time #{tev.pretty.time_short}
.timelineevent_visibility #{tev.pretty.visibility_short}
p.timelineevent_name #{tev.name}
span.timelineevent_name_secondary #{tev.pretty.name_secondary}
if(tev.pretty.locations.length > 0)
p.timelineevent_locations !{tev.pretty.locations}
if(tev.pretty.involved.length > 0)
p.timelineevent_involved !{tev.pretty.involved}
mixin timelinepoints(parishcal)
.timepoint(style="top: #{parishcal.timeline_positions[0]}px;") 00
.timepoint(style="top: #{parishcal.timeline_positions[1]}px;") 01
.timepoint(style="top: #{parishcal.timeline_positions[2]}px;") 02
.timepoint(style="top: #{parishcal.timeline_positions[3]}px;") 03
.timepoint(style="top: #{parishcal.timeline_positions[4]}px;") 04
.timepoint(style="top: #{parishcal.timeline_positions[5]}px;") 05
.timepoint(style="top: #{parishcal.timeline_positions[6]}px;") 06
.timepoint(style="top: #{parishcal.timeline_positions[7]}px;") 07
.timepoint(style="top: #{parishcal.timeline_positions[8]}px;") 08
.timepoint(style="top: #{parishcal.timeline_positions[9]}px;") 09
.timepoint(style="top: #{parishcal.timeline_positions[10]}px;") 10
.timepoint(style="top: #{parishcal.timeline_positions[11]}px;") 11
.timepoint(style="top: #{parishcal.timeline_positions[12]}px;") 12
.timepoint(style="top: #{parishcal.timeline_positions[13]}px;") 13
.timepoint(style="top: #{parishcal.timeline_positions[14]}px;") 14
.timepoint(style="top: #{parishcal.timeline_positions[15]}px;") 15
.timepoint(style="top: #{parishcal.timeline_positions[16]}px;") 16
.timepoint(style="top: #{parishcal.timeline_positions[17]}px;") 17
.timepoint(style="top: #{parishcal.timeline_positions[18]}px;") 18
.timepoint(style="top: #{parishcal.timeline_positions[19]}px;") 19
.timepoint(style="top: #{parishcal.timeline_positions[20]}px;") 20
.timepoint(style="top: #{parishcal.timeline_positions[21]}px;") 21
.timepoint(style="top: #{parishcal.timeline_positions[22]}px;") 22
.timepoint(style="top: #{parishcal.timeline_positions[23]}px;") 23
mixin timeline(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
.new_flex_zero(style="margin-bottom: 15px;")
.container-fluid
#daycontrol_parent
+daycontrol(date, litinfo, last_week, yesterday, tomorrow, next_week)
+messageview(messages)
.new_flex_one
.container-fluid
#timelinebody
each a in parishcal.away
+day_away(date.date, a, "timeline")
each t in parishcal.todo
+day_todo(date.date, t, "timeline")
each k in parishcal.keep_in_mind
+day_keep_in_mind(date.date, k, "timeline")
each v in parishcal.vehicle_use
+day_vehicle_use(date.date, v, "timeline")
- var panelwidth = (parishcal.events.length > 1 ? parishcal.events.length * 110 + "px" : "100%")
.block-relative(style="min-width: #{panelwidth}; height: #{parishcal.timeline_positions[24]}px; ")
+timelinepoints(parishcal)
- var colwidth = (parishcal.events.length > 0 ? 100 / parishcal.events.length : 100);
- var left = 0;
each col in parishcal.events
each event in col
.block-absolute(style="top: #{event.top}px; height: #{event.height}px; left: #{left}%; width: #{colwidth}%; overflow: hidden;", data-event-uuid="#{event.uuid}")
+pevent_with_thereafter_timeline(date.date, event)
- left = left + colwidth;
mixin actors_pfarreien_timeline_scripts
script.
function adjust_actorpanel_height() {
var height = 0;
$( "#actorpanel > .block-absolute" ).each(function() {
console.log($(this));
var my_height = $( this ).height();
console.log(my_height);
if(my_height > height)
height = my_height;
console.log(height);
});
$('#actorpanel').height(height);
$(".actortrenner").height(height);
}
adjust_actorpanel_height();
// Get the header
var actorheader = document.getElementById("actorheader");
// Get the offset position of the navbar
var sticky = actorheader.offsetTop - document.getElementById("timelinescroll").offsetTop;
// When the user scrolls the page, execute myFunction
// Add the sticky class to the header when you reach its scroll position. Remove "sticky" when you leave the scroll position
$("#timelinescroll").on("scroll", function() {
console.log('onscroll')
console.log('stick: ', sticky)
console.log($("#timelinescroll"))
console.log($("#timelinescroll").scrollTop())
if ($("#timelinescroll").scrollTop() > sticky) {
actorheader.classList.add("sticky");
$(".sticky").css("top", $("#timelinescroll").offset().top);
$("#actorpanel").css("left", $("#timelinescroll").scrollLeft()*-1)
console.log($("#timelinescroll").scrollLeft()*-1);
} else {
actorheader.classList.remove("sticky");
$("#actorpanel").css("left", 0)
}
$("#actorpanel").css("width", $("#timelinepanel").width())
});
$("#timelinepanel").resize(function() {
$("#actorpanel").css("width", $("#timelinepanel").width())
});
mixin pastoralteam(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
.new_flex_zero(style="margin-bottom: 15px;")
.container-fluid
#daycontrol_parent
+daycontrol(date, litinfo, last_week, yesterday, tomorrow, next_week)
+messageview(messages)
.new_flex_one#timelinescroll
.container-fluid
#timelinebody
each a in parishcal.away
+day_away(date.date, a, "timeline")
each t in parishcal.todo
+day_todo(date.date, t, "timeline")
each k in parishcal.keep_in_mind
+day_keep_in_mind(date.date, k, "timeline")
each v in parishcal.vehicle_use
+day_vehicle_use(date.date, v, "timeline")
- var panelwidth = parishcal.number_of_eventcolumns * 110 + "px";
- var colwidth = 100 / parishcal.number_of_eventcolumns;
div#actorheader
.block-relative#actorpanel(style="min-width: #{panelwidth};")
- var left = 0;
each actor in parishcal.actors
//- div(style="width: #{colwidth}%; color: white; display: inline;")
//- b #{actor.name}
.block-absolute(style="top: 0px; left: #{left}%; width: #{colwidth}%; height: auto;")
b #{actor.name}
- left = left + (actor.number_of_eventcolumns * colwidth);
div.actortrenner(style="position: absolute; top: 0px; left: #{left}%; border-left: 1px solid black;")
div
.block-relative#timelinepanel(style="min-width: #{panelwidth}; height: #{parishcal.timeline_positions[24]}px;")
+timelinepoints(parishcal)
- var left = 0;
each actor in parishcal.actors
each col in actor.events
each event in col
.block-absolute(style="top: #{event.top}px; height: #{event.height}px; left: #{left}%; width: #{colwidth}%; overflow: hidden;", data-event-uuid="#{event.uuid}")
+pevent_with_thereafter_timeline(date.date, event)
- left = left + colwidth;
div(style="position: absolute; top: 0px; left: #{left}%; height: #{parishcal.timeline_positions[24]}px; border-left: 1px solid black;")
+actors_pfarreien_timeline_scripts
mixin pfarreientimeline(date, litinfo, last_week, yesterday, tomorrow, next_week, parishcal, messages)
.new_flex_zero(style="margin-bottom: 15px;")
.container-fluid
#daycontrol_parent
+daycontrol(date, litinfo, last_week, yesterday, tomorrow, next_week)
+messageview(messages)
.new_flex_one#timelinescroll
.container-fluid
#timelinebody
each a in parishcal.away
+day_away(date.date, a, "timeline")
each t in parishcal.todo
+day_todo(date.date, t, "timeline")
each k in parishcal.keep_in_mind
+day_keep_in_mind(date.date, k, "timeline")
each v in parishcal.vehicle_use
+day_vehicle_use(date.date, v, "timeline")
- var panelwidth = parishcal.number_of_eventcolumns * 110 + "px";
- var colwidth = 100 / parishcal.number_of_eventcolumns;
div#actorheader
.block-relative#actorpanel(style="min-width: #{panelwidth};")
- var left = 0;
each unit in parishcal.units
.block-absolute(style="top: 0px; left: #{left}%; width: #{colwidth}%; height: auto;")
b #{unit.name}
- left = left + (unit.number_of_eventcolumns * colwidth);
div.actortrenner(style="position: absolute; top: 0px; left: #{left}%; border-left: 1px solid black;")
div
.block-relative#timelinepanel(style="min-width: #{panelwidth}; height: #{parishcal.timeline_positions[24]}px;")
+timelinepoints(parishcal)
- var left = 0;
each unit in parishcal.units
each col in unit.events
each event in col
.block-absolute(style="top: #{event.top}px; height: #{event.height}px; left: #{left}%; width: #{colwidth}%; overflow: hidden;", data-event-uuid="#{event.uuid}")
+pevent_with_thereafter_timeline(date.date, event)
- left = left + colwidth;
div(style="position: absolute; top: 0px; left: #{left}%; height: #{parishcal.timeline_positions[24]}px; border-left: 1px solid black;")
+actors_pfarreien_timeline_scripts
mixin common_pentry_panel(date, pentry, pentrytype, pentrytitle, pcalview)
.pentry_details(onclick="var event = arguments[0] || window.event; event.stopPropagation();")
//- location.assign('/#{pentrytype}/#{date}/#{pentry.uuid}/edit?pcalview=#{pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_edit_manager.start(\"#{pentrytype}\", \"#{pentry.uuid}\");")
span(class="glyphicon glyphicon-edit", aria-hidden="true", style="color: blue;")
span
span Bearbeiten
//- location.assign('/pentry/#{date}/#{pentrytype}/#{pentry.uuid}/clone?pcalview=#{pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_clone_move_manager.start(\"#{pentrytype}\", \"#{pentry.uuid}\", 'clone');")
span(class="glyphicon glyphicon-copy", aria-hidden="true", style="color: green;")
span
span Klonen
//- location.assign('/pentry/#{date}/#{pentrytype}/#{pentry.uuid}/move?pcalview=#{pcalview}');
button(class="btn btn-default btn-xs", onclick="pcal_pentry_clone_move_manager.start(\"#{pentrytype}\", \"#{pentry.uuid}\", 'move');")
span(class="glyphicon glyphicon-transfer", aria-hidden="true", style="color: orange;")
span
span Verschieben
button(type="button", class="btn btn-default btn-xs", onclick="$('#confirmDelete').modal('toggle', this);", data-date="#{date}", data-pentry-type="#{pentrytype}", data-pentry-uuid="#{pentry.uuid}", data-pentry-title="#{pentrytitle}")
//- data-toggle="modal", data-target="#confirmDelete",
span(class="glyphicon glyphicon-trash", aria-hidden="true", style="color: red;")
span
span Löschen
mixin day_away(date, away, pcalview)
.away.pcal_pentry(onclick="toggle_pentrydetails_visibility(this);", data-pentryuuid=away.uuid, data-pentryname=away.name, data-pentryaddname="")
.daymanager_away_headline
span Abwesend
br
span #{away.name}
if away.reason.length > 0
div(style="font-size: 9pt;") #{away.reason}
+common_pentry_panel(date, away, "away", "die Abwesenheit von \"" + away.name + "\"", pcalview)
mixin day_todo(date, todo, pcalview)
.todo.pcal_pentry(onclick="toggle_pentrydetails_visibility(this);", data-pentryuuid=todo.uuid, data-pentryname=todo.name, data-pentryaddname="")
.daymanager_todo_headline
span Zu tun
br
span #{todo.name}
if todo.pretty.involved.length > 0
.daymanager_todo_involved !{todo.pretty.involved}
if todo.description.length > 0
div(style="font-size: 9pt;") #{todo.description}
+common_pentry_panel(date, todo, "todo", "das Zu-Tun \"" + todo.name + "\"", pcalview)
mixin day_keep_in_mind(date, kim, pcalview)
.keep_in_mind.pcal_pentry(onclick="toggle_pentrydetails_visibility(this);", data-pentryuuid=kim.uuid, data-pentryname=kim.name, data-pentryaddname="")
.daymanager_keep_in_mind_headline
span Zu beachten
br
span #{kim.name}
if kim.description.length > 0
div(style="font-size: 9pt;") #{kim.description}
+common_pentry_panel(date, kim, "keep_in_mind", "das Zu-Beachten \"" + kim.name + "\"", pcalview)
mixin day_vehicle_use(date, vu, pcalview)
.vehicle_use.pcal_pentry(onclick="toggle_pentrydetails_visibility(this);", data-pentryuuid=vu.uuid, data-pentryname=vu.name, data-pentryaddname=vu.pretty.vehicle)
.daymanager_vehicle_use_headline
span Fahrzeugbenutzung
br
span #{vu.pretty.vehicle}
span #{vu.name}
if vu.pretty.involved.length > 0
.daymanager_vehicle_use_involved !{vu.pretty.involved}
if vu.description.length > 0
div(style="font-size: 9pt;") #{vu.description}
+common_pentry_panel(date, vu, "vehicle_use", "die Fahrzeugbenutzung \"" + vu.name + "\"", pcalview)
mixin day_birthdays_intern(title, bis)
fieldset.col-sm-12.col-lg-4(style="margin-bottom: 4px;")
legend(style="font-size: 115%; margin-bottom: 1px; font-style: italic;") #{title}
if bis.length > 0
each bi in bis
p(style="margin-top: 0px; margin-bottom: 0px;") #{bi.name} (#{bi.age})
p(style="margin-top: 0px; margin-bottom: 4px; font-size: 75%;") #{bi.kontext}
else
p(style="margin-top: 0px; margin-bottom: 0px;") Keine Geburtstage
mixin day_birthdays(birthdays)
if birthdays.yesterday.length > 0 || birthdays.today.length > 0 || birthdays.tomorrow.length > 0
fieldset(style="margin-top: 20px;")
legend(style="margin-bottom: 3px;") Geburtstage
.row(style="margin-bottom: 20px;")
+day_birthdays_intern("Gestern", birthdays.yesterday)
+day_birthdays_intern("Heute", birthdays.today)
+day_birthdays_intern("Morgen", birthdays.tomorrow)

365
views/mixins_email.jade Normal file
View File

@@ -0,0 +1,365 @@
mixin emaildestinationview(dest_to, dest_cc, dest_bcc, show_add_button, add_action)
.row
fieldset#fieldset_to.col-sm-12.col-lg-4
legend(style="font-size: 120%; margin-bottom: 0px;")
table(width="100%")
tr
td Empfänger
if show_add_button
td(align="right")
button(class="btn btn-primary btn-xs", onclick="#{add_action}") Empfänger hinzufügen
#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_on_small_devices");
fieldset(id="fieldset_cc", class=["col-sm-12", "col-lg-4", display_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_on_small_devices");
fieldset(style="margin-bottom: 10px;", id="fieldset_bcc", class=["col-sm-12", "col-lg-4", display_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>
mixin email_do_group(elem)
.panel.panel-info.parishdbelemspane_elem.col-sm-12.col-xs-12.col-lg-6(id="#{elem.uid}", data-elemname="#{elem.name}", data-parishdb="", data-dn="#{elem.dn}", data-elemtype="group")
.panel-heading
h4.panel-title #{elem.name}
p.parishdbelemspane_elem_kontext #{elem.kontext}
.panel-body(style="padding: 5px;")
if elem.members_without_email.length > 0
p(style="color: red; margin-bottom: 0px; font-weight: bold;") Achtung: In dieser Gruppe gibt es Mitglieder ohne eMail-Adresse:
each member_wo in elem.members_without_email
div(style="white-space: nowrap; display: inline-block;")
- var member_title = member_wo.name;
- if(member_wo.role.length > 0) member_title += " (" + member_wo.role + ")";
span(class="glyphicon glyphicon-envelope", aria-hidden="true")
span &nbsp;
span(style="white-space: nowrap;") #{member_title} &nbsp; &nbsp;
hr(style="margin-top: 5px; margin-bottom: 5px;")
//- +do_groupmember(member, elem)
p(style="color: green; margin-bottom: 0px; font-weight: bold;") Gruppenmitglieder
each member in elem.members
div(style="white-space: nowrap; display: inline-block;")
- var member_title = member.name;
- if(member.role.length > 0) member_title += " (" + member.role + ")";
span(class="glyphicon glyphicon-envelope", aria-hidden="true")
span &nbsp;
span(style="white-space: nowrap;") #{member_title} &nbsp; &nbsp;
hr(style="margin-top: 5px; margin-bottom: 5px;")
- var more_than_one = [];
- var only_one = [];
- elem.members.forEach(function(el) { if(el.emailaddresses.length > 1) more_than_one.push(el); else only_one.push(el.emailaddresses[0].address) });
- var only_one_addresses = only_one.join(';');
if(more_than_one.length > 0)
p(style="color: blue; margin-bottom: 0px; font-weight: bold;") Achtung: In dieser Gruppe gibt es Mitglieder mit mehr als einer eMail-Adresse; bitte wählen Sie die zu verwendende aus!
each member in more_than_one
- var member_title = member.name;
- if(member.role.length > 0) member_title += " (" + member.role + ")";
p(style="margin-bottom: 0px; white-space: nowrap;")
span(class="glyphicon glyphicon-envelope", aria-hidden="true")
span &nbsp;
span(style="text-style: italic;") #{member.name}
select(style="margin-bottom: 5px;")
each adr in member.emailaddresses
option(value="#{adr.address}") #{adr.address}
.btn-group(style="margin-left: 10px;")
button(type="button", class="btn btn-default btn-xs dropdown-toggle", data-toggle="dropdown", aria-haspopup="true" aria-expanded="false") Zusätzlich separate eMail versenden <span class="caret"></span>
ul.dropdown-menu
each adr in member.emailaddresses
li
span(style="font-weight: bold;") #{adr.address}
div(style="display: block;")
button( type="button",
class="btn btn-xs btn-default",
aria-hidden="true"
onclick="add_email_address({'dest': 'to', 'name': '#{member_title}, Gruppe #{elem.name}', 'kontext': '#{elem.kontext}', 'description' : 'Gruppenmitglied, eMail #{adr.description}', 'address': '#{adr.address}'});",
style="margin-bottom: 10px;"
) An
button( type="button",
class="btn btn-xs btn-default",
aria-hidden="true"
onclick="add_email_address({'dest': 'cc', 'name': '#{member_title}, Gruppe #{elem.name}', 'kontext': '#{elem.kontext}', 'description' : 'Gruppenmitglied, eMail #{adr.description}', 'address': '#{adr.address}'});",
style="margin-bottom: 10px;"
) Kopie
button( type="button",
class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address({'dest': 'bcc', 'name': '#{member_title}, Gruppe #{elem.name}', 'kontext': '#{elem.kontext}', 'description' : 'Gruppenmitglied, eMail #{adr.description}', 'address': '#{adr.address}'});",
style="margin-bottom: 10px;"
) Blindkopie
hr(style="margin-top: 5px; margin-bottom: 5px;")
button( class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address_group({'dest': 'to', 'name': '#{elem.name}', 'kontext': '#{elem.kontext}', 'description' : 'Gruppe', 'address': '#{only_one_addresses}'}, '#{elem.uid}');"
) An
button( class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address_group({'dest': 'cc', 'name': '#{elem.name}', 'kontext': '#{elem.kontext}', 'description' : 'Gruppe', 'address': '#{only_one_addresses}'}, '#{elem.uid}');"
) Kopie
button( class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address_group({'dest': 'bcc', 'name': '#{elem.name}', 'kontext': '#{elem.kontext}', 'description' : 'Gruppe', 'address': '#{only_one_addresses}'}, '#{elem.uid}');"
) Blindkopie
mixin email_do_person(elem)
.panel.panel-primary.parishdbelemspane_elem.col-sm-12.col-xs-12.col-lg-6(id="#{elem.uid}", data-elemname="#{elem.name}", data-parishdb="", data-dn="#{elem.dn}", data-elemtype="person")
.panel-heading
h4.panel-title #{elem.name}
p.parishdbelemspane_elem_kontext #{elem.kontext}
.panel-body(style="padding: 5px 15px;")
table(style="width: 100%; margin-bottom: 2px;", class="table table-condensed")
thead
tr
th
span(style="color: grey; font-size: 80%;") Beschreibung
th
span(style="color: grey; font-size: 80%;") Adresse
th
each eadr in elem.emailaddresses
tr
td(width="30%") #{eadr.description}
td(widht="70%") #{eadr.address}
td(align="right", style="white-space: nowrap;")
button( class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address({'dest': 'to', 'name': '#{elem.name}', 'kontext': '#{elem.kontext}', 'description' : '#{eadr.description}', 'address': '#{eadr.address}'});"
) An
button( class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address({'dest': 'cc', 'name': '#{elem.name}', 'kontext': '#{elem.kontext}', 'description' : '#{eadr.description}', 'address': '#{eadr.address}'});"
) Kopie
button( class="btn btn-xs btn-default",
aria-hidden="true",
onclick="add_email_address({'dest': 'bcc', 'name': '#{elem.name}', 'kontext': '#{elem.kontext}', 'description' : '#{eadr.description}', 'address': '#{eadr.address}'});"
) Blindkopie
mixin email_directinput
form(class="form-inline", id="form-emailaddresseditor-direct")
.form-group
label(for="emailinput", style="font-weight: normal; font-style: italic;") eMail - direkte Eingabe &nbsp;
input(type="email", class="form-control noEnterSubmit", size="65", id="emailinput", value="peter@halieus.de", 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
mixin email_scripts(after_email_added_todo, function_update_sendbutton, confirmdelete_id)
script.
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 === false)
show = substrRegex.test($(this).find('.parishdbelemspane_elem_kontext').text());
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]"));
}
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).removeClass('display_none_on_small_devices');
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") {
#{function_update_sendbutton}(true);
// $("#button_next").prop('disabled', false);
}
}
if(data.description === "")
data.description = "[als Gruppe]";
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>");
!{after_email_added_todo}
}
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);
}
$('##{confirmdelete_id}').on('show.bs.modal', function (e) {
$etype = $(e.relatedTarget).attr('data-delete-type');
$ename = $(e.relatedTarget).attr('data-delete-name');
var _message = "Sind Sie sicher, dass Sie \"" + $ename + "\" als Anhang löschen wollen?";
switch($etype) {
case "to": _message = "Sind Sie sicher, dass Sie \"" + $ename + "\" als Empfänger löschen wollen?"; break;
case "cc": _message = "Sind Sie sicher, dass Sie \"" + $ename + "\" als Empfänger einer Kopie löschen wollen?"; break;
case "bcc": _message = "Sind Sie sicher, dass Sie \"" + $ename + "\" als Empfänger einer Blindkopie löschen wollen?"; break;
};
$(this).find('.modal-body p').text(_message);
// 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_id}').find('.modal-footer #confirm').on('click', function() {
$etype = $(this).data('delete-type');
console.log($etype);
if($etype === 'Anhang')
{
ws.send("fileupload_remove", {uid: $(this).data('tr').prop('id')});
return;
}
var tr = $(this).data('tr');
// ATTENTION: andere Behandlung als Attachments!!!
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") {
#{function_update_sendbutton}(false);
//-$("#button_next").prop('disabled', true);
}
}
else
tr.remove();
$('##{confirmdelete_id}').modal('hide');
});
ws.bind('fileupload_remove_result', function(data) {
console.log(data);
var tr = $("#"+data.uid);
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><i>Keine Anhänge vorhanden.</i></p>");
}
else
tr.remove();
$('#confirmDelete').modal('hide');
});
function init_form_emailaddresschooser_direct() {
$('#form-emailaddresseditor-direct').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();
}
});
}
init_form_emailaddresschooser_direct();
function get_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;
}

View File

@@ -0,0 +1,55 @@
mixin labelprinter_settings(parishes, parishid, formats, formatid, last_field_is_postman, generate_detailed_postmeninfo)
form(class="form-horizontal", role="form", id="form")
.form-group
label(for='combo_parish', class="col-sm-2 control-label") Pfarrei
.col-sm-10
select(id='combo_parish', class="form-control")
- var id=0;
- each parish in parishes
option(value="#{id}") #{parish.name}
- id++;
script.
$("#combo_parish").val("#{parishid}")
.form-group
label(for='combo_format', class="col-sm-2 control-label") Format
.col-sm-10
select(id='combo_format', class="form-control")
- var id=0;
- each format in formats
option(value="#{id}") #{format}
- id++;
script.
$("#combo_format").val("#{formatid}")
.form-group
label(for='check_last_field_is_postman', class="col-sm-2 control-label") Letztes Feld ist Austräger
.col-sm-5.checkbox
label
input(id='check_last_field_is_postman', type="checkbox", name="check_last_field_is_postman", checked=last_field_is_postman)
.form-group
label(for='check_generate_detailed_postmeninfo', class="col-sm-2 control-label", id="check_generate_detailed_postmeninfo_label") Ausführliche Austrägerliste erstellen (mit einzelnen Adressaten)
.col-sm-5.checkbox
label
input(id='check_generate_detailed_postmeninfo', type="checkbox", name="check_generate_detailed_postmeninfo", checked=generate_detailed_postmeninfo)
script.
if($('#check_last_field_is_postman').prop('checked') === false)
{
$('#check_generate_detailed_postmeninfo').prop('disabled', true);
$('#check_generate_detailed_postmeninfo_label').css('color','grey');
}
$("#check_last_field_is_postman").on('change', function(){
var disable = ($(this).prop('checked') === false);
$('#check_generate_detailed_postmeninfo').prop('disabled', disable);
$('#check_generate_detailed_postmeninfo_label').css('color', (disable ? "grey" : "black"));
});
mixin labelprinter_omitted_lines(omitted_lines)
fieldset(style="margin-bottom: 20px;")
legend(style="font-size: 120%; margin-bottom: 0px;") Übersprungene Zeilen
div(style="margin-left: 10px; background-color: lightgrey;")
p.
!{omitted_lines}

62
views/mixins_pcalpub.jade Normal file
View File

@@ -0,0 +1,62 @@
mixin pcalpubsettings(parishid, factoryid, durance, date, publicationsformats)
form(class="form-horizontal", role="form", id="form", style="margin-top: 20px;")
.form-group
label(for='combo_parish', class="col-sm-2 control-label") Pfarrei
.col-sm-10
select(id='combo_parish', class="form-control", onchange="update_factories();")
- var id=0;
- each parish in publicationformats
option(value="#{id}") #{parish.name}
- id++;
script.
$("#combo_parish").val("#{parishid}")
.form-group
label(for='combo_factory', class="col-sm-2 control-label") Veröffentlichungsart
.col-sm-10
select(id='combo_factory', class="form-control", onchange="update_buttons();")
- var id=0;
- each factory in publicationformats[parishid].publicationformats
option(value="#{id}") #{factory.name}
- id++;
script.
$("#combo_factory").val("#{factoryid}")
.form-group
label(for='dpicker', class="col-sm-2 control-label") Ausgangsdatum
.col-sm-10
//- http://eternicode.github.io/bootstrap-datepicker/
#datepicker(data-date=date)
.form-group
label(for='combo_durance', class="col-sm-2 control-label") Dauer
.col-sm-10
select(id='combo_durance', class="form-control")
option(value="1") 1 Woche
option(value="2") 2 Wochen
option(value="3") 3 Wochen
option(value="4") 4 Wochen
option(value="5") 5 Wochen
option(value="6") 6 Wochen
option(value="7") 7 Wochen
script.
$("#combo_durance").val("#{durance}")
.form-group
label(for='fileinput', class="col-sm-2 control-label") 'Hintergrund'-PDF
.col-sm-10
input(type="file", id="fileinput", accept=".pdf", class="form-control")
div
button(type="button", class="btn btn-default btn-xs", onclick="$('#fileinput').val('');", style="display: inline;") Zurücksetzen
p#upload_pending_indicator(style='display: none; text-style: italic;') Datei wird hochgeladen...
.row
.col-sm-4
button.form-control.btn.btn-default#btn_html(type="button", onclick="pcalpub_generate_html();") HTML erstellen (und in neuem Fenster anzeigen)
.col-sm-4
button.form-control.btn.btn-default#btn_email(type="button", onclick="pcalpub_send_html_per_email();") per eMail versenden
.col-sm-4
button.form-control.btn.btn-default#btn_pdf(type="button", onclick="pcalpub_generate_and_view_document();") Dokument erstellen
//- .row(style="padding-right: 15px; padding-left: 15px;")
//- .row(style="padding-right: 15px; padding-left: 15px;")

View File

@@ -0,0 +1,48 @@
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="pcal_pentry_edit_manager.save_and_goto('edit_role', {'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="#{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: pcal_pentry_edit_manager.save_and_goto('add_actor', {'role': '" + section_uid + "'});")
+dropdown_button_element_href("Aus Datenbank", "javascript: pcal_pentry_edit_manager.save_and_goto('add_parishdbpersongroup', {'role': '" + section_uid + "'});")
+dropdown_button_element_href("Manuell", "javascript: pcal_pentry_edit_manager.save_and_goto('add_involved', {'role': '" + section_uid + "'});")
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; font-size: 80%;") 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", style="white-space: nowrap;")
if inv.id === "other"
span( class="glyphicon glyphicon-edit"
aria-hidden="true",
style="color: blue; cursor: pointer;",
onclick="pcal_pentry_edit_manager.save_and_goto('edit_involved', {'role': '#{section_uid}', 'involved': '#{inv.uid}'});")
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}"
)

263
views/mixins_week.jade Normal file
View File

@@ -0,0 +1,263 @@
mixin weekcontrol(basedate, interval, last_week, next_week)
#control
table(width="100%")
tr
td(colspan=2, width="20%")
a.litpanel_arrow(href="javascript: week_goto('#{last_week}');")
span.glyphicon.glyphicon-step-backward
td(colspan=2, style="text-align: center; width: 60%;")
a(href="#", style="color: black;" data-toggle="modal", data-target="#daypickerDialog", data-date="#{basedate}")
span.litpanel_day_mobile #{interval}
td(colspan=2, style="text-align: right; width: 20%;")
a.litpanel_arrow(href="javascript: week_goto('#{next_week}');")
span.glyphicon.glyphicon-step-forward
block
mixin week_complete_mobile(days)
- var celebration_printed = false;
table(width="100%")
each day in days
+week_day_mobile(day)
mixin week_day_mobile(day)
- day.litinfo.celebration = day.litinfo.celebration.replace("\n", "<br/>");
- day.litinfo.celebration_add = day.litinfo.celebration_add.replace("\n", "<br/>");
- day.litinfo.infos = day.litinfo.infos.replace("\n","<br/>");
- 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 + ", " + day.date.day + ". " + day.date.month_short + " " + day.date.year;
if( ! celebration_printed)
tr.new_day_begins
td.td_new_celebration(colspan=2, style="padding-right: 15px;")
span(class=["week_celebration", celebration_class, red_class], style="white-space: nowrap;") !{the_date}
td.td_new_celebration.td_last_column
span(class=["week_celebration", celebration_class, red_class]) !{day.litinfo.celebration}
if day.litinfo.celebration_add != ""
p.litpanel_celebration_add !{day.litinfo.celebration_add}
if day.litinfo.infos != ""
p.litpanel_infos !{day.litinfo.infos}
else
tr.new_day_begins
td(colspan=2, valign='top')
span(class=["week_celebration", celebration_class, red_class], style="white-space: nowrap;") !{the_date}
td
each away in day.parishcal.away
+week_away(away)
each todo in day.parishcal.todo
+week_todo(todo)
each keep_in_mind in day.parishcal.keep_in_mind
+week_keep_in_mind(keep_in_mind)
each vu in day.parishcal.vehicle_use
+week_vehicle_use(vu)
each event in day.parishcal.events.today
+week_event(event)
if (day.parishcal.away.length + day.parishcal.todo.length + day.parishcal.keep_in_mind.length + day.parishcal.vehicle_use.length + day.parishcal.events.today.length + day.parishcal.events.tomorrow.length) === 0
tr.tr_new_pcalentry
td(style="width: 10%;")
td(style="width: 5%;")
td(valign='top').td_last_column
i Keine Eintragungen an diesem Tag
if(day.parishcal.tomorrow)
tr
td &nbsp;
td &nbsp;
td &nbsp;
- celebration_printed = true;
- day.parishcal.tomorrow.celebration = day.parishcal.tomorrow.celebration.replace("\n", "<br/>");
- day.parishcal.tomorrow.celebration_add = day.parishcal.tomorrow.celebration_add.replace("\n", "<br/>");
- day.parishcal.tomorrow.infos = day.parishcal.tomorrow.infos.replace("\n","<br/>");
- 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.new_day_begins
td
td
td.td_new_celebration.td_last_column
span(class=["week_celebration", celebration_class_tomorrow, red_class_tomorrow]) !{day.parishcal.tomorrow.celebration}
if day.parishcal.tomorrow.celebration_add != ""
p.litpanel_celebration_add !{day.parishcal.tomorrow.celebration_add}
if day.parishcal.tomorrow.infos != ""
p.litpanel_infos !{day.parishcal.tomorrow.infos}
tr
td(valign='top', colspan=2, style="border-bottom:1px solid #000000; padding-right: 15px; padding-top: 2px;")
span(class=["week_celebration", celebration_class, red_class], style="font-size: 80%") !{the_date}
td
each event in day.parishcal.events.tomorrow
+week_event(event)
else
- celebration_printed = false;
tr
td &nbsp;
td &nbsp;
td &nbsp;
mixin week_complete_desktop(days)
- 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
td
td
td
mixin week_event(event, the_date)
- my_class = event.thereafter.length === 0 ? "tr_new_pcalentry" : "tr_new_pcalentry_without_bottomline"
tr(class=my_class)
if(typeof the_date != 'undefined')
td(valign='top', width="10%")
span.week_celebration !{the_date}
td.td_time.week_time_start #{event.pretty.start}
td.td_locsign(style="background-color: " + event.pretty.punit_color + ";")
span.week_time_start #{event.pretty.sign}
br
div(style="width: 100%; line-height: 60%; background: " + event.pretty.involved_backgroundstripes + ";") &nbsp;
td.td_last_column
span.week_event_name #{event.name}
span(style='font-size: 9pt;') #{event.pretty.name_secondary}
if event.pretty.end.length > 0
- var ca = (event.pretty.end_is_vague ? 'ca. ' : '')
p.week_time_end bis #{ca}#{event.pretty.end}&nbsp;
p.week_event_locations !{event.pretty.locations}
p.week_event_involved !{event.pretty.involved}
-var cnt=0
for tev in event.thereafter
- cnt++
- my_class_tev = cnt === event.thereafter.length ? "tr_thereafter_with_bottomline" : "";
tr(class=my_class_tev)
td.td_time.week_time_start Danach
td.td_locsign(style="background-color: " + event.pretty.punit_color + ";")
span.week_time_start #{tev.pretty.sign}
br
div(style="width: 100%; line-height: 60%; background: " + tev.pretty.involved_backgroundstripes + ";") &nbsp;
td.td_last_column
span.week_event_name #{tev.name}
span(style='font-size: 9pt;') #{tev.pretty.name_secondary}
if event.pretty.end.length > 0
- var ca = (tev.pretty.end_is_vague ? 'ca. ' : '')
p.week_time_end bis #{ca}#{tev.pretty.end}&nbsp;
p.week_event_locations !{tev.pretty.locations}
p.week_event_involved !{tev.pretty.involved}
mixin week_away(away, the_date)
tr.tr_new_pcalentry
if(typeof the_date != 'undefined')
td(valign='top', width="10%")
span.week_celebration !{the_date}&nbsp;
td.td_time.week_pentrytitle(style="color: #FF5050;") Abwesend
td.td_locsign
td.td_last_column.week_event_name(style="color: #FF5050;") #{away.name}
if away.reason.length > 0
p.week_additional_info(style="color: #FF5050;") #{away.reason}
mixin week_todo(todo, the_date)
tr.tr_new_pcalentry
if(typeof the_date != 'undefined')
td(valign='top', width="10%")
span.week_celebration !{the_date}&nbsp;
td.td_time.week_pentrytitle(style="color: #5893FF;") Zu tun
td.td_locsign
td.td_last_column.week_event_name(style="color: #5893FF;") #{todo.name}
if todo.pretty.involved.length > 0
p.week_event_involved !{todo.pretty.involved}
if todo.description.length > 0
p.week_additional_info #{todo.description}
mixin week_keep_in_mind(kim, the_date)
tr.tr_new_pcalentry
if(typeof the_date != 'undefined')
td(valign='top', width="10%")
span.week_celebration !{the_date}
td.td_time.week_pentrytitle(style="color: #15D715;") Zu beachten
td.td_locsign
td.td_last_column.week_event_name(style="color: #15D715;") #{kim.name}
if kim.description.length > 0
p.week_additional_info(style="color: #15D715;") #{kim.description}
mixin week_vehicle_use(vu, the_date)
tr.tr_new_pcalentry
if(typeof the_date != 'undefined')
td(valign='top', width="10%")
span.week_celebration !{the_date}
td.td_time.week_pentrytitle(style="color: #FF8A3C;") Fahrzeug&shy;benutzung
td.td_locsign
td.td_last_column.week_event_name(style="color: #FF8A3C;") #{vu.pretty.vehicle}
p.week_subheadline #{vu.name}
if vu.pretty.involved.length > 0
p.week_event_involved !{vu.pretty.involved}
if vu.description.length > 0
p.week_additional_info #{vu.description}

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;

164
views/parishdb.jade Normal file
View File

@@ -0,0 +1,164 @@
include mixins
- var generateUID = function() { return ("000000" + (Math.random()*Math.pow(36,6) << 0).toString(36)).slice(-6) };
mixin do_person(elem)
- var my_uid = generateUID();
.panel.panel-info(id=my_uid, data-elemname=elem.name, data-elemkontext=elem.kontext, data-parishdb="", data-dn=elem.dn, data-elemtype="person")
.panel-heading
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{elem.name}
.panel-collapse.collapse.panel-parishdb-details-person(id="PANEL_"+my_uid)
mixin do_groupmember(elem, group)
- var my_uid = generateUID();
.panel.panel-info(id=my_uid, data-elemname=elem.name, data-dn=elem.person_dn)
.panel-heading
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{elem.name}
if elem.role !== ''
p.parishdbelemspane_elem_role #{elem.role}
.panel-collapse.collapse.panel-parishdb-details-person(id="PANEL_"+my_uid)
mixin do_group(elem)
- var my_uid = generateUID();
.panel.panel-success.panel_group_and_unit(id=my_uid, data-elemname=elem.name, data-elemkontext=elem.kontext, data-parishdb="", data-dn=elem.dn, data-elemtype="group")
.panel-heading
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{elem.name}
//- table(width="100%")
//- tr
//- td #{elem.name}
//- td(align="right", onclick="var event = arguments[0] || window.event; event.stopPropagation(); $('#PANEL_#{my_uid}').collapse('toggle'); return false;")
//- a(role="button", style="font-size: 10px; line-height: 1;", data-toggle="collapse", data-target="#PANEL_#{my_uid}", aria-expanded="false", aria-controls="PANEL_#{my_uid}", onclick="$(this).find('.glyphicon').toggleClass('glyphicon-chevron-down glyphicon-chevron-up');")
//- span(class="glyphicon glyphicon-chevron-down", aria-hidden="true")
.panel-collapse.collapse(id="PANEL_"+my_uid)
.panel-body(style="padding: 7px;")
each member in elem.members
+do_groupmember(member, elem)
mixin do_unit(elem)
- var my_uid = generateUID();
- var my_border_color = elem.is_pastoral ? "border-color: "+ elem.color +"; " : "";
- var my_background_image = elem.is_pastoral ? "background-image: linear-gradient(to bottom,"+elem.color+" 50%, #ffffff 100%); border-color: #ffffff; background-color: #ffffff; border-top-left-radius: 0px; border-top-right-radius: 0px;" : "";
- var my_border_top_color = elem.is_pastoral ? "border-top-color: #ffffff;" : "";
.panel.panel-default.panel_group_and_unit(id=my_uid, data-elemname=elem.name, data-elemkontext=elem.kontext, data-parishdb="", data-dn=elem.dn, data-elemtype="unit", data-depth=elem.depth, style=my_border_color )
.panel-heading(style=my_background_image)
h4.panel-title(data-toggle="collapse", data-target="#PANEL_"+my_uid, aria-expanded="false", aria-controls="PANEL_"+my_uid) #{elem.name}
//- border-bottom: 2px solid #{elem.color};
.panel-collapse.collapse(id="PANEL_"+my_uid)
.panel-body(style="padding: 10px; "+my_border_top_color)
for child in elem.childs
if(child.type === "unit")
+do_unit(child)
if(child.type === "person")
+do_person(child)
if(child.type === "group")
+do_group(child)
doctype strict
html
include header
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/parishdb_person.js')
script(src='/javascripts/runtime.js')
style.
.panel { margin-bottom: 5px; }
.panel-title { cursor: pointer; }
.panel_group_and_unit { border-width: 3px; }
body
.root
.new_flex_zero
+nav_with_form("PfarrInfoSystem", "PfIS", "parishdbnav")
.container-fluid
h1 Pfarrdatenbank
.new_flex_one
.container-fluid
for elem in parishdb.tree
if(elem.type === "unit")
+do_unit(elem)
script.
$("#parishdbnav-form").on('submit', function(e){
e.preventDefault();
});
function show_searchbar(functiontocall) {
$("#parishdbnav-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 units_are_shown = false;
function adjust_visible_elems(my_input) {
substrRegex = new RegExp(my_input.value, 'i');
if(!units_are_shown) {
$("[data-elemtype='unit']").each(function(index) {
var panel_id = "#PANEL_" + $(this).prop('id');
$(panel_id).collapse('show');
});
console.log('SHOW ALL UNITS');
units_are_shown = true;
}
set_visibility_according_to_filter(substrRegex, $("[data-parishdb][data-elemtype!='unit']"));
for(var d = #{parishdb.max_depth}; d > 0; d--) {
$("[data-depth="+d+"]").each(function(index){
var parishdb_childs = $(this).children(".panel-collapse").children(".panel-body").children("[data-parishdb]");
var visible = false;
parishdb_childs.each(function(index) {
if($(this).css("display") !== "none") {
visible = true;
return false;
}
});
if(visible)
$(this).show();
else
$(this).hide();
});
}
}
function set_visibility_according_to_filter(substrRegex, elems) {
console.log(elems.length)
elems.each(function(index) {
var show = substrRegex.test($(this).data('elemname'));
if(!show)
show = substrRegex.test($(this).data('elemkontext'));
if($(this).data('elemtype') === "group") {
var childelems = $(this).find('[data-elemname]');
childelems.each(function(index) {
if(substrRegex.test($(this).data('elemname'))) {
show = true;
return false;
}
});
}
if(show) {
$(this).show();
}
else {
$(this).hide();
}
});
}
var ws = new PfISWebSocket("#{sessionuuid}");
ws.bind_standard_close_handler();
$(".panel-parishdb-details-person").on("show.bs.collapse", function(event) {
if($(event.target).children().length === 0) {
console.log("Loading person from DB ...");
ws.send('get_parishdb_person', {dn: $(event.target).parent().data('dn')});
}
});
ws.bind('get_parishdb_person_result', function(data) {
console.log(data.person);
if(data.result === "OK")
$("[data-dn='"+data.person.dn+"']").children('.panel-collapse').html(parishdb_person_template(data));
else
$("[data-dn='"+data.person.dn+"']").children('.panel-collapse').html("<div class='.panel-body'><p style='color: red;'>Fehler beim Abrufen der Pfarrdatenbank!</p></div>")
});

View File

@@ -0,0 +1,47 @@
.panel-body
fieldset
legend(style="font-size: 120%; font-weight: bold; margin-bottom: 2px;") Anschrift
p.
#{person.address.street} #{person.address.street_nr}<br>
#{person.address.plz} #{person.address.location}
if(person.emailaddresses.length > 0)
fieldset
legend(style="font-size: 120%; font-weight: bold; margin-bottom: 2px;") eMail-Adressen
table(style="width: 100%; margin-bottom: 2px;", class="table table-condensed")
thead
tr
th
span(style="color: grey; font-size: 80%;") Beschreibung
th
span(style="color: grey; font-size: 80%;") Adresse
th
each eadr in person.emailaddresses
tr
td(width="30%") #{eadr.description}
td(widht="70%") #{eadr.address}
if(person.phonenumbers.length > 0)
fieldset
legend(style="font-size: 120%; font-weight: bold; margin-bottom: 2px;") Erreichbarkeit per Telefon
table(style="width: 100%; margin-bottom: 2px;", class="table table-condensed")
thead
tr
th
span(style="color: grey; font-size: 80%;") Beschreibung
th
span(style="color: grey; font-size: 80%;") Nummer
th
each pn in person.phonenumbers
tr
td(width="30%") #{pn.description}
td(widht="70%") #{pn.number}
if(person.birthday.valid)
fieldset
legend(style="font-size: 120%; font-weight: bold; margin-bottom: 2px;") Geboren
p(style="margin-bottom: 0px;") #{person.birthday.date}
if(person.birthday.location.length > 0)
p(style="margin-bottom: 0px;") in #{person.birthday.location}
p(style="margin-bottom: 0px;") Gegenwärtiges Alter: #{person.birthday.age}

View File

@@ -0,0 +1,221 @@
include mixins
- var actual_background = "yellow";
mixin do_group(elem)
.panel.panel-default.parishdbelemspane_elem.col-sm-12.col-xs-12.col-lg-6(id="#{elem.uid}", style="margin-bottom: 0px;", data-elemname="#{elem.name}", data-parishdb="", data-dn="#{elem.dn}", data-elemtype="group")
.panel-heading.parishdb-group-heading(data-elem-uid="#{elem.uid}", onclick="select_elem('#{elem.uid}','');")
h4.panel-title
table(width="100%")
tr
td #{elem.name}
p.parishdbelemspane_elem_kontext #{elem.kontext}
td(align="right")
//- , onclick="var event = arguments[0] || window.event; event.stopPropagation(); $('#PANEL_#{elem.uid}').collapse('toggle');")
a.parishdb-group-collapser(role="button", style="font-size: 10px; line-height: 1;", data-toggle="collapse", data-target="#PANEL_#{elem.uid}", aria-expanded="false", aria-controls="PANEL_#{elem.uid}")
span(class="glyphicon glyphicon-chevron-down", aria-hidden="true")
//- , onclick="$(this).find('.glyphicon').toggleClass('glyphicon-chevron-down glyphicon-chevron-up');"
//-button.btn.btn-xs.btn-primary(type="button", data-toggle="collapse", data-target="#PANEL_#{elem.uid}", aria-expanded="false", aria-controls="PANEL_#{elem.uid}", onclick="$(this).find('.glyphicon').toggleClass('glyphicon-chevron-down glyphicon-chevron-up');")
//- onclick="var event = arguments[0] || window.event; event.stopPropagation(); $('#PANEL_#{elem.uid}').collapse('toggle');"
.panel-collapse.collapse.parishdb-group-collapse(id="PANEL_#{elem.uid}")
.panel-body(style="padding: 5px;")
each member in elem.members
+do_groupmember(member, elem)
mixin do_person(elem)
.panel.panel-default.parishdbelemspane_elem.col-sm-12.col-xs-12.col-lg-6(id="#{elem.uid}", style="margin-bottom: 0px; cursor: pointer;", data-elemname="#{elem.name}", data-parishdb="", data-dn="#{elem.dn}", data-elemtype="person")
.panel-heading(onclick="select_elem('#{elem.uid}','');")
h4.panel-title #{elem.name}
p.parishdbelemspane_elem_kontext #{elem.kontext}
mixin do_groupmember(elem, group)
.panel.panel-default(id="#{elem.uid}", style="cursor: pointer; margin-bottom: 0px;", data-elemname="#{elem.name}", data-dn="#{elem.person_dn}")
.panel-heading(onclick="select_elem('#{elem.uid}', '#{group.uid}');")
h4.panel-title #{elem.name}
p.parishdbelemspane_elem_kontext #{elem.kontext}
if elem.role !== ''
p.parishdbelemspane_elem_role #{elem.role}
.subroot
.new_flex_zero
.container-fluid
h4 Beteiligten aus der Pfarrdatenbank hinzufügen
//- form(class="form-horizontal", id="form-filter")
//- .form-group
//- label(for='edit_filter', class="col-sm-1 col-xs-2 control-label") Filter
//- .col-sm-11.col-xs-10
//- input(id="edit_filter", type="text", class="form-control", oninput="adjust_visible_elems(this);")
//- script.
//- $("#form-filter").on('submit', function(e){
//- console.log('FILTER SUBMIT');
//- e.preventDefault();
//- });
//- // HINT: the 'autofocus'-attribute is obviously only interpreted once!!!
//- $("#edit_filter").focus();
form(class="form-horizontal", id="form-parishdbpersongroupselector")
input(type="hidden", name="actual_elem_uid", id="actual_elem_uid")
input(type="hidden", name="actual_elem_dn", id="actual_elem_dn")
input(type="hidden", name="actual_elem_name", id="actual_elem_name")
input(type="hidden", name="actual_elem_group", id="actual_elem_group")
input(type="hidden", name="for_role", id="for_role", value="#{for_role}")
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="history.back();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
p.small(style="margin-top: 7px; margin-bottom: 0px; font-weight: bold;") Aktuell ausgewählt
p(style="font-size: 100%; font-weight: bold; margin-bottom: 0px;")
span#actual_name -
.parishdbelemspane_elem_kontext#actual_kontext ()
#errorpane
.new_flex_one(style="padding-bottom: 200px;")
.container-fluid
.parishdbelemspane
for elem in parishdb
if elem.type === "person"
+do_person(elem)
if elem.type === "group"
+do_group(elem)
script.
/*$('.parishdb-group-heading').on('click', function(event) {
var target = $(event.target).closest(".parishdb-group-heading");
select_elem(target.data('elem-uid'),'');
});*/
$('.parishdb-group-collapse').on('hide.bs.collapse', function (event) {
$(event.target).closest('.panel').find('.glyphicon').toggleClass('glyphicon-chevron-down glyphicon-chevron-up');
});
$('.parishdb-group-collapse').on('show.bs.collapse', function (event) {
$(event.target).closest('.panel').find('.glyphicon').toggleClass('glyphicon-chevron-down glyphicon-chevron-up');
});
$('a.parishdb-group-collapser').on('click', function(event) {
$(event.target).closest('.panel').find('.panel-collapse').collapse('toggle');
event.stopPropagation();
});
//show_submitbutton("submit-btn-pdbselector", "submit_pdbelem();",("#{actual_elem_dn}" === "" ? "disabled" : ""));
pcal_pentry_edit_manager.show_searchbar("adjust_visible_elems(this);");
if("#{actual_elem_id}" === "")
$("#submit_button").prop('disabled', true);
function select_elem(elem_uid, group_dn) {
console.log("SELECTED: " + elem_uid);
var actual_uid = $("#actual_elem_uid").val();
if(actual_uid === elem_uid) {
console.log("NOTHIN CHANGED");
return;
}
console.log(actual_uid);
if(actual_uid !== '')
$("#" + actual_uid).closest('.panel').removeClass('panel-success').addClass('panel-default');
var new_panel = $("#" + elem_uid).closest('.panel');
new_panel.removeClass('panel-default').addClass('panel-success');
var actual_dn = new_panel.data('dn');
var actual_name = new_panel.data("elemname");
$("#actual_elem_uid").val(elem_uid);
$("#actual_elem_dn").val(actual_dn);
$("#actual_elem_name").val(actual_name);
$("#actual_elem_group").val(group_dn);
if(new_panel.data("elemtype")==="group") {
var actual_kontext = $(new_panel.find('.parishdbelemspane_elem_kontext')[0]).text();
actual_name = "G " + actual_name + "/" + actual_kontext;
$("#actual_kontext").text('');
}
else {
var actual_kontext = new_panel.find('.parishdbelemspane_elem_kontext').text();
$("#actual_kontext").text(actual_kontext);
}
$("#actual_name").text(actual_name);
$("#errorpane").empty();
$("#submit_button").prop('disabled', false);
//$("#submit_button").removeClass('disabled');
}
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 dn = $(this).data('dn');
var show = substrRegex.test(txt);
if(show === false)
show = substrRegex.test($(this).find('.parishdbelemspane_elem_kontext').text());
if($(this).data('elemtype') === "group") {
var childelems = $(this).find('[data-elemname]');
childelems.each(function(index) {
if(substrRegex.test($(this).data('elemname'))) {
show = true;
return false;
}
});
}
if(show) {
$(this).show();
if(actual_dn === dn || actual_group === dn) {
$("#submit_button").prop('disabled', false);
//$("#submit_button").removeClass('disabled');
$("#errorpane").empty();
}
}
else {
$(this).hide();
if(actual_dn === dn || actual_group === dn) {
$("#submit_button").prop('disabled', true);
//$("#submit_button").addClass('disabled');
$("#errorpane").html(get_compiled_message("danger", "Auswahl ungültig", "Durch die Filterangabe wurde Ihre Auswahl ungültig!"));
}
}
});
}
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]"));
}
function submit_pdbelem() {
var data = {
for_role: "#{for_role}",
name : $("#actual_name").text(),
id : "dn",
dn : $("#actual_elem_dn").val()
};
pcal_pentry_edit_manager.add_involved(data);
}
$("#form-parishdbpersongroupselector").on('submit', function(e) {
submit_pdbelem();
e.preventDefault();
});

View File

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

View File

@@ -0,0 +1,72 @@
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)
.subroot(style="height: 100%;")
.new_flex_zero(style="padding-left: 15px; padding-right: 15px;")
p.
Wählen Sie den zugehörigen pastoralen Kontext aus!
form(class="form-horizontal" method="POST", action="", id="form_punitselector", style="padding-bottom: 20px;")
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
button(class="btn btn-warning btn-xs", type="button", onclick="goto_mainpage();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
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());
}
$("#form_punitselector").on('submit', function(e) {
var data = {
name : $("#actual_punit_name").val(),
dn : $("#actual_punit_dn").val()
};
pcal_pentry_edit_manager.set_pastoralunit(data);
e.preventDefault();
});

170
views/patenurkunde.jade Normal file
View File

@@ -0,0 +1,170 @@
- var parishes_string = JSON.stringify(data.parishes);
- var _date = new Date(); var _dd = _date.getDate(); if(_dd < 10) _dd = '0' + _dd; var _mm = _date.getMonth()+1; if(_mm < 10) _mm= '0' + _mm;
- var date = _date.getFullYear() + "-" + _mm + "-" + _dd;
include mixins
include mixins_pcalpub
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/validator.min.js")
script(src='/javascripts/pfiswebsocket.js')
script(src="/javascripts/validator.min.js")
script(src="/javascripts/typeahead.jquery.min.js")
link(href="/stylesheets/mytypeahead.css", rel="stylesheet")
body
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Eine Patenurkunde erstellen
.new_flex_one(style="margin-bottom: 10px;")
.container-fluid
form(class="form-horizontal", role="form", id="form-patenurkunde", style="margin-top: 20px;")
.form-group
label(for='combo_parish', class="col-sm-2 control-label") Taufpfarrei
.col-sm-10
select(id='combo_parish', class="form-control", onchange="update_churches();")
- var id=0;
- each parish in data.parishes
option(value="#{id}") #{parish.name}
- id++;
.form-group
label(for='combo_church', class="col-sm-2 control-label") Taufkirche
.col-sm-10
select(id='combo_church', class="form-control")
- var id=0;
- each church in data.parishes[0].churches
option(value="#{id}") #{church}
- id++;
.form-group
label(for='dpicker', class="col-sm-2 control-label") Taufdatum
.col-sm-10
//- http://eternicode.github.io/bootstrap-datepicker/
#datepicker(data-date=date)
.form-group
label(for='baptistname', class="col-sm-2 control-label") Taufspender
.col-sm-10
input(type="text", id="baptistname", class="form-control", required)
.help-block.with-errors
.form-group
label(for='childname', class="col-sm-2 control-label") Name des Taufkindes
.col-sm-10
input(type="text", id="childname", class="form-control", required)
.help-block.with-errors
.form-group
label(for='patename', class="col-sm-2 control-label") Name des Paten
.col-sm-10
input(type="text", id="patename", class="form-control", required)
.help-block.with-errors
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Urkunde erstellen
script.
function activate_datepicker() {
$('#datepicker').datepicker({format: "yyyy-mm-dd", language: "de", calendarWeeks: true, todayHighlight: true});
//$("#datepicker").datepicker('setDate', new Date());
//$("#datepicker").datepicker('update');
console.log($("#datepicker").datepicker('getFormattedDate'));
}
activate_datepicker();
var parishes = !{parishes_string};
function update_churches() {
var optionSelected = $("#combo_parish").prop('selectedIndex');
$("#combo_church").empty();
for(idx = 0; idx < parishes[optionSelected].churches.length; ++idx) {
var church = parishes[optionSelected].churches[idx];
$("#combo_church").append($("<option></option>").text(church));
}
}
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 baptists = ["Pfarrer Peter Fischer", "Kaplan Andreas Stahl", "Kaplan Markus Grasser", "Pfarradministrator P. Dr. Peter Uzor"];
$("#baptistname").typeahead({
hint: true,
highlight: true,
minLength: 0
},
{
name: 'baptists',
source: substringMatcher(baptists)
});
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
$('#form-patenurkunde').validator().on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
e.preventDefault();
console.log('GENERATE URKUNDE');
var data = {
parishid : $("#combo_parish").prop('selectedIndex'),
churchid : $("#combo_church").prop('selectedIndex'),
date : $("#datepicker").datepicker('getFormattedDate'),
baptistname : $("#baptistname").val(),
childname : $("#childname").val(),
patename : $("#patename").val()
};
console.log(data);
ws.send('generate_urkunde', data);
}
});
ws.bind('generate_urkunde_result', function(data) {
console.log(data.result);
if(data.result === 'OK')
{
console.log(data.file);
//window.open("data:application/pdf;base64," + data.data , '_blank');
var the_new_win = window.open(data.file, '_blank');
the_new_win.title = "Patenurkunde";
}
else
console.log('ERROR IN generate_urkunde(_result)');
});

43
views/pcal/edit_away.jade Normal file
View File

@@ -0,0 +1,43 @@
include ../mixins
form.form-horizontal.subroot#form_pentry(role="form", method="POST", action="")
.new_flex_zero
.container-fluid(style="margin-bottom: 20px;")
button.btn.btn-success.btn-sm(type="submit")
span.glyphicon.glyphicon-ok(aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{away.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{away.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="pcal_pentry_edit_manager.save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Abwesende Person
.col-sm-10
.input-group
input(id="edit_involveddb_id", type="hidden", name="involveddb_id", value="#{away.involveddb_id}")
input(id="edit_name", type="text", name="edit_name", class="form-control noDirectInput", value="#{away.name}", required)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="pcal_pentry_edit_manager.save_and_goto('add_actor', {role: ''})") Ändern
.help-block.with-errors
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)
.form-group
label(for='edit_reason', class="col-sm-2 control-label") Grund
.col-sm-10
input(id='edit_reason', type="text", class="form-control noEnterSubmit", name="edit_reason", value="#{away.reason}", required)
.help-block.with-errors

194
views/pcal/edit_event.jade Normal file
View File

@@ -0,0 +1,194 @@
include ../mixins
include ../mixins_pentryedit
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; font-size: 80%;") Name
th
span(style="color: grey; font-size: 80%;") Signum
th
tbody
each loc in the_locations
tr(id="#{loc.uid}", data-uid="#{loc.uid}")
td(width="70%") #{loc.name}
td(widht="20%") #{loc.sign}
td(align="right", style="white-space: nowrap;")
if loc.id === "other"
span( class="glyphicon glyphicon-edit"
aria-hidden="true",
style="color: blue; cursor: pointer;",
onclick="pcal_pentry_edit_manager.save_and_goto('edit_location', {'location': '#{loc.uid}'});")
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}"
)
form.form-horizontal.subroot#form_pentry(role="form", method="POST", action="")
.new_flex_zero
.container-fluid(style="margin-bottom: 20px;")
input(type="hidden", name="pcalview", value="#{pcalview}")
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
if(event.pentrytype === "event")
.form-group
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="pcal_pentry_edit_manager.save_and_goto('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.
$("#combo_type").val("#{event.visibility}")
if(event.pentrytype === "event")
.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 = (event.pentrytype === "tevent" && event.parent_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-when_end_then_start="bar",
data-when_end_then_start-error="Wenn Sie ein Ende angeben, müssen Sie auch einen Beginn angeben!",
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", checked=event.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"));
});
.row
div(class="col-xs-12 col-sm-6", style="margin-bottom: 20px;")
fieldset(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: pcal_pentry_edit_manager.save_and_goto('add_predefined_location', {});")
+dropdown_button_element_href("Manuell", "javascript: pcal_pentry_edit_manager.save_and_goto('add_location', {});")
+location_list(event.locations)
#messageview_locations
if messages.locations.length > 0
+messageview(messages.locations)
fieldset(class="col-xs-12 col-sm-6", id="involved")
legend(style="font-size: 150%;") Beteiligte
div(class="col-sm-12", style="padding-right: 0px;")
fieldset
+involved_list_label("Allgemein", "font-size: 130%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(event.involved, "Allgemein", "")
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)
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="pcal_pentry_edit_manager.save_and_goto('add_role', {});")
span( class="glyphicon glyphicon-plus", aria-hidden="true")
span
span Dienst hinzufügen
div
if event.involved_roles.length === 0
.col-sm-12
p Keine Dienste angegeben.
else
each role in event.involved_roles
div(class="col-sm-12", style="padding-right: 0px; margin-top: 5px;")
fieldset(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)
div(id="messageview_involved_" + role.uid)
if messages.involved[role.uid] && messages.involved[role.uid].length > 0
+messageview(messages.involved[role.uid])
.row
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}
.row
fieldset(class="col-sm-12", style="margin-top: 20px; padding-bottom: 200px;")
legend(style="font-size: 150%") Anmerkungen
textarea(class="form-control", rows="5", id="area_annotations", name="area_annotations").
#{event.annotations}

View File

@@ -0,0 +1,34 @@
include ../mixins
form.form-horizontal.subroot#form_pentry(role="form", method="POST", action="")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{keep_in_mind.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{keep_in_mind.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="pcal_pentry_edit_manager.save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Kurzbeschreibung
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{keep_in_mind.name}", required)
.help-block.with-errors
.row
fieldset(class="col-sm-12", style="margin-top: 20px; padding-bottom: 200px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{keep_in_mind.description}

44
views/pcal/edit_todo.jade Normal file
View File

@@ -0,0 +1,44 @@
include ../mixins
include ../mixins_pentryedit
form.form-horizontal.subroot#form_pentry(role="form", method="POST", action="")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{todo.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{todo.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="pcal_pentry_edit_manager.save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='edit_name', class="col-sm-2 control-label") Kurzbeschreibung
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{todo.name}", required)
.help-block.with-errors
.row
fieldset(class="col-sm-12", style="margin-top: 10px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{todo.description}
.row(style="margin-bottom: 75px;")
div(class="col-sm-12", style="margin-top: 20px;", id="involved")
fieldset
+involved_list_label("Beteiligte", "font-size: 150%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(todo.involved, "Beteiligte", "")
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)

View File

@@ -0,0 +1,51 @@
include ../mixins
include ../mixins_pentryedit
form.form-horizontal.subroot#form_pentry(role="form", method="POST", action="")
.new_flex_zero(style="margin-bottom: 20px;")
.container-fluid
button(class="btn btn-success btn-xs", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
+messageview(messages.other)
.new_flex_one
.container-fluid
.form-group
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="#{vehicle_use.punit.dn}")
input(id="edit_kontext", type="text", name="punit_name", class="form-control", value="#{vehicle_use.punit.name}", readonly)
span(class="input-group-btn")
button(class="btn btn-default", type="button", onclick="pcal_pentry_edit_manager.save_and_goto('select_pastoralunit', {})") Ändern
.form-group
label(for='combo_vehicle', class="col-sm-2 control-label") Typ
.col-sm-10
select(id='combo_vehicle', name="combo_vehicle", class="form-control")
each v in vehicles
option(value="#{v.id}") <b>#{v.name}</b> (#{v.pretty.unit})
script.
$("#combo_vehicle").val("#{vehicle_use.vehicle_id}")
.form-group
label(for='edit_name', class="col-sm-2 control-label") Kurzbeschreibung
.col-sm-10
input(id='edit_name', type="text", class="form-control noEnterSubmit", name="edit_name", value="#{vehicle_use.name}", required)
.help-block.with-errors
.row
fieldset(class="col-sm-12", style="margin-top: 10px;")
legend(style="font-size: 150%") Beschreibung
textarea(class="form-control", rows="5", id="area_description", name="area_description").
#{vehicle_use.description}
.row(style="margin-bottom: 75px;")
div(class="col-sm-12", style="margin-top: 20px;", id="involved")
fieldset
+involved_list_label("Beteiligte", "font-size: 150%; margin-bottom: 5px;", "font-style: italic;", "")
+involved_list(vehicle_use.involved, "Beteiligte", "")
#messageview_involved_primary
if messages.involved.primary.length > 0
+messageview(messages.involved.primary)

View File

@@ -0,0 +1,38 @@
include ../mixins
.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#pcal_pentry_clone_move_new_date(type="hidden", value="#{date.date}")
button(class="btn btn-success btn-sm", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span #{clone_or_move_pretty_noun}
.alert.alert-danger#pcal_pentry_clone_move_alert(style="display: none;")
a(class="close", onclick="$('#pcal_pentry_clone_move_alert').hide();") &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#pcal_pentry_clone_move_scroll_parent(style="margin-top: 15px;")
.container-fluid
#pcal_pentry_clone_move_datepicker.cell_element(data-date="#{date.date}", style="vertical-align: top;")
.cell_element.give_margin_left#pcal_pentry_clone_move_dayinfo(style="width: 100%;")

View File

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

View File

@@ -0,0 +1,13 @@
include ../mixins
.root#pentry_edit_root
.new_flex_zero
+nav_with_form("PfarrInfoSystem", "PfIS", "entryeditnav")
.container-fluid
h1 #{pentrytype_pretty} #{edit_type}
.small #{date.weekday_short}, #{date.day}. #{date.month} #{date.year}
.subroot(style="height: 100%;")
.container-fluid
p Lade Kalendereintrag ...

329
views/pcalimport.jade Normal file
View File

@@ -0,0 +1,329 @@
include mixins
doctype strict
html
include header
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/pcalimport_changes.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; }
}
.changes_details {
/*max-height: 300px;
overflow-y: scroll;*/
margin-top: 10px;
}
.day_details {
max-height: 300px;
min-height: 200px;
overflow-y: scroll;
}
body
.modal.fade(id="collectUserDataDialog", role="dialog", aria-labelledby="collectUserDataDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="collectUserDataDialogLabel") Benutzer-Einträge auslesen
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Einträge der Benutzer von PfIS zusammengestellt werden ...
.modal.fade(id="fileUploadDialog", role="dialog", aria-labelledby="fileUploadDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="fileUploadDialogLabel") Datei hochladen und auswerten
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Datei hochgeladen und die Einträge ausgewertet werden ...
.modal.fade(id="compileDialog", role="dialog", aria-labelledby="compileDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="compileDialogLabel") Pfarrkalender kompilieren
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während der Pfarrkalender neu kompiliert wird ...
.modal.fade(id="messagesDialog", role="dialog", aria-labelledby="messagesDialogLabel", 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="confirmRejectLabel") Meldungen
.modal-body(style="overflow-y: auto; max-height: calc(100vh - 210px);")
p
b Bitte beachten Sie folgende Meldungen!
#messages
.modal-footer
button(type="button", class="btn btn-primary", data-dismiss="modal") Schließen
.modal.fade(id="confirmReject", role="dialog", aria-labelledby="confirmRejectLabel", 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="confirmRejectLabel") Ablehnung bestätigen
.modal-body
p Sind Sie sicher, dass Sie diese Änderung verwerfen wollen?
br
span Die entsprechende Datei wird vom Datenträger gelöscht!
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-danger", id="confirm_reject") Änderung tatsächlich ablehnen
.modal.fade(id="confirmRemove", role="dialog", aria-labelledby="confirmRemoveLabel", 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="confirmRemoveLabel") Löschen bestätigen
.modal-body
p Sind Sie sicher, dass Sie den aktuellen Kalendereintrag löschen wollen?
br
span Er wird unwiederbringlich gelöscht!
.modal-footer
button(type="button", class="btn btn-default", data-dismiss="modal") Abbrechen
button(type="button", class="btn btn-danger", id="confirm_remove") Kalendereintrag tatsächlich löschen
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Elemente in den Pfarrkalender importieren
p Lesen sie alle von den Nutzern von PfIS erstellten Kalender-Einträge aus bzw. importieren Sie eine Datei und entscheiden Sie, welche Einträge übernommen werden sollen.
.btn-toolbar(style="margin-bottom: 20px;")
.btn-group.btn-group-xs
button.btn.btn-primary.button-import-userdata Einträge der Nutzer auslesen
.btn-group.btn-group-xs
button.btn.btn-primary.button-import-file(onclick="$('#fileinput').click();") Datei importieren
input(type="file", id="fileinput", style="display: block; visibility: hidden; width: 0; height: 0;")
.btn-group.btn-group-xs(style="margin-left: 25px;")
button.btn.btn-warning#button_compile_calendar Pfarrkalender neu kompilieren
.subroot#changes_parent(style="flex-direction: row; flex: 1;")
//- height: 100%;
//- var parishid = 0;
//-each parish in parishes
//- - var my_uid = generateUID();
//- if(parish.volunteergroups.length > 0)
//- .panel.panel-default.parish-marker(style="border-width: 3px;", data-parishid=parishid)
//- .panel-heading
//- h4.panel-title(data-toggle="collapse", data-target="#PANEL_#{my_uid}", aria-expanded="false", aria-controls="PANEL_#{my_uid}", style="cursor: pointer;") #{parish.name}
//- .panel-collapse.collapse(id="PANEL_#{my_uid}")
//- .panel-body(style="padding: 10px;")
//- .container-fluid
//- .row
//- button.btn.btn-primary.btn-xs.button-select-all Alle auswählen
//- button.btn.btn-default.btn-xs.button-deselect-all Alle abwählen
//- table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
//- thead
//- tr
//- td <b>Name</b>
//- tbody
//- for grp in parish.volunteergroups
//- tr(onclick="$(this).toggleClass('group_is_selected'); update_button_volunteergroupsselected();", style="cursor: pointer;", data-dn="#{grp.dn}", data-group)
//- td #{grp.name}
//- - parishid++;
script.
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
$(".button-import-userdata").on('click', function(event) {
$('#collectUserDataDialog').modal({
backdrop: 'static',
keyboard: false
});
ws.send('collect_userdata', {});
});
$("#fileinput").on('change', function(event) {
var files=$("#fileinput").prop('files');
if(files.length === 0)
return
console.log(files);
console.log(files.length);
$('#fileUploadDialog').modal({
backdrop: 'static',
keyboard: false
});
for (var i = 0, numFiles = files.length; i < numFiles; i++) {
var file = files[i];
var reader = new FileReader();
reader.onload = (function(aFile) { return function(e) {
var data = {
name : aFile.name,
size : aFile.size,
type : aFile.type,
content : e.target.result
};
$("#fileinput").val("");
ws.send('fileupload', data);
}})(file);
reader.readAsDataURL(file);
}
});
ws.bind("collected_changes", function(data) {
var html = pcalimport_changes_template(data);
if(data.source==="user-data")
$('#collectUserDataDialog').modal('hide');
else
$('#fileUploadDialog').modal('hide');
$("#changes_parent").empty();
if(data.messages.length > 0) {
var msg_elem = $('#messagesDialog').find('#messages');
msg_elem.empty();
$.each(data.messages, function(idx, elem){
msg_elem.append('<div class="alert alert-' + elem.type + '" role="alert"><strong>'+ elem.title +'</strong> ' + elem.message + '</div>');
});
$('#messagesDialog').modal({
backdrop: 'static',
keyboard: false
});
}
$("#changes_parent").html(html);
// install click-handler for new accept-buttons
$("#changes_parent").find(".btn-success").on('click', on_click_accept);
$('html, body').scrollTop(0);
});
function collect_change_data(elem) {
var change = elem.closest('.tab-pane');
var pentry = elem.closest('.pentry_marker');
var pday = elem.closest('.pday_marker');
var data = {
change_idx: change.data('change-idx'),
change_type: change.data('change-type'),
pentry_uuid: pentry.data('pentry-uuid'),
pentry_type: pentry.data('pentry-type'),
pday_date: pday.data('pday-date')
};
return data;
}
function find_pentry_change(data) {
var pday = $('.pday_marker[data-pday-date="'+data.pday_date+'"]');
var pentry = pday.find('.pentry_marker[data-pentry-uuid="'+data.pentry_uuid+'"]');
var change = pentry.find('.tab-pane[data-change-idx="'+data.change_idx+'"]');
return change;
}
function on_click_accept() {
var data = collect_change_data($(this));
if(data.change_type === "remove")
{
$('#confirmRemove').data('change_data', data);
$('#confirmRemove').modal('show');
return
}
$(this).closest('.btn-group').find('.btn').attr('disabled', 'disabled');
ws.send('accept_change', data);
}
$('#confirmRemove').find('.modal-footer #confirm_remove').on('click', function() {
$('#confirmRemove').modal('hide');
var data = $('#confirmRemove').data('change_data');
var elem = find_pentry_change(data);
elem.find('.btn-group').find('.btn').attr('disabled', 'disabled');
ws.send('accept_change', data);
});
$('#confirmReject').on('show.bs.modal', function (e) {
$(this).data('related_button', e.relatedTarget);
});
$('#confirmReject').find('.modal-footer #confirm_reject').on('click', function() {
var button = $('#confirmReject').data('related_button');
$(button).closest('.btn-group').find('.btn').attr('disabled', 'disabled');
$('#confirmReject').modal('hide');
var data = collect_change_data($(button));
ws.send('reject_change', data);
});
ws.bind('accept_change_result', function(data) {
console.log('accept_change_result', data);
var elem = find_pentry_change(data.data);
if(data.result !== "OK") {
alert("Das Annehmen der Änderung war nicht erfolgreich!")
elem.find('.btn-group').find('.btn').removeAttr('disabled');
return;
}
elem = elem.find('.change_info');
elem.append('<span style="color: green;"><b>Diese Änderung wurde angenommen!</b></span>');
elem.show();
var html = pentrymove_parishday_template({day: data.day } );
var day_details = elem.closest('.pday_marker').closest('.tab-pane').find('.day_details');
day_details.empty();
day_details.html(html);
});
ws.bind('reject_change_result', function(data) {
console.log('reject_change_result', data);
var elem = find_pentry_change(data.data);
if(data.result !== "OK") {
alert("Das Zurückweisen der Änderung war nicht erfolgreich!")
elem.find('.btn-group').find('.btn').removeAttr('disabled');
return;
}
elem = elem.find('.change_info');
elem.append('<span style="color: red;"><b>Diese Änderung wurde abgelehnt!</b></span>');
elem.show();
});
$('#button_compile_calendar').on('click', function(){
$('#compileDialog').modal({
backdrop: 'static',
keyboard: false
});
ws.send('compile_calendar', {});
});
ws.bind('compile_calendar_result', function(data) {
if(data.result !== "OK")
alert("Fehler beim Kompilieren des Pfarrkalenders");
$('#compileDialog').modal('hide');
});

View File

@@ -0,0 +1,166 @@
include mixins_week
mixin show_changes(pentrys, n)
if(pentrys.length > 0)
fieldset
legend !{n}
each pentry in pentrys
- var my_uid = generateUID();
.panel.panel-primary(style="margin-left: 10px;")
.panel-heading
h3.panel-title(data-toggle="collapse", data-target="#"+my_uid, style="cursor: pointer;") !{pentry.name}
.small(style="font-size: 85%;")
i !{pentry.punit}
.panel-collapse.collapse(id=my_uid)
.panel-body
ul.nav.nav-tabs
each c in pentry.changes
- var cls = (c.idx === 0 ? "active" : "");
- c.tab_id = generateUID();
- var color = c.type === "new" ? "green" : (c.type==="remove" ? "red" : "gold")
li(class=cls, style="border-bottom: 3px solid " + color +";")
a(data-toggle="tab", href="#"+c.tab_id)
b !{c.user}
.tab-content(style="padding-left: 10px; padding-right: 10px;")
each c in pentry.changes
- var cls = (c.idx === 0 ? "active" : "");
- var clss = ["tab-pane", cls]
div(class=clss, id=c.tab_id)
.btn-group.btn-group-sm(style="margin-top: 10px;")
button.btn.btn-success Akzeptieren
button.btn.btn-danger(data-toggle="modal", data-target="#confirmReject") Ablehnen
.changes_details
if(c.type !== "new")
if(pentry.punit !== c.punit)
p(style="margin-bottom: 10px;")
b !{c.punit}
else
p.small(style="margin-bottom: 10px;")
b Gleicher pastoraler Kontext.
if(c.diff !== "")
p(style="margin-bottom: 0px;")
b Diff
pre
code !{c.diff}
p(style="margin-bottom: 0px;")
b Roh-Daten
pre
code !{c.data}
mixin pday_with_changes(pday)
.panel.panel-default(data-date=pday.date)
.panel-heading
h3.panel-title(data-toggle="collapse", data-target="#PANEL_#{pday.date}", aria-expanded="false", aria-controls="PANEL_#{pday.date}", style="cursor: pointer;") !{pday.date_pretty}
.panel-collapse.collapse(id="PANEL_#{pday.date}")
.panel-body(style="padding: 10px;")
- var celebration_printed = false;
.day_details
table(width="100%")
+week_day_mobile(pday.day)
mixin show_pentry_changes(pentry, data)
- var cls_pentry = (data.idx === 0 ? "active" : ""); data.idx++;
- var clss_pentry = ["tab-pane", cls_pentry]
div.pentry_marker(class=clss_pentry, id=pentry.uid, style="height: 100%; padding-left: 15px;", data-pentry-uuid=pentry.uuid, data-pentry-type=pentry.pentry_type)
div(style="height: 100%; display: flex; flex-direction: column;")
ul.nav.nav-tabs
each c in pentry.changes
- var cls = (c.idx === 0 ? "active" : "");
- c.tab_id = generateUID();
- var color = c.type === "new" ? "green" : (c.type==="remove" ? "red" : "gold")
li(class=cls, style="border-bottom: 3px solid " + color +";")
a(data-toggle="tab", href="#"+c.tab_id)
b !{c.user}
.tab-content(style="padding-left: 10px; padding-right: 10px; flex: 1; overflow: auto; border-left: 1px solid #ddd;")
each c in pentry.changes
- var cls = (c.idx === 0 ? "active" : "");
- var clss = ["tab-pane", cls]
div(class=clss, id=c.tab_id, style="height: 100%;", data-change-idx=c.idx, data-change-type=c.type)
.btn-group.btn-group-sm(style="margin-top: 10px;")
button.btn.btn-success Akzeptieren
button.btn.btn-danger(data-toggle="modal", data-target="#confirmReject") Ablehnen
.changes_details
p.change_info(style="display: none; margin-bottom: 10px;")
if(c.age !== "")
p(style="margin-bottom: 10px;")
b Alter: !{c.age}
if(c.type !== "new")
if(pentry.punit !== c.punit)
p(style="margin-bottom: 10px;")
b !{c.punit}
else
p.small(style="margin-bottom: 10px;")
b Gleicher pastoraler Kontext.
if(c.diff !== "")
p(style="margin-bottom: 0px;")
b Diff
pre
code !{c.diff}
p(style="margin-bottom: 0px;")
b Roh-Daten
pre
code !{c.data}
mixin show_pentry_changes_menu(pentries, name, data)
if(pentries.length > 0)
p(style="margin-bottom: 0px;")
b !{name}
each elem in pentries
- var cls_elem = (data.idx === 0 ? "active" : ""); data.idx++;
- elem.uid = generateUID();
li(class=cls_elem)
a(data-toggle="pill", href="#" + elem.uid) !{elem.name}
.small !{elem.punit}
hr
div(style="width: 200px; overflow: auto; padding-left: 15px;")
ul.nav.nav-pills.nav-stacked
- var idx = 0;
each pday in changes
- var cls = (idx === 0 ? "active" : ""); idx++;
- pday.uid = generateUID();
li(class=cls)
a(data-toggle="pill", href="#"+pday.uid) !{pday.date_pretty}
div(style="flex: 1; padding-left: 20px;")
.tab-content(style="height: 100%;")
- var idx = 0;
each pday in changes
- var cls = (idx === 0 ? "active" : ""); idx++;
- var clss = ["tab-pane", cls]
div(class=clss, id=pday.uid, style="height: 100%;")
div(style="display: flex; flex-direction: column; overflow: hidden; height: 100%;")
//- var celebration_printed = false;
.day_details(style="border-bottom: 2px solid #000000;")
table(style="width: 100%;")
+week_day_mobile(pday.day)
.subroot.pday_marker(style="flex: 1; flex-direction: row; padding-top: 10px;", data-pday-date=pday.date)
div(style="width: 250px; overflow: auto;")
- var data = { idx: 0 };
ul.nav.nav-pills.nav-stacked
+show_pentry_changes_menu(pday.events, "Ereignisse", data)
+show_pentry_changes_menu(pday.todos, "Zu Tun", data)
+show_pentry_changes_menu(pday.away, "Abwesenheiten", data)
+show_pentry_changes_menu(pday.keep_in_mind, "Zu Beachten", data)
+show_pentry_changes_menu(pday.vehicle_use, "Fahrzeugbenutzung", data)
div(style="flex: 1;")
.tab-content(style="height: 100%;")
- var data = { idx: 0 };
each pentry in pday.events
+show_pentry_changes(pentry, data)
each pentry in pday.todos
+show_pentry_changes(pentry, data)
each pentry in pday.away
+show_pentry_changes(pentry, data)
each pentry in pday.keep_in_mind
+show_pentry_changes(pentry, data)
each pentry in pday.vehicle_use
+show_pentry_changes(pentry, data)

461
views/pcalpub.jade Normal file
View File

@@ -0,0 +1,461 @@
- var publicationformats_string = JSON.stringify(publicationformats);
include mixins
include mixins_pcalpub
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='/javascripts/pfiswebsocket.js')
script(src='/templates/emailaddresschooser_inlay.js')
script(src='/templates/pcalpub_summary.js')
script(src="/javascripts/runtime.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 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
.modal.fade(id="initSendingDialog", role="dialog", aria-labelledby="initSendingLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="initSendingLabel") TV per eMail senden
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die eMail vorbereitet wird ...
#emaileditor.sidewideoverlay(style="z-index: 5;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "emaileditor_menu")
.container-fluid
h1 Eine Terminveröffentlichung erstellen
.small eMail vor dem Versenden bearbeiten
h4
span#emaileditor_parish_name
span :
span#emaileditor_factory_name
.small#emaileditor_timespan(style="font-size: 80%; white-space: nowrap;")
nav
ul.pager
li.previous
span(onclick="$('#mainpanel').show(); $('#emaileditor').hide(); $('html, body').scrollTop(0);") Zurück
li.next
span(onclick="save_html();") Weiter
.new_flex_one#editorparent
div(style="margin-bottom: 15px; margin-left: 15px; margin-right: 15px;")
textarea#html_for_email
#addresschooser.sidewideoverlay(style="z-index: 10;")
.root
.new_flex_zero
+nav_with_form("PfarrInfoSystem", "PfIS", "entryeditnav")
.container-fluid
h1 Eine Terminveröffentlichung erstellen
.small Adressaten auswählen
h4
span#addresschooser_parish_name
span :
span#addresschooser_factory_name
.small#addresschooser_timespan(style="font-size: 80%; white-space: nowrap;")
nav
ul.pager
li.previous
span(onclick="show_emaileditor('#addresschooser');") Zurück
li.next.disabled
span#addresschooser_next_button( onclick="if($(this).parent().hasClass('disabled')){return;} save_emailaddresses();",
title="Sie müssen mindestens einen Empfänger angeben!"
) Weiter
+emaildestinationview([], [], [], false, "")
.new_flex_one
.container-fluid#addresschooserpane
#summary.sidewideoverlay(style="z-index: 15;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "summary_nav")
.container-fluid
h1 Eine Terminveröffentlichung erstellen
.small Zusammenfassung
h4
span#summary_parish_name
span :
span#summary_factory_name
.small#summary_timespan
p Bitte überprüfen Sie nochmal alle Angaben!
nav
ul.pager
li.previous
a(href="#", onclick="show_addresschooser('#summary');") Zurück
li.next
a(href="#", data-toggle="modal", data-target="#sendEmail", data-backdrop="static", data-keyboard="false") eMail senden
.new_flex_one
.container-fluid#summarypane
#mainpanel
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Eine Terminveröffentlichung erstellen
.new_flex_one(style="margin-bottom: 10px;")
.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) {
console.log($("#entryeditnav-form"));
$("#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);");
var publicationformats = !{publicationformats_string};
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
console.log(full);
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();
// WebSocket setup
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
// 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');
ws.send('pcalpub_generate_html', { parishid : selectedParish, factoryid : selectedFactory, date: date, durance : durance});
return false;
}
ws.bind('pcalpub_generate_html_result', function(data) {
the_new_win.location=data.file;
the_new_win.document.title=data.title;
});
function pcalpub_generate_and_view_document() {
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() == '')
ws.send('pcalpub_generate_pdf', { parishid : selectedParish, factoryid : selectedFactory, date: date, durance : durance, use_background: false});
else {
var files = $('#fileinput').prop('files');
console.log(files);
console.log(files.length);
$("#upload_pending_indicator").show();
for (var i = 0, numFiles = files.length; i < numFiles; i++) {
var file = files[i];
console.log(file.name);
console.log(file.size);
console.log(file.type);
var reader = new FileReader();
reader.onload = (function(aFile) { return function(e) {
var data = {
name : aFile.name,
size : aFile.size,
type : aFile.type,
content : e.target.result
};
ws.send('fileupload', data);
}})(file);
reader.readAsDataURL(file);
}
}
}
ws.bind('fileupload_result', function(data) {
if(data.result === "ERROR") {
alert(data.message);
return;
}
console.log('fileupload_result', data);
$("#upload_pending_indicator").hide();
var selectedParish = $("#combo_parish").prop('selectedIndex');
var selectedFactory = $("#combo_factory").prop('selectedIndex');
var durance = parseInt($("#combo_durance").val());
var date = $("#datepicker").datepicker('getFormattedDate');
ws.send('pcalpub_generate_pdf', { parishid : selectedParish, factoryid : selectedFactory, date: date, durance : durance, use_background: true });
});
ws.bind('pcalpub_generate_pdf_result', function(data) {
the_new_win.location=data.file;
the_new_win.document.title=data.title;
});
// ONE SHOT FUNCTIONS END
function pcalpub_send_html_per_email() {
$('#initSendingDialog').modal({
backdrop: 'static',
keyboard: false
});
var mydata = {
publicationformats : publicationformats,
parishid: $("#combo_parish").prop('selectedIndex'),
factoryid: $("#combo_factory").prop('selectedIndex'),
durance: parseInt($("#combo_durance").val()),
date: $("#datepicker").datepicker('getFormattedDate')
};
ws.send('init_send_per_email', mydata);
}
tinymce.editors=[];
tinymce.init({
selector: '#html_for_email',
height: '100%',
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
});
ws.bind('init_send_per_email_result', function(data) {
console.log('generate_html_for_email_result');
if(data.result === "ERROR") {
alert(data.message);
$("#initSendingDialog").modal('hide');
return;
}
// setup emaileditor
$("#emaileditor_parish_name").text(data.parish_name);
$("#emaileditor_factory_name").text(data.factory_name);
$("#emaileditor_timespan").text(data.timespan);
tinymce.get('html_for_email').setContent(decodeURIComponent(escape(window.atob(data.html))));
// setup addresschooser
$("#addresschooser_parish_name").text(data.parish_name);
$("#addresschooser_factory_name").text(data.factory_name);
$("#addresschooser_timespan").text(data.timespan);
var myhtml = emailaddresschooser_inlay_template({parishdb: data.parishdb});
$("#addresschooserpane").html(myhtml);
init_form_emailaddresschooser_direct();
// setup summary
$("#summary_parish_name").text(data.parish_name);
$("#summary_factory_name").text(data.factory_name);
$("#summary_timespan").text(data.timespan);
show_emaileditor("#mainpanel");
$("#initSendingDialog").modal('hide');
});
function show_emaileditor(calling_from_id) {
$("#emaileditor").show();
$(calling_from_id).hide();
setTimeout(function(){
tinymce.get('html_for_email').execCommand('mceAutoResize');
$("#editorparent").scrollTop(0);
}, 100);
$("html, body").scrollTop(0);
}
function update_sendbutton(to_is_filled) {
console.log('update_sendbutton: ', to_is_filled);
if(to_is_filled) {
$('#addresschooser_next_button').parent().removeClass('disabled');
$('#addresschooser_next_button').prop('title','');
}
else {
$('#addresschooser_next_button').parent().addClass('disabled');
$('#addresschooser_next_button').prop('title','Sie müssen mindestens einen Empfänger angeben!');
}
}
function save_html() {
var mydata = { html : tinymce.get('html_for_email').getContent() };
ws.send('save_html', mydata);
}
ws.bind('save_html_result', function(data) {
if(data.result === "ERROR") {
alert(data.message);
return;
}
show_addresschooser("#emaileditor");
});
function show_addresschooser(calling_from_id) {
$("#addresschooser").show();
$(calling_from_id).hide();
$("#addresschooserpane").parent().scrollTop(0);
$("html, body").scrollTop(0);
}
function save_emailaddresses() {
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")
};
if(data.dest_to.length === 0) {
// this has not to happen, but might happen, if we click 'forward' with removed email-adresses!!!
// -> go back
console.log('ERROR_IN_SUBMIT_EMAILADDRESSES!');
return;
}
ws.send('save_emailaddresses', data);
}
ws.bind('save_emailaddresses_result', function(data) {
if(data.result === "ERROR") {
alert(data.message);
return;
}
var myhtml = pcalpub_summary_template(data);
$("#summarypane").html(myhtml);
show_summary('#addresschooser')
});
function show_summary(calling_from_id) {
$("#summary").show();
$(calling_from_id).hide();
$("#summarypane").parent().scrollTop(0);
$("html, body").scrollTop(0);
}
$('#sendEmail').on('show.bs.modal', function (e) {
is_sending = true;
$("#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();
ws.send('send_html', {});
});
$("#sendEmail").on('hidden.bs.modal', function(e) {
is_sending = false;
$("#button_summary_back").show();
$("#button_summary_send").show();
});
ws.bind('send_html_step', function(step) {
console.log('STEP', step);
$("#" + step.id).removeClass($("#" + step.id).prop('class'));
$("#" + step.id).addClass("glyphicon " + step.glyphicon);
});
ws.bind('send_html_result', function(result) {
/*if(result.result === "ERROR") {
alert(result.message);
return;
}*/
console.log('RESULT', result);
$("#sendEmail_message").html(result.message);
$("#sendEmail_explanation").html(result.explanation);
$("#sendEmail_closebutton").show();
});
+email_scripts("", "update_sendbutton", "confirmDelete")

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}

30
views/pcalpub_send.jade Normal file
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,26 @@
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}

View File

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

View File

@@ -0,0 +1,99 @@
include mixins
- var my_roles_string = JSON.stringify(roles);
- var my_already_defined_roles = JSON.stringify(already_defined_roles);
form(class="form-horizontal subroot full_height", id="form-roleeditor")
.new_flex_zero(style="padding-bottom: 20px;")
.container-fluid
h4 Namen für den Dienst angeben
input(type="hidden", name="role_uid", id="role_uid", value="#{role_uid}")
button(class="btn btn-success btn-sm", type="submit", id="submit_button")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
button(class="btn btn-warning btn-sm", type="button", onclick="goto_mainpage();")
span(class="glyphicon glyphicon-remove-circle", aria-hidden="true")
span
span Abbrechen
.new_flex_one
.container-fluid
.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)
});
$('#form-roleeditor').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 "Ein Dienst mit gleichem Namen existiert bereits; bitte wählen Sie einen anderen Namen!";
}
}
}
}).on('submit', function(e) {
if( ! e.isDefaultPrevented() )
{
e.preventDefault();
var data = {
name : $("#role_name").val(),
uid : $("#role_uid").val()
};
switch("#{type}")
{
case "add":
pcal_pentry_edit_manager.event_add_role(data);
break;
case "edit":
pcal_pentry_edit_manager.event_edit_role(data);
break;
}
}
});

View File

@@ -0,0 +1,65 @@
include mixins
//- var evp = JSON.parse(exclude_from_view);
- var evps = [];
- for(var i in exclude_from_view) { if(exclude_from_view.hasOwnProperty(i) && !isNaN(+i)) { evps[+i] = exclude_from_view[i]; } }
- var evps_string = evps.toString();
mixin punit(pu)
li(class="list-group-item")
- set_checked = true;
- evps.some(function(e, i, a) { if(e === pu.dn) set_checked=false;});
input(type="checkbox", id=pu.dn, checked=set_checked)
label(for=pu.dn) &nbsp;#{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;")
.root(style="overflow: hidden;")
.new_flex_zero
+nav("PfarrInfoSystem", "dropdown_menu")
.container-fluid(style="margin-bottom: 18px;")
p.
Wählen Sie aus, welche pastoralen Kontexte in der Ansicht angezeigt werden sollen.
form(class="form-horizontal" method="post", action="/select_punits_for_view")
input(type="hidden", name="u", value="#{u}")
input(type="hidden", name="d", value="#{d}")
input(type="hidden", name="exclude_from_view", id="exclude_from_view", value="#{evps_string}")
button(class="btn btn-success btn-xs", type="submit")
span(class="glyphicon glyphicon-ok", aria-hidden="true")
span
span Übernehmen
.new_flex_one(style="overflow: auto; padding-left: 15px; padding-right: 15px;")
ul(class="list-group")
for pu in pastoralunits
+punit(pu)
script.
// console.log($( "#ekmd\\/kk_sonneberg\\/p_judenbach-heinersdorf" ).prop("checked"));
$( "form" ).submit(function( event ) {
var cbs = $("[type=checkbox]");
var excludes = [];
for(i=0; i<cbs.length; i++) {
if($(cbs[i]).prop('checked') === false)
{
console.log("NOT CHECKED: " + $(cbs[i]).attr('id'));
excludes.push($(cbs[i]).attr('id'));
}
}
$("#exclude_from_view").val(excludes.toString());
/* console.log($("#exclude_from_view").val()); */
});

197
views/sockettest.jade Normal file
View File

@@ -0,0 +1,197 @@
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='/javascripts/pfiswebsocket.js')
script(src='/javascripts/runtime.js')
script(src='/templates/daycontent.js')
body
+standard_delete_dialog("confirmDelete")
.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!")
#the_wall.new_flex_one(style="margin-bottom: 15px; padding-left: 15px; padding-right: 15px; overflow: auto;")
#daycontentparent
button(style="btn btn-default", onclick="day_goto('2016-02-04');") Daycontent
fieldset
legend(style="font-size: 120%; margin-bottom: 0px;") Anhänge
#attachments_parent
p <i>Keine Anhänge vorhanden.</i>
//- 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}")
input(type="file", id="fileupload", style="margin-top: 10px;")
p#upload_pending_indicator(style='display: none; text-style: italic;') Datei wird hochgeladen...
//- button#fileuploadbutton(type="button", class="btn btn-default btn-xs", onclick="do_fileupload();", disabled) Datei hochladen
script.
var ws = new PfISWebSocket("#{sessionuuid}"/*, "#{taskuuid}"*/);
ws.bind_standard_close_handler();
ws.bind('open', function() {
console.log('OPEN');
ws.send('mymessage', {data: 'ABC', code: 'DEF'});
});
ws.bind('close', function() {
console.log('CLOSED');
$("#the_wall").append('<p>connection closed</p>');
});
ws.bind('mymessage', function(data) { console.log('mymessage:', data); });
ws.bind('fileupload_result', function(data) { console.log(data); add_attachment(data)});
function day_goto(d) {
ws.send('get_parishday', {"format" : "day", "date" : d});
}
ws.bind('get_parishday_result', function(result) {
var dc = daycontent_template(result);
console.log(dc);
$('#daycontentparent').empty();
$('#daycontentparent').append(dc);
});
function add_attachment(file) {
var the_table = $("#attachments");
if(the_table.length === 0) {
$("#attachments_parent").empty();
// <thead><tr><td width='75%'><span style='color: grey; font-size: 80%;'>Name</span></td><td width='20%'><span style='color: grey; font-size: 80%;'>Typ</span></td><td width='5%'></td></tr></thead>
$("#attachments_parent").append("<table width='100%' class='table table-condensed' style='margin-bottom: 10px;' id='attachments'></table>");
the_table = $("#attachments");
}
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="Anhang", data-delete-name="' + file.name + '"></span>';
// width='90%'
the_table.append("<tr id='" + file.uid + "'><td width='5%'>" + the_delete + "</td><td><p style='margin-bottom: 0px;'>" + file.name + "</p><p class='parishdbelemspane_elem_kontext', style='font-size: 80%;'>(" + file.type + ")</p></td></tr>");
$("#upload_pending_indicator").hide();
}
$('#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 Anhang 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);
if($etype === 'Anhang')
{
ws.send("fileupload_remove", {uid: $(this).data('tr').prop('id')});
return;
}
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 Anhänge vorhanden.</i></p>");
}
else
tr.remove();
$('#confirmDelete').modal('hide');
});
ws.bind('fileupload_remove_result', function(data) {
console.log(data);
var tr = $("#"+data.uid);
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><i>Keine Anhänge vorhanden.</i></p>");
}
else
tr.remove();
$('#confirmDelete').modal('hide');
});
$("#fileupload").on('change', function(e){
var files=$("#fileupload").prop('files');
/*if(files.length === 0)
$("#fileuploadbutton").prop('disabled', true);
else
$("#fileuploadbutton").prop('disabled', false);*/
do_fileupload();
});
function do_fileupload() {
var files=$("#fileupload").prop('files');
if(files.length === 0)
return;
console.log(files);
console.log(files.length);
$("#upload_pending_indicator").show();
// $("#fileuploadbutton").prop('disabled', true);
for (var i = 0, numFiles = files.length; i < numFiles; i++) {
var file = files[i];
console.log(file.name);
console.log(file.size);
console.log(file.type);
var reader = new FileReader();
reader.onload = (function(aFile) { return function(e) {
var data = {
name : aFile.name,
size : aFile.size,
type : aFile.type,
content : e.target.result,
uid : generateUID()
};
ws.send('fileupload', data);
}})(file);
reader.readAsDataURL(file);
}
$("#fileupload").val('');
}

View File

@@ -0,0 +1,45 @@
include mixins
include mixins_day
.new_flex_zero
.container-fluid
//- history.back()
button(class="btn btn-success btn-sm", 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="padding-top: 15px;")
.container-fluid
+pevent_with_thereafter(date.date, event, { details: true, links: true, clickable: false, pcalview: pcalview})

View File

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

259
views/volunteerslist.jade Normal file
View File

@@ -0,0 +1,259 @@
include mixins
doctype strict
html
include header
script(src='/javascripts/pfiswebsocket.js')
script(src='/templates/volunteerslist_result.js')
script(src='/javascripts/runtime.js')
style.
.group_is_selected { background-color: yellow; }
.person_divider { margin-bottom: 5px;}
.person_name { font-weight: bold; margin-bottom: 0px; }
.group_name { font-size: 10px; font-style: italic; margin-bottom: 0px; }
.person_in_group { margin-bottom: 2px; }
body
.modal.fade(id="generateLettersDialog", role="dialog", aria-labelledby="generateLettersDialogLabel", aria-hidden="true")
.modal-dialog(role="document")
.modal-content
.modal-header
h4(class="modal-title", id="generateLettersDialogLabel") Briefe erstellen
.modal-body
p(style="font-weight: bold; font-style: italic;") Bitte warten Sie, während die Briefe erstellt werden:
p(style="font-weigth: bold") Briefe ...
.progress
#progress_letters.progress-bar(role="progressbar", aria-valuenow="0", aria-valuemin="0", aria-valuemax="100", style="width: 0%;")
#volunteerslist.sidewideoverlay(style="z-index: 5;")
.root
.new_flex_zero
+nav("PfarrInfoSystem", "volunteerslist_menu")
.container-fluid
h1 Ehrenamtlichenliste
.small Zusammenstellung
p Hier finden Sie die Liste der Ehrenamtlichen aus den gewählten Gruppen
nav
ul.pager
li.previous
span(onclick="$('#volunteerslist').hide(); $('html, body').scrollTop(0);") Zurück
li.next.disabled
span Extras
.new_flex_one
.container-fluid
.panel.panel-primary(style="margin-bottom: 25px; border-bottom: 1px solid #ddd;")
.panel-heading
h3.panel-title(data-toggle="collapse", data-target="#generate_letters", style="cursor: pointer;") Briefe an die Ehrenamtlichen erstellen
.panel-collapse.collapse(id="generate_letters")
.panel-body
label(for='fileinput', class="col-sm-2 control-label", style="padding-left: 0px;") Vorlage
input#fileupload(type="file", accept=".pdf", style="padding-left: 15px;" class="form-control")
div
button.btn.btn-default.btn-xs(onclick="$('#fileupload').val(''); ", style="display: inline;") Zurücksetzen
p#upload_pending_indicator(style='display: none; text-style: italic;') Datei wird hochgeladen...
button.btn.btn-success#btn_generate_letters(style="padding-left: 20px; margin-top: 15px; margin-bottom: 15px;") Briefe erstellen
br
a#link_letters(href="/volunteerslist/#{taskuuid}/download/letters.pdf", target="_blank", style="margin-right: 15px; display: none;")
img(src="/images/mail-read-32.png", style="margin-right: 2px;")
span Erstellte Briefe
#volunteerslist_list
.root
.new_flex_zero
+nav("PfarrInfoSystem", "mainmenu")
.container-fluid
h1 Ehrenamtlichenliste erstellen
.small Ehrenamtlichengruppen auswählen
p Wählen Sie die Gruppen der Pfarrei aus, deren Mitglieder in die Liste aufgenommen werden sollen
nav
ul.pager
li.previous.disabled
span Zurück
li.next.disabled#button_volunteergroupsselected
span(onclick="volunteergroupsselected();") Weiter
.new_flex_one
.container-fluid.parish-marker
form(class="form-horizontal", role="form", id="form")
.form-group
label(for='combo_sortorder', class="col-sm-2 control-label") Sortierreihenfolge
.col-sm-10
select.form-control(id='combo_sortorder')
- var id=0;
- each o in sortorder
option(value=id) #{o}
- id++;
.row(style="margin-bottom: 20px;")
.col-sm-4
button.btn.btn-primary.btn-xs.button-select-all Alle auswählen
button.btn.btn-default.btn-xs.button-deselect-all Alle abwählen
- var parishid = 0;
each parish in parishes
- var my_uid = generateUID();
if(parish.volunteergroups.length > 0)
.panel.panel-default.parish-marker(style="border-width: 3px;", data-parishid=parishid)
.panel-heading
h4.panel-title(data-toggle="collapse", data-target="#PANEL_#{my_uid}", aria-expanded="false", aria-controls="PANEL_#{my_uid}", style="cursor: pointer;") #{parish.name}
.panel-collapse.collapse(id="PANEL_#{my_uid}")
.panel-body(style="padding: 10px;")
.container-fluid
.row
button.btn.btn-primary.btn-xs.button-select-all Alle auswählen
button.btn.btn-default.btn-xs.button-deselect-all Alle abwählen
table(width='100%', class='table table-condensed', style='margin-bottom: 10px;')
thead
tr
td <b>Name</b>
tbody
for grp in parish.volunteergroups
tr(onclick="$(this).toggleClass('group_is_selected'); update_button_volunteergroupsselected();", style="cursor: pointer;", data-dn="#{grp.dn}", data-group)
td #{grp.name}
- parishid++;
script.
$(".button-select-all").on('click', function(event) {
$(event.target).closest('.parish-marker').find("[data-group]").addClass('group_is_selected');
update_button_volunteergroupsselected();
});
$(".button-deselect-all").on('click', function(event) {
$(event.target).closest('.parish-marker').find("[data-group]").removeClass('group_is_selected');
update_button_volunteergroupsselected();
});
$("#form").on('submit', function(event){console.log('submit');event.preventDefault()});
var ws = new PfISWebSocket("#{sessionuuid}", "#{taskuuid}");
ws.bind_standard_close_handler();
function update_button_volunteergroupsselected() {
if($(".group_is_selected").length > 0)
$("#button_volunteergroupsselected").removeClass("disabled");
else
$("#button_volunteergroupsselected").addClass("disabled")
}
function volunteergroupsselected() {
if($("#button_volunteergroupsselected").hasClass("disabled"))
return;
var selected_groups = [];
$("[data-parishid]").each(function(index){
var this_parish = { id: $(this).data('parishid'), selected_groups : [] };
$(this).find(".group_is_selected").each(function(index) {
this_parish.selected_groups.push($(this).data('dn'));
});
selected_groups.push(this_parish);
});
console.log(selected_groups);
console.log($("#combo_sortorder").val());
ws.send('get_volunteerslist', {sortorder: parseInt($("#combo_sortorder").val()), groups : selected_groups});
}
ws.bind('get_volunteerslist_result', function(data) {
console.log(data);
if(data.result === "ERROR") {
alert(data.message);
return;
}
var html = volunteerslist_result_template(data);
$("#volunteerslist_list").empty();
$("#volunteerslist_list").html(html);
$("#volunteerslist").show();
$("#volunteerslist_list").parent().parent().scrollTop(0);
$('html, body').scrollTop(0);
$("#link_letters").hide();
})
$("#btn_generate_letters").on('click', function() {
$("#link_letters").hide();
$('#generateLettersDialog').modal({
backdrop: 'static',
keyboard: false
});
var files=$("#fileupload").prop('files');
if(files.length === 1) {
console.log(files);
console.log(files.length);
$("#upload_pending_indicator").show();
for (var i = 0, numFiles = files.length; i < numFiles; i++) {
var file = files[i];
console.log(file.name);
console.log(file.size);
console.log(file.type);
var reader = new FileReader();
reader.onload = (function(aFile) { return function(e) {
var data = {
name : aFile.name,
size : aFile.size,
type : aFile.type,
content : e.target.result
};
ws.send('fileupload', data);
}})(file);
reader.readAsDataURL(file);
}
}
else
common_generate_letters();
});
ws.bind('fileupload_result', function(data) {
console.log(data);
$("#upload_pending_indicator").hide();
if(data.result === "ERROR") {
alert(data.message);
$("#generateLabelsDialog").modal('hide');
return;
}
common_generate_letters()
});
function common_generate_letters() {
console.log('common_generate_letters');
var data = { reset_template : ($("#fileupload").prop('files').length === 1 ? false : true ) };
ws.send('generate_letters', data);
}
ws.bind('generate_letters_progress', function(data) {
console.log(data);
var percent = Math.round(data.generated * 100 / data.total) ;
console.log(percent);
$("#progress_letters").prop("aria-valuenow", percent);
$("#progress_letters").css("width", percent +"%");
$("#progress_letters").html(percent +"%");
});
ws.bind('generate_letters_result', function(data) {
console.log('generate_letters_result');
$('#generateLettersDialog').modal('hide');
if(data.result === "ERROR") {
alert(data.message);
return;
}
$("#link_letters").show();
});

View File

@@ -0,0 +1,19 @@
mixin do_persons(persons)
each person in persons
div.person_divider
p.person_name #{person.name}
each g in person.groups
p.group_name #{g.name}
+do_persons(persons)
each parish in parishes
h2 #{parish.name}
+do_persons(parish.persons)
each group in parish.groups
h3 #{group.name}
if(group.members.length === 0)
p.person_in_group
i Kein Mitglied in dieser Gruppe!
each member in group.members
p.person_in_group #{member.name}

106
views/week.jade Normal file
View File

@@ -0,0 +1,106 @@
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' )
link(href="/stylesheets/style_week.css", rel="stylesheet")
body
.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
.root
.new_flex_zero
//- +nav_main("PfarrInfoSystem", "dropdown_menu")
//- +nav_main_collapse()
//- +nav_item( "/day/" + basedate ) Tag
//- +nav_item( "/timeline/" + basedate ) TagZeitleiste
//- +nav_item( "#", "active" ) Woche
//- +nav_main_dropdown_right("Extras")
//- +nav_item( "/parishdb" ) Pfarrdatenbank
//- +nav_divider()
//- +nav_item( "/week/" + basedate + "/select_punits_for_view" ) Angezeigte Orte konfigurieren
//- +nav_divider()
//- +nav_item( "/info" ) Info
+nav_main_primary("week", basedate)
#dataparent.subroot
.new_flex_zero(style="margin-bottom: 15px;")
.container-fluid
+weekcontrol(basedate, interval, last_week, next_week)
+messageview(messages)
.new_flex_one
.container-fluid
- var is_desktop = false;
if(is_desktop)
+week_complete_desktop(days)
else
+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");
var day_elem = $('.navbar-collapse > ul > li:nth(0) > a');
day_elem.prop('href', '/day/' + data.basedate);
var timeline_elem = $('.navbar-collapse > ul > li:nth(1) > a');
timeline_elem.prop('href', '/timeline/' + data.basedate);
var select_for_view_elem = $('#select_punits_for_view').closest('a');
select_for_view_elem.prop("href", "/week/"+data.basedate+"/select_punits_for_view");
var parishcalA4week_elem = $('#parishcalA4week').closest('a');
parishcalA4week_elem.prop("href", "/parishcalA4week/" + data.basedate);
$("#dataparent").html(data.html);
}
else {
$('#dataparent').html("<div class='new_flex_one' style=' padding-left: 15px; padding-right: 15px;'>"+data.html+"</div>");
}
});
});
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'));
});

15
views/weekcontent.jade Normal file
View File

@@ -0,0 +1,15 @@
include mixins
include mixins_week
.new_flex_zero(style="margin-bottom: 15px;")
.container-fluid
+weekcontrol(basedate, interval, last_week, next_week)
+messageview(messages)
.new_flex_one
.container-fluid
- var is_desktop = false;
if(is_desktop)
+week_complete_desktop(days)
else
+week_complete_mobile(days)