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 Keine Empfänger in dieser Kategorie angegeben. - 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 Keine Empfänger in dieser Kategorie angegeben. - 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 Keine Empfänger in dieser Kategorie angegeben. form(class="form-inline", id="form-emaileditor") .form-group label(for="emailinput") eMail - direkte Eingabe: 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 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("
" + data.name + " (" + data.description + ")
(" + data.kontext + ")
Keine Empfänger in dieser Kategorie angegeben.
"); 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(); } });