diff options
Diffstat (limited to 'view/tpl')
35 files changed, 1103 insertions, 600 deletions
diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 835948096..6f89e2199 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -1,21 +1,35 @@ <div class="generic-content-wrapper"> <div class="section-title-wrapper"> {{if $notself}} - <div class="dropdown pull-right"> - <button id="connection-dropdown" class="btn btn-default btn-xs" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - <i class="fa fa-caret-down"></i> {{$tools_label}} - </button> - <ul class="dropdown-menu" aria-labelledby="dLabel"> - <li><a href="{{$tools.view.url}}" title="{{$tools.view.title}}">{{$tools.view.label}}</a></li> - <li><a href="{{$tools.recent.url}}" title="{{$tools.recent.title}}">{{$tools.recent.label}}</a></li> - <li class="divider"></li> - <li><a href="#" title="{{$tools.refresh.title}}" onclick="window.location.href='{{$tools.refresh.url}}'; return false;">{{$tools.refresh.label}}</a></li> - <li><a href="#" title="{{$tools.block.title}}" onclick="window.location.href='{{$tools.block.url}}'; return false;">{{$tools.block.label}}</a></li> - <li><a href="#" title="{{$tools.ignore.title}}" onclick="window.location.href='{{$tools.ignore.url}}'; return false;">{{$tools.ignore.label}}</a></li> - <li><a href="#" title="{{$tools.archive.title}}" onclick="window.location.href='{{$tools.archive.url}}'; return false;">{{$tools.archive.label}}</a></li> - <li><a href="#" title="{{$tools.hide.title}}" onclick="window.location.href='{{$tools.hide.url}}'; return false;">{{$tools.hide.label}}</a></li> - <li><a href="#" title="{{$tools.delete.title}}" onclick="window.location.href='{{$tools.delete.url}}'; return false;">{{$tools.delete.label}}</a></li> - </ul> + <div class="pull-right"> + <div class="btn-group"> + <button id="connection-dropdown" class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <i class="fa fa-caret-down"></i> {{$tools_label}} + </button> + <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dLabel"> + <li><a href="{{$tools.view.url}}" title="{{$tools.view.title}}">{{$tools.view.label}}</a></li> + <li><a href="{{$tools.recent.url}}" title="{{$tools.recent.title}}">{{$tools.recent.label}}</a></li> + <li class="divider"></li> + <li><a href="#" title="{{$tools.refresh.title}}" onclick="window.location.href='{{$tools.refresh.url}}'; return false;">{{$tools.refresh.label}}</a></li> + <li><a href="#" title="{{$tools.block.title}}" onclick="window.location.href='{{$tools.block.url}}'; return false;">{{$tools.block.label}}</a></li> + <li><a href="#" title="{{$tools.ignore.title}}" onclick="window.location.href='{{$tools.ignore.url}}'; return false;">{{$tools.ignore.label}}</a></li> + <li><a href="#" title="{{$tools.archive.title}}" onclick="window.location.href='{{$tools.archive.url}}'; return false;">{{$tools.archive.label}}</a></li> + <li><a href="#" title="{{$tools.hide.title}}" onclick="window.location.href='{{$tools.hide.url}}'; return false;">{{$tools.hide.label}}</a></li> + <li><a href="#" title="{{$tools.delete.title}}" onclick="window.location.href='{{$tools.delete.url}}'; return false;">{{$tools.delete.label}}</a></li> + </ul> + </div> + {{if $abook_prev || $abook_next}} + <div class="btn-group"> + <a href="connedit/{{$abook_prev}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-default btn-xs{{if ! $abook_prev}} disabled{{/if}}" ><i class="fa fa-backward"></i></a> + <button class="btn btn-default btn-xs{{if $is_pending}} disabled{{/if}}" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-bars"></i></button> + <a href="connedit/{{$abook_next}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-default btn-xs{{if ! $abook_next}} disabled{{/if}}" ><i class="fa fa-forward"></i></a> + <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dLabel"> + {{foreach $sections as $s}} + <li><a href="{{$s.url}}" title="{{$s.title}}">{{$s.label}}</a></li> + {{/foreach}} + </ul> + </div> + {{/if}} </div> {{/if}} <h2>{{$header}}</h2> @@ -51,6 +65,7 @@ <form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" > <input type="hidden" name="contact_id" value="{{$contact_id}}"> + <input type="hidden" name="section" value="{{$section}}"> <div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true"> {{if $notself}} @@ -74,17 +89,299 @@ </div> </div> {{/if}} + {{if ! $is_pending}} + <div id="template-form-vcard-org" class="form-group form-vcard-org"> + <div class="form-group form-vcard-org"> + <input type="text" name="org" value="" placeholder="{{$org_label}}"> + <i data-remove="vcard-org" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + </div> + + <div id="template-form-vcard-title" class="form-group form-vcard-title"> + <div class="form-group form-vcard-title"> + <input type="text" name="title" value="" placeholder="{{$title_label}}"> + <i data-remove="vcard-title" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + </div> + + <div id="template-form-vcard-tel" class="form-group form-vcard-tel"> + <select name="tel_type[]"> + <option value="CELL">{{$mobile}}</option> + <option value="HOME">{{$home}}</option> + <option value="WORK">{{$work}}</option> + <option value="OTHER">{{$other}}</option> + </select> + <input type="text" name="tel[]" value="" placeholder="{{$tel_label}}"> + <i data-remove="vcard-tel" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + + <div id="template-form-vcard-email" class="form-group form-vcard-email"> + <select name="email_type[]"> + <option value="HOME">{{$home}}</option> + <option value="WORK">{{$work}}</option> + <option value="OTHER">{{$other}}</option> + </select> + <input type="text" name="email[]" value="" placeholder="{{$email_label}}"> + <i data-remove="vcard-email" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + + <div id="template-form-vcard-impp" class="form-group form-vcard-impp"> + <select name="impp_type[]"> + <option value="HOME">{{$home}}</option> + <option value="WORK">{{$work}}</option> + <option value="OTHER">{{$other}}</option> + </select> + <input type="text" name="impp[]" value="" placeholder="{{$impp_label}}"> + <i data-remove="vcard-impp" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + + <div id="template-form-vcard-url" class="form-group form-vcard-url"> + <select name="url_type[]"> + <option value="HOME">{{$home}}</option> + <option value="WORK">{{$work}}</option> + <option value="OTHER">{{$other}}</option> + </select> + <input type="text" name="url[]" value="" placeholder="{{$url_label}}"> + <i data-remove="vcard-url" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + + <div id="template-form-vcard-adr" class="form-group form-vcard-adr"> + <div class="form-group"> + <select name="adr_type[]"> + <option value="HOME">{{$home}}</option> + <option value="WORK">{{$work}}</option> + <option value="OTHER">{{$other}}</option> + </select> + <label>{{$adr_label}}</label> + <i data-remove="vcard-adr" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$po_box}}"> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$extra}}"> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$street}}"> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$locality}}"> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$region}}"> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$zip_code}}"> + </div> + <div class="form-group"> + <input type="text" name="" value="" placeholder="{{$country}}"> + </div> + </div> + + <div id="template-form-vcard-note" class="form-group form-vcard-note"> + <label>{{$note_label}}</label> + <i data-remove="vcard-note" data-id="" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + <textarea name="note" class="form-control"></textarea> + </div> + + <div class="section-content-wrapper-np"> + <div id="vcard-cancel-{{$vcard.id}}" class="vcard-cancel vcard-cancel-btn" data-id="{{$vcard.id}}" data-action="cancel"><i class="fa fa-close"></i></div> + <div id="vcard-add-field-{{$vcard.id}}" class="dropdown pull-right vcard-add-field"> + <button data-toggle="dropdown" type="button" class="btn btn-default btn-sm dropdown-toggle"><i class="fa fa-plus"></i> {{$add_field}}</button> + <ul class="dropdown-menu"> + <li class="add-vcard-org"{{if $vcard.org}} style="display: none"{{/if}}><a href="#" data-add="vcard-org" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$org_label}}</a></li> + <li class="add-vcard-title"{{if $vcard.title}} style="display: none"{{/if}}><a href="#" data-add="vcard-title" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$title_label}}</a></li> + <li class="add-vcard-tel"><a href="#" data-add="vcard-tel" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$tel_label}}</a></li> + <li class="add-vcard-email"><a href="#" data-add="vcard-email" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$email_label}}</a></li> + <li class="add-vcard-impp"><a href="#" data-add="vcard-impp" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$impp_label}}</a></li> + <li class="add-vcard-url"><a href="#" data-add="vcard-url" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$url_label}}</a></li> + <li class="add-vcard-adr"><a href="#" data-add="vcard-adr" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$adr_label}}</a></li> + <li class="add-vcard-note"{{if $vcard.note}} style="display: none"{{/if}}><a href="#" data-add="vcard-note" data-id="{{$vcard.id}}" class="add-field" onclick="return false;">{{$note_label}}</a></li> + </ul> + </div> + <div id="vcard-header-{{$vcard.id}}" class="vcard-header" data-id="{{$vcard.id}}" data-action="open"> + <i class="vcard-fn-preview fa fa-address-card-o"></i> + <span id="vcard-preview-{{$vcard.id}}" class="vcard-preview"> + {{if $vcard.fn}}<span class="vcard-fn-preview">{{$vcard.fn}}</span>{{/if}} + {{if $vcard.emails.0.address}}<span class="vcard-email-preview hidden-xs"><a href="mailto:{{$vcard.emails.0.address}}">{{$vcard.emails.0.address}}</a></span>{{/if}} + {{if $vcard.tels.0}}<span class="vcard-tel-preview hidden-xs">{{$vcard.tels.0.nr}}{{if $is_mobile}} <a class="btn btn-default btn-xs" href="tel:{{$vcard.tels.0.nr}}"><i class="fa fa-phone connphone"></i></a>{{/if}}</span>{{/if}} + </span> + <input id="vcard-fn-{{$vcard.id}}" class="vcard-fn" type="text" name="fn" value="{{$vcard.fn}}" size="{{$vcard.fn|count_characters:true}}" placeholder="{{$name_label}}"> + </div> + </div> + <div id="vcard-info-{{$vcard.id}}" class="vcard-info section-content-wrapper"> + + <div class="vcard-org form-group"> + <div class="form-vcard-org-wrapper"> + {{if $vcard.org}} + <div class="form-group form-vcard-org"> + <input type="text" name="org" value="{{$vcard.org}}" size="{{$vcard.org|count_characters:true}}" placeholder="{{$org_label}}"> + <i data-remove="vcard-org" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + {{/if}} + </div> + </div> + + <div class="vcard-title form-group"> + <div class="form-vcard-title-wrapper"> + {{if $vcard.title}} + <div class="form-group form-vcard-title"> + <input type="text" name="title" value="{{$vcard.title}}" size="{{$vcard.title|count_characters:true}}" placeholder="{{$title_label}}"> + <i data-remove="vcard-title" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + {{/if}} + </div> + </div> + + + <div class="vcard-tel form-group"> + <div class="form-vcard-tel-wrapper"> + {{if $vcard.tels}} + {{foreach $vcard.tels as $tel}} + <div class="form-group form-vcard-tel"> + <select name="tel_type[]"> + <option value=""{{if $tel.type.0 != 'CELL' && $tel.type.0 != 'HOME' && $tel.type.0 != 'WORK' && $tel.type.0 != 'OTHER'}} selected="selected"{{/if}}>{{$tel.type.1}}</option> + <option value="CELL"{{if $tel.type.0 == 'CELL'}} selected="selected"{{/if}}>{{$mobile}}</option> + <option value="HOME"{{if $tel.type.0 == 'HOME'}} selected="selected"{{/if}}>{{$home}}</option> + <option value="WORK"{{if $tel.type.0 == 'WORK'}} selected="selected"{{/if}}>{{$work}}</option> + <option value="OTHER"{{if $tel.type.0 == 'OTHER'}} selected="selected"{{/if}}>{{$other}}</option> + </select> + <input type="text" name="tel[]" value="{{$tel.nr}}" size="{{$tel.nr|count_characters:true}}" placeholder="{{$tel_label}}"> + <i data-remove="vcard-tel" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + {{/foreach}} + {{/if}} + </div> + </div> + + + <div class="vcard-email form-group"> + <div class="form-vcard-email-wrapper"> + {{if $vcard.emails}} + {{foreach $vcard.emails as $email}} + <div class="form-group form-vcard-email"> + <select name="email_type[]"> + <option value=""{{if $email.type.0 != 'HOME' && $email.type.0 != 'WORK' && $email.type.0 != 'OTHER'}} selected="selected"{{/if}}>{{$email.type.1}}</option> + <option value="HOME"{{if $email.type.0 == 'HOME'}} selected="selected"{{/if}}>{{$home}}</option> + <option value="WORK"{{if $email.type.0 == 'WORK'}} selected="selected"{{/if}}>{{$work}}</option> + <option value="OTHER"{{if $email.type.0 == 'OTHER'}} selected="selected"{{/if}}>{{$other}}</option> + </select> + <input type="text" name="email[]" value="{{$email.address}}" size="{{$email.address|count_characters:true}}" placeholder="{{$email_label}}"> + <i data-remove="vcard-email" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + {{/foreach}} + {{/if}} + </div> + </div> + + <div class="vcard-impp form-group"> + <div class="form-vcard-impp-wrapper"> + {{if $vcard.impps}} + {{foreach $vcard.impps as $impp}} + <div class="form-group form-vcard-impp"> + <select name="impp_type[]"> + <option value=""{{if $impp.type.0 != 'HOME' && $impp.type.0 != 'WORK' && $impp.type.0 != 'OTHER'}} selected="selected"{{/if}}>{{$impp.type.1}}</option> + <option value="HOME"{{if $impp.type.0 == 'HOME'}} selected="selected"{{/if}}>{{$home}}</option> + <option value="WORK"{{if $impp.type.0 == 'WORK'}} selected="selected"{{/if}}>{{$work}}</option> + <option value="OTHER"{{if $impp.type.0 == 'OTHER'}} selected="selected"{{/if}}>{{$other}}</option> + </select> + <input type="text" name="impp[]" value="{{$impp.address}}" size="{{$impp.address|count_characters:true}}" placeholder="{{$impp_label}}"> + <i data-remove="vcard-impp" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + {{/foreach}} + {{/if}} + </div> + </div> + + <div class="vcard-url form-group"> + <div class="form-vcard-url-wrapper"> + {{if $vcard.urls}} + {{foreach $vcard.urls as $url}} + <div class="form-group form-vcard-url"> + <select name="url_type[]"> + <option value=""{{if $url.type.0 != 'HOME' && $url.type.0 != 'WORK' && $url.type.0 != 'OTHER'}} selected="selected"{{/if}}>{{$url.type.1}}</option> + <option value="HOME"{{if $url.type.0 == 'HOME'}} selected="selected"{{/if}}>{{$home}}</option> + <option value="WORK"{{if $url.type.0 == 'WORK'}} selected="selected"{{/if}}>{{$work}}</option> + <option value="OTHER"{{if $url.type.0 == 'OTHER'}} selected="selected"{{/if}}>{{$other}}</option> + </select> + <input type="text" name="url[]" value="{{$url.address}}" size="{{$url.address|count_characters:true}}" placeholder="{{$url_label}}"> + <i data-remove="vcard-url" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + {{/foreach}} + {{/if}} + </div> + </div> + + <div class="vcard-adr form-group"> + <div class="form-vcard-adr-wrapper"> + {{if $vcard.adrs}} + {{foreach $vcard.adrs as $adr}} + <div class="form-group form-vcard-adr"> + <div class="form-group"> + <label>{{$adr_label}}</label> + <select name="adr_type[]"> + <option value=""{{if $adr.type.0 != 'HOME' && $adr.type.0 != 'WORK' && $adr.type.0 != 'OTHER'}} selected="selected"{{/if}}>{{$adr.type.1}}</option> + <option value="HOME"{{if $adr.type.0 == 'HOME'}} selected="selected"{{/if}}>{{$home}}</option> + <option value="WORK"{{if $adr.type.0 == 'WORK'}} selected="selected"{{/if}}>{{$work}}</option> + <option value="OTHER"{{if $adr.type.0 == 'OTHER'}} selected="selected"{{/if}}>{{$other}}</option> + </select> + <i data-remove="vcard-adr" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.0}}" size="{{$adr.address.0|count_characters:true}}" placeholder="{{$po_box}}"> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.1}}" size="{{$adr.address.1|count_characters:true}}" placeholder="{{$extra}}"> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.2}}" size="{{$adr.address.2|count_characters:true}}" placeholder="{{$street}}"> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.3}}" size="{{$adr.address.3|count_characters:true}}" placeholder="{{$locality}}"> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.4}}" size="{{$adr.address.4|count_characters:true}}" placeholder="{{$region}}"> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.5}}" size="{{$adr.address.5|count_characters:true}}" placeholder="{{$zip_code}}"> + </div> + <div class="form-group"> + <input type="text" name="adr[{{$adr@index}}][]" value="{{$adr.address.6}}" size="{{$adr.address.6|count_characters:true}}" placeholder="{{$country}}"> + </div> + </div> + {{/foreach}} + {{/if}} + </div> + </div> + + <div class="vcard-note form-group form-vcard-note"> + <div class="form-vcard-note-wrapper"> + {{if $vcard.note}} + <label>{{$note_label}}</label> + <i data-remove="vcard-note" data-id="{{$vcard.id}}" class="fa fa-trash-o remove-field drop-icons fakelink"></i> + <textarea name="note" class="form-control">{{$vcard.note}}</textarea> + {{/if}} + </div> + </div> + + + <div class="settings-submit-wrapper" > + <button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button> + </div> + + </div> + {{/if}} - {{if $affinity }} + {{if $affinity}} <div class="panel"> <div class="section-subtitle-wrapper" role="tab" id="affinity-tool"> <h3> <a data-toggle="collapse" data-parent="#contact-edit-tools" href="#affinity-tool-collapse" aria-expanded="true" aria-controls="affinity-tool-collapse"> - {{$affinity }} + {{$affinity}} </a> </h3> </div> - <div id="affinity-tool-collapse" class="panel-collapse collapse{{if !$is_pending}} in{{/if}}" role="tabpanel" aria-labelledby="affinity-tool"> + <div id="affinity-tool-collapse" class="panel-collapse collapse{{if $section == 'affinity'}} in{{/if}}" role="tabpanel" aria-labelledby="affinity-tool"> <div class="section-content-tools-wrapper"> {{if $slide}} <div class="form-group"><strong>{{$lbl_slider}}</strong></div> @@ -92,7 +389,7 @@ <input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" /> {{/if}} - {{if $multiprofs }} + {{if $multiprofs}} <div class="form-group"> <strong>{{$lbl_vis2}}</strong> {{$profile_select}} @@ -115,7 +412,7 @@ </a> </h3> </div> - <div id="fitert-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs)}} in{{/if}}" role="tabpanel" aria-labelledby="fitert-tool"> + <div id="fitert-tool-collapse" class="panel-collapse collapse{{if $section == 'filter' }} in{{/if}}" role="tabpanel" aria-labelledby="fitert-tool"> <div class="section-content-tools-wrapper"> {{include file="field_textarea.tpl" field=$incl}} {{include file="field_textarea.tpl" field=$excl}} @@ -139,7 +436,7 @@ </a> </h3> </div> - <div id="rating-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs) && !$connfilter}} in{{/if}}" role="tabpanel" aria-labelledby="rating-tool"> + <div id="rating-tool-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="rating-tool"> <div class="section-content-tools-wrapper"> <div class="section-content-warning-wrapper"> {{$rating_info}} @@ -169,7 +466,7 @@ </h3> </div> {{/if}} - <div id="perms-tool-collapse" class="panel-collapse collapse{{if $self}} in{{/if}}" role="tabpanel" aria-labelledby="perms-tool"> + <div id="perms-tool-collapse" class="panel-collapse collapse{{if $self || $section === 'perms'}} in{{/if}}" role="tabpanel" aria-labelledby="perms-tool"> <div class="section-content-tools-wrapper"> <div class="section-content-warning-wrapper"> {{if $notself}}{{$permnote}}{{/if}} diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index a5b32f08f..0bb3ceb15 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -49,6 +49,7 @@ {{/if}} {{include file="field_textarea.tpl" field=$banner}} + {{include file="field_textarea.tpl" field=$siteinfo}} {{include file="field_textarea.tpl" field=$admininfo}} {{include file="field_select.tpl" field=$language}} {{include file="field_select.tpl" field=$theme}} diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl index 3e6b71b29..def98e869 100644 --- a/view/tpl/app.tpl +++ b/view/tpl/app.tpl @@ -1,6 +1,6 @@ <div class="app-container"> - <div class="app-detail"> - <a href="{{$app.url}}" {{if $ap.target}}target="{{$ap.target}}" {{/if}}{{if $app.desc}}title="{{$app.desc}}{{if $app.price}} ({{$app.price}}){{/if}}"{{else}}title="{{$app.name}}"{{/if}}><img src="{{$app.photo}}" width="80" height="80" /> + <div class="app-detail{{if $deleted}} app-deleted{{/if}}"> + <a href="{{$app.url}}" {{if $ap.target}}target="{{$ap.target}}" {{/if}}{{if $app.desc}}title="{{$app.desc}}{{if $app.price}} ({{$app.price}}){{/if}}"{{else}}title="{{$app.name}}"{{/if}}>{{if $icon}}<i class="app-icon fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="80" height="80" />{{/if}} <div class="app-name" style="text-align:center;">{{$app.name}}</div> </a> </div> @@ -16,7 +16,7 @@ <input type="hidden" name="papp" value="{{$app.papp}}" /> {{if $install}}<button type="submit" name="install" value="{{$install}}" class="btn btn-default" title="{{$install}}" ><i class="fa fa-arrow-circle-o-down" ></i></button>{{/if}} {{if $edit}}<input type="hidden" name="appid" value="{{$app.guid}}" /><button type="submit" name="edit" value="{{$edit}}" class="btn btn-default" title="{{$edit}}" ><i class="fa fa-pencil" ></i></button>{{/if}} - {{if $delete}}<button type="submit" name="delete" value="{{$delete}}" class="btn btn-default" title="{{$delete}}" ><i class="fa fa-trash-o drop-icons"></i></button>{{/if}} + {{if $delete}}<button type="submit" name="delete" value="{{if $deleted}}{{$undelete}}{{else}}{{$delete}}{{/if}}" class="btn btn-default" title="{{if $deleted}}{{$undelete}}{{else}}{{$delete}}{{/if}}" ><i class="fa fa-trash-o drop-icons"></i></button>{{/if}} </form> </div> {{/if}} diff --git a/view/tpl/app_create.tpl b/view/tpl/app_create.tpl index 06fbcaaa7..32ab7fd4c 100644 --- a/view/tpl/app_create.tpl +++ b/view/tpl/app_create.tpl @@ -14,6 +14,7 @@ <input type="hidden" name="requires" value="{{$requires}}" /> <input type="hidden" name="system" value="{{$system}}" /> +<input type="hidden" name="plugin" value="{{$plugin}}" /> {{include file="field_input.tpl" field=$name}} diff --git a/view/tpl/app_select.tpl b/view/tpl/app_select.tpl index 93049d522..86ea0b1de 100644 --- a/view/tpl/app_select.tpl +++ b/view/tpl/app_select.tpl @@ -3,7 +3,7 @@ <h3>{{$title}}</h3> <ul class="nav nav-pills nav-stacked"> <li><a href="appman"><i class="fa fa-plus"></i> {{$new}}</a></li> -<li><a href="apps/edit"><i class="fa fa-pencil"></i> {{$edit}}</a></li> +<li><a href="apps/edit{{if $cat}}/?f=&cat={{$cat}}{{/if}}"><i class="fa fa-pencil"></i> {{$edit}}</a></li> </ul> </div> {{/if}} diff --git a/view/tpl/channel_import.tpl b/view/tpl/channel_import.tpl index 6974e4d30..0260bf778 100755 --- a/view/tpl/channel_import.tpl +++ b/view/tpl/channel_import.tpl @@ -33,6 +33,12 @@ <label for="import-make-primary" id="label-import-make-primary">{{$label_import_primary}}</label> <div id="import-make-primary-end" class="import-field-end"></div> + {{if $allow_move}} + <input type="checkbox" name="moving" id="import-moving" value="1" /> + <label for="import-moving" id="label-import-moving">{{$label_import_moving}}</label> + <div id="import-moving-end" class="import-field-end"></div> + {{/if}} + <input type="submit" name="submit" id="import-submit-button" value="{{$submit}}" /> <div id="import-submit-end" class="import-field-end"></div> diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl index a238f5bc7..64d27e609 100755 --- a/view/tpl/connection_template.tpl +++ b/view/tpl/connection_template.tpl @@ -14,7 +14,7 @@ </form> {{/if}} </div> - <h3>{{if $contact.public_forum}}<i class="fa fa-comments-o"></i> {{/if}}<a href="{{$contact.url}}" title="{{$contact.img_hover}}" >{{$contact.name}}</a></h3> + <h3>{{if $contact.public_forum}}<i class="fa fa-comments-o"></i> {{/if}}<a href="{{$contact.url}}" title="{{$contact.img_hover}}" >{{$contact.name}}</a>{{if $contact.phone}} <a class="btn btn-default btn-xs" href="tel:{{$contact.phone}}" title="{{$contact.call}}"><i class="fa fa-phone connphone"></i></a>{{/if}}</h3> </div> <div class="section-content-tools-wrapper"> <div class="contact-photo-wrapper" > diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 35c3d18e7..b5ff475b2 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -166,18 +166,27 @@ {{if $item.star}} <li role="presentation"><a role="menuitem" href="#" onclick="dostar({{$item.id}}); return false;"><i id="starred-{{$item.id}}" class="fa fa-star {{$item.star.isstarred}}" title="{{$item.star.toggle}}"></i> {{$item.star.toggle}}</a></li> {{/if}} + + {{if $item.thread_action_menu}} + {{foreach $item.thread_action_menu as $mitem}} + <li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-{{$mitem.icon}}"></i> {{$mitem.title}}</a></li> + {{/foreach}} + {{/if}} + {{if $item.drop.dropping}} <li role="presentation"><a role="menuitem" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li> {{/if}} - {{if $item.item_photo_menu}} + + {{if $item.thread_author_menu}} <li role="presentation" class="divider"></li> - {{$item.item_photo_menu}} + {{foreach $item.thread_author_menu as $mitem}} + <li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a></li> + {{/foreach}} + {{/if}} {{if $item.edpost && $item.dreport}} <li role="presentation"><a role="menuitem" href="dreport/{{$item.mid}}">{{$item.dreport}}</a></li> {{/if}} - - {{/if}} </ul> </div> </div> diff --git a/view/tpl/cover_photo_widget.tpl b/view/tpl/cover_photo_widget.tpl index 2b47270c9..bc1f421bd 100755 --- a/view/tpl/cover_photo_widget.tpl +++ b/view/tpl/cover_photo_widget.tpl @@ -53,7 +53,7 @@ } } } - if($('#cover-photo').length) { + if($('#cover-photo').length && $('main').css('opacity') < 1) { $('main').css('opacity', ($(window).scrollTop()/$('#cover-photo').height()).toFixed(1)); } }); diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl index 2c1fc762c..8a06567c1 100755 --- a/view/tpl/event_form.tpl +++ b/view/tpl/event_form.tpl @@ -10,6 +10,10 @@ {{include file="field_input.tpl" field=$summary}} + {{if $tz_choose}} + {{include file="field_select_grouped.tpl" field=$timezone}} + {{/if}} + {{$s_dsel}} {{$f_dsel}} diff --git a/view/tpl/generic_modal.tpl b/view/tpl/generic_modal.tpl index 3f7326e71..2bbea42b3 100644 --- a/view/tpl/generic_modal.tpl +++ b/view/tpl/generic_modal.tpl @@ -8,8 +8,10 @@ <div class="modal-body" id="generic-modal-body-{{$id}}"></div> <div class="modal-footer"> <button id="generic-modal-cancel-{{$id}}" type="button" class="btn btn-default" data-dismiss="modal">{{$cancel}}</button> + {{if $ok}} <button id="generic-modal-ok-{{$id}}" type="button" class="btn btn-primary">{{$ok}}</button> + {{/if}} </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> -</div><!-- /.modal -->
\ No newline at end of file +</div><!-- /.modal --> diff --git a/view/tpl/group_side.tpl b/view/tpl/group_side.tpl index e58cf060d..35f79a07e 100755 --- a/view/tpl/group_side.tpl +++ b/view/tpl/group_side.tpl @@ -5,12 +5,10 @@ {{foreach $groups as $group}} <li> {{if $group.cid}} - <a class="pull-right group-edit-tool fakelink" onclick="contactgroupChangeMember('{{$group.id}}','{{$group.enc_cid}}'); return true;"/> - <i id="group-{{$group.id}}" class="fa {{if $group.ismember}}fa-check-square-o{{else}}fa-square-o{{/if}}"></i> - </a> + <i id="group-{{$group.id}}" class="widget-nav-pills-checkbox fa {{if $group.ismember}}fa-check-square-o{{else}}fa-square-o{{/if}}" onclick="contactgroupChangeMember('{{$group.id}}','{{$group.enc_cid}}'); return true;"></i> {{/if}} {{if $group.edit}} - <a class="pull-right group-edit-tool" href="{{$group.edit.href}}" title="{{$edittext}}"><i class="group-edit-icon fa fa-pencil"></i></a> + <a href="{{$group.edit.href}}" class="widget-nav-pills-icons" title="{{$edittext}}"><i class="fa fa-pencil"></i></a> {{/if}} <a{{if $group.selected}} class="group-selected"{{/if}} href="{{$group.href}}">{{$group.text}}</a> </li> diff --git a/view/tpl/help.tpl b/view/tpl/help.tpl index 22180bda6..10e0a4957 100644 --- a/view/tpl/help.tpl +++ b/view/tpl/help.tpl @@ -1,8 +1,33 @@ <div id="help-content" class="generic-content-wrapper"> <div class="section-title-wrapper"> - <h2>{{$title}}</h2> + <h2>{{$title}}: {{$heading}}</h2> </div> - <div class="section-content-wrapper"> - {{$content}} + <div class="section-content-wrapper" id="doco-content"> + <h3 id="doco-top-toc-heading"> + <span class="fakelink" onclick="docoTocToggle(); return false;"> + <i class="fakelink fa fa-caret-right" id="doco-toc-toggle"></i> + {{$tocHeading}} + </span> + </h3> + <ul id="doco-top-toc" style="margin-bottom: 1.5em; display: none;"></ul> + {{$content}} </div> </div> + +<script> + // Generate the table of contents in the side nav menu (see view/tpl/help.tpl) + $(document).ready(function () { + $('#doco-top-toc').toc({content: "#doco-content", headings: "h3,h4,h5,h6"}); + }); + + function docoTocToggle() { + if($('#doco-top-toc').is(':visible')) { + $('#doco-toc-toggle').removeClass('fa-caret-down').addClass('fa-caret-right'); + } else { + $('#doco-toc-toggle').removeClass('fa-caret-right').addClass('fa-caret-down'); + } + $('#doco-top-toc').toggle(); + + return false; + } +</script> diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index edabee2da..d846f3e34 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -490,8 +490,9 @@ function enableOnUser(){ $('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>'); for(var i=0; i<albums.length; i++) { var albumName = albums[i].text; - var albumLink = '<li>'; - albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + albumName + '\');return false;">' + albumName + '</a>'; + var jsAlbumName = albums[i].jstext; + var albumLink = '<li>'; + albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>'; albumLink += '</li>'; $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink); } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index a3bfad842..377eef453 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -180,7 +180,7 @@ {{/if}} {{if $showacl}} <button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button" data-form_id="profile-jot-form"> - <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons"></i>{{if $bang}} <i class="fa fa-exclamation jot-icons"></i>{{/if}} + <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons{{if $bang}} jot-lock-warn{{/if}}"></i> </button> {{/if}} <button id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" tabindex="3" name="button-submit">{{$share}}</button> diff --git a/view/tpl/micropro_img.tpl b/view/tpl/micropro_img.tpl index 23b7bd281..a7c5973f3 100755 --- a/view/tpl/micropro_img.tpl +++ b/view/tpl/micropro_img.tpl @@ -1 +1 @@ -<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="{{$name}}" /></a></div> +<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" /></a></div> diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index a279789a1..4d8ce9317 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -1,21 +1,23 @@ <div class="container-fluid"> <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <button id="expand-tabs" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#tabs-collapse-1"> - <i class="fa fa-arrow-circle-down" id="expand-tabs-icon"></i> - </button> - <button id="expand-aside" type="button" class="navbar-toggle" data-toggle="offcanvas" data-target="#region_1"> - <i class="fa fa-arrow-circle-right" id="expand-aside-icon"></i> - </button> - {{if $nav.help.6}} - <button id="context-help-btn" class="navbar-toggle" type="button" onclick="contextualHelp(); return false;"> - <i class="fa fa-question-circle"></i> - </button> - {{/if}} + <div> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <button id="expand-tabs" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#tabs-collapse-1"> + <i class="fa fa-arrow-circle-down" id="expand-tabs-icon"></i> + </button> + <button id="expand-aside" type="button" class="navbar-toggle" data-toggle="offcanvas" data-target="#region_1"> + <i class="fa fa-arrow-circle-right" id="expand-aside-icon"></i> + </button> + {{if $nav.help.6}} + <button id="context-help-btn" class="navbar-toggle" type="button" onclick="contextualHelp(); return false;"> + <i class="fa fa-question-circle"></i> + </button> + {{/if}} + </div> {{if $userinfo}} <div class="usermenu-head dropdown-toggle fakelink" data-toggle="dropdown"> <img id="avatar" src="{{$userinfo.icon}}" alt="{{$userinfo.name}}"> @@ -45,9 +47,10 @@ {{/if}} </ul> {{else}} - {{if $nav.lock}} + {{if $nav.rusermenu}} <ul class="dropdown-menu" role="menu" aria-labelledby="avatar"> - <li role="presentation"><a href="{{$nav.lock.0}}" title="{{$nav.lock.3}}" role="menuitem">{{$nav.lock.3}}</a></li> + <li role="presentation"><a href="{{$nav.rusermenu.0}}" role="menuitem">{{$nav.rusermenu.1}}</a></li> + <li role="presentation"><a href="{{$nav.rusermenu.2}}" role="menuitem">{{$nav.rusermenu.3}}</a></li> </ul> {{/if}} {{/if}} @@ -205,15 +208,24 @@ <a class="{{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}"{{if $nav.help.6}} onclick="contextualHelp(); return false;"{{/if}}>{{if $nav.help.6}}<i class="fa fa-question-circle"></i>{{else}}<i class="fa fa-question"></i>{{/if}}</a> </li> {{/if}} + + {{if $navapps}} + <li class="dropdown-toggle" data-toggle="dropdown"> + <a href="#"><i class="fa fa-bars"></i></a> + </li> + {{$navapps}} + {{/if}} + </ul> + </div> </div> {{if $nav.help.6}} <div id="contextual-help-content" class="contextual-help-content"> {{$nav.help.5}} <div class="pull-right"> - <a class="contextual-help-tool" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}"><i class="fa fa-question"></i></a> - <a class="contextual-help-tool" href="#" onclick="contextualHelp(); return false;"><i class="fa fa-times"></i></a> + <a class="contextual-help-tool btn btn-primary btn-xs" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}"><i class="fa fa-question"></i> {{$fulldocs}}</a> + <a class="contextual-help-tool btn btn-default btn-xs" href="#" onclick="contextualHelp(); return false;"><i class="fa fa-times"></i></a> </div> </div> {{/if}} diff --git a/view/tpl/navapps.tpl b/view/tpl/navapps.tpl new file mode 100644 index 000000000..fe6549139 --- /dev/null +++ b/view/tpl/navapps.tpl @@ -0,0 +1,5 @@ +<ul class="dropdown-menu"> + {{foreach $apps as $app}} + <li><a href="{{$app.url}}">{{$app.name}}</a></li> + {{/foreach}} +</ul> diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl index 0e8c8017c..c4da3783b 100644 --- a/view/tpl/notes.tpl +++ b/view/tpl/notes.tpl @@ -1,27 +1,33 @@ <div class="widget"> -<script> -var noteSaveTimer = null; -$(document).on('focusout',"#note-text",function(e){ - if(noteSaveTimer) - clearTimeout(noteSaveTimer); - notePostFinal(); - noteSaveTimer = null; -}); + <h3>{{$banner}}</h3> + <textarea name="note_text" id="note-text">{{$text}}</textarea> + <script> + var noteSaveTimer = null; + var noteText = $('#note-text'); -$(document).on('focusin',"#note-text",function(e){ - noteSaveTimer = setTimeout(noteSaveChanges,10000); -}); + noteText.on('change keyup keydown paste cut', function () { + $(this).height(0).height(this.scrollHeight); + $(document.body).trigger("sticky_kit:recalc"); + }).change(); -function notePostFinal() { - $.post('notes/sync', { 'note_text' : $('#note-text').val() }); -} + $(document).on('focusout',"#note-text",function(e){ + if(noteSaveTimer) + clearTimeout(noteSaveTimer); + notePostFinal(); + noteSaveTimer = null; + }); -function noteSaveChanges() { - $.post('notes', { 'note_text' : $('#note-text').val() }); - noteSaveTimer = setTimeout(noteSaveChanges,10000); -} -</script> + $(document).on('focusin',"#note-text",function(e){ + noteSaveTimer = setTimeout(noteSaveChanges,10000); + }); -<h3>{{$banner}}</h3> -<textarea name="note_text" id="note-text">{{$text}}</textarea> + function notePostFinal() { + $.post('notes/sync', { 'note_text' : $('#note-text').val() }); + } + + function noteSaveChanges() { + $.post('notes', { 'note_text' : $('#note-text').val() }); + noteSaveTimer = setTimeout(noteSaveChanges,10000); + } + </script> </div> diff --git a/view/tpl/nwiki_page_history.tpl b/view/tpl/nwiki_page_history.tpl new file mode 100644 index 000000000..d99f83863 --- /dev/null +++ b/view/tpl/nwiki_page_history.tpl @@ -0,0 +1,59 @@ +<style> + .diff { + width:100%; + word-break: break-all; + } + + .diff td{ + padding:0 0.667em; + vertical-align:top; + white-space:pre; + white-space:pre-wrap; + font-family:Consolas,'Courier New',Courier,monospace; + font-size:1.0em; + line-height:1.333; + } + + .diff span{ + display:block; + min-height:1.333em; + margin-top:-1px; + padding:0 3px; + } + + * html .diff span{ + height:1.333em; + } + + .diff span:first-child{ + margin-top:0; + } + + .diffDeleted span{ + border:1px solid rgb(255,192,192); + background:rgb(255,224,224); + } + + .diffInserted span{ + border:1px solid rgb(192,255,192); + background:rgb(224,255,224); + } +</style> +<table class="table-striped table-responsive table-hover" style="width: 100%;"> + {{foreach $pageHistory as $commit}} + <tr><td> + <table id="rev-{{$commit.revision}}" onclick="$('#details-{{$commit.revision}}').show()" width="100%"> + <tr><td width="10%">Date</td><td width="70%">{{$commit.date}}</td> + <td rowspan="3" width="20%" align="right"> + {{if $permsWrite}} + <button id="revert-{{$commit.revision}}" class="btn btn-danger btn-xs" onclick="wiki_revert_page('{{$commit.revision}}')">Revert</button> + <br><br> + {{/if}} + <button id="compare-{{$commit.revision}}" class="btn btn-warning btn-xs" onclick="wiki_compare_page('{{$commit.revision}}')">Compare</button> + </td></tr> + <tr><td>{{$name_lbl}}</td><td>{{$commit.name}}</td></tr> + <tr><td>{{$msg_label}}</td><td>{{$commit.title}}</td></tr> + </table> + </td></tr> + {{/foreach}} +</table> diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index 0b7f792a6..ae0b7f1ea 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -1,7 +1,6 @@ <div id="peoplefind-sidebar" class="widget"> <h3>{{$findpeople}}</h3> <form action="directory" method="post" /> - <input type="hidden" name="navsearch" value="1" /> <div class="form-group"> <div class="input-group"> <input class="widget-input" type="text" name="search" title="{{$hint}}{{if $advanced_search}}{{$advanced_hint}}{{/if}}" placeholder="{{$desc}}" /> diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl index f097646e4..6289f5321 100755 --- a/view/tpl/photo_album.tpl +++ b/view/tpl/photo_album.tpl @@ -1,4 +1,4 @@ -<div class="generic-content-wrapper"> +<div class="{{if !$no_fullscreen_btn}}generic-content-wrapper{{/if}}"> <div class="section-title-wrapper"> <div class="pull-right"> {{if $order}} @@ -12,10 +12,6 @@ <button class="btn btn-xs btn-success btn-xs" title="{{$usage}}" onclick="openClose('photo-upload-form'); closeMenu('photo-album-edit-wrapper');"><i class="fa fa-arrow-circle-o-up"></i> {{$upload.0}}</button> {{/if}} </div> - {{if !$no_fullscreen_btn}} - <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button> - <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button> - {{/if}} </div> <h2>{{$album}}</h2> <div class="clear"></div> diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl index db5ffe3f5..967abea71 100755 --- a/view/tpl/photo_view.tpl +++ b/view/tpl/photo_view.tpl @@ -7,7 +7,7 @@ <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-caret-down"></i> {{$tools_label}} </button> - <ul class="dropdown-menu"> + <ul class="dropdown-menu dropdown-menu-right"> {{if $tools}} <li class="nav-item"> <a class="nav-link" href="{{$tools.profile.0}}"><i class="fa fa-user"></i> {{$tools.profile.1}}</a> @@ -32,7 +32,7 @@ {{if $lock}} <div class="btn-group"> <button id="lockview" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" title="{{$lock}}" onclick="lockview('photo',{{$id}});" ><i class="fa fa-lock"></i></button> - <ul id="panel-{{$id}}" class="lockview-panel dropdown-menu"></ul> + <ul id="panel-{{$id}}" class="lockview-panel dropdown-menu dropdown-menu-right"></ul> </div> {{/if}} {{if $prevlink || $nextlink}} diff --git a/view/tpl/photos_recent.tpl b/view/tpl/photos_recent.tpl index 4cb1bc306..92e70692f 100755 --- a/view/tpl/photos_recent.tpl +++ b/view/tpl/photos_recent.tpl @@ -4,8 +4,6 @@ {{if $can_post}} <button class="btn btn-xs btn-success acl-form-trigger" title="{{$usage}}" onclick="openClose('photo-upload-form');" data-form_id="photos-upload-form"><i class="fa fa-arrow-circle-o-up"></i> {{$upload.0}}</button> {{/if}} - <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button> - <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button> </div> <h2>{{$title}}</h2> <div class="clear"></div> diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl index 59490ccc1..4000f39d6 100755 --- a/view/tpl/profile_advanced.tpl +++ b/view/tpl/profile_advanced.tpl @@ -34,6 +34,11 @@ <a class="btn btn-primary btn-xs" href="{{$editmenu.edit.0}}" ><i class="fa fa-pencil"></i> {{$editmenu.edit.3}}</a> </div> {{/if}} + {{if $exportlink}} + <div class="btn-group"> + <a class="btn btn-default btn-xs" href="{{$exportlink}}" ><i class="fa fa-vcard"></i> {{$export}}</a> + </div> + {{/if}} </div> <h2>{{$title}}</h2> <div class="clear"></div> diff --git a/view/tpl/prv_message.tpl b/view/tpl/prv_message.tpl index 0c9b9ba1d..e4e923ddb 100755 --- a/view/tpl/prv_message.tpl +++ b/view/tpl/prv_message.tpl @@ -7,10 +7,9 @@ {{/if}} <div id="prvmail-wrapper" > <form id="prvmail-form" action="mail" method="post" > - <input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" /> <input type="hidden" name="media_str" id="jot-media" value="" /> - + <input type="hidden" name="preview" id="mail-preview" value="0" /> {{if $new}} <div class="form-group"> <label for="recip">{{$to}}</label> @@ -22,20 +21,18 @@ <input class="form-control" type="text" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" /> </div> {{/if}} - {{if $reply}} <input type="hidden" name="replyto" value="{{$parent}}" /> <input type="hidden" name="messageto" value="{{$recphash}}" /> <input type="hidden" name="subject" value="{{$subjtxt}}" /> {{/if}} - <div class="form-group"> <label for="prvmail-text">{{$yourmessage}}</label> <textarea class="form-control" id="prvmail-text" name="body">{{$text}}</textarea> </div> - <div id="prvmail-submit-wrapper" class="form-group"> - <div id="prvmail-submit" class="pull-right"> + <div id="prvmail-submit" class="pull-right btn-group"> + <button class="btn btn-default btn-sm" id="prvmail-preview" title="{{$preview}}" onclick="preview_mail(); return false;"><i class="fa fa-eye"></i></button> <button class="btn btn-primary btn-sm" type="submit" id="prvmail-submit" name="submit" value="{{$submit}}">{{$submit}}</button> </div> <div id="prvmail-tools" class="btn-toolbar pull-left"> @@ -78,7 +75,6 @@ {{/if}} </div> {{/if}} - <div class="btn-group visible-xs visible-sm"> <button type="button" id="more-tools" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i id="more-tools-icon" class="fa fa-caret-down jot-icons"></i> @@ -93,14 +89,13 @@ {{/if}} </ul> </div> - - </div> <div id="prvmail-rotator-wrapper" class="pull-left"> <div id="prvmail-rotator"></div> </div> <div class="clear"></div> </div> + <div id="mail-preview-content" style="display: none;"></div> </form> </div> {{if $new}} diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl index 51fa8b8dc..a490cb473 100755 --- a/view/tpl/search_item.tpl +++ b/view/tpl/search_item.tpl @@ -74,13 +74,20 @@ <i class="fa fa-caret-down"></i> </button> <ul class="dropdown-menu"> - {{if $item.item_photo_menu}} - {{$item.item_photo_menu}} + {{if $item.thread_action_menu}} + {{foreach $item.thread_action_menu as $mitem}} + <li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-{{$mitem.icon}}"></i> {{$mitem.title}}</a></li> + {{/foreach}} {{/if}} {{if $item.drop.dropping}} - <li role="presentation" class="divider"></li> <li><a href="item/drop/{{$item.id}}" onclick="return confirmDelete();" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li> {{/if}} + {{if $item.thread_author_menu}} + <li role="presentation" class="divider"></li> + {{foreach $item.thread_author_menu as $mitem}} + <li role="presentation"><a role="menuitem" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a></li> + {{/foreach}} + {{/if}} </ul> </div> {{if $item.attachments}} diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index 0ec44e9ff..05e531ba7 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -112,6 +112,7 @@ {{include file="field_intcheckbox.tpl" field=$notify2}} {{include file="field_intcheckbox.tpl" field=$notify3}} {{include file="field_intcheckbox.tpl" field=$notify4}} + {{*include file="field_intcheckbox.tpl" field=$notify9*}} {{include file="field_intcheckbox.tpl" field=$notify5}} {{include file="field_intcheckbox.tpl" field=$notify6}} {{include file="field_intcheckbox.tpl" field=$notify7}} diff --git a/view/tpl/settings_nick_set.tpl b/view/tpl/settings_nick_set.tpl index 2460952fe..76fe7cd8d 100755 --- a/view/tpl/settings_nick_set.tpl +++ b/view/tpl/settings_nick_set.tpl @@ -1,4 +1,8 @@ <div id="settings-nick-wrapper" class="section-content-info-wrapper"> -<div id="settings-nickname-desc">{{$desc}} <strong>'{{$nickname}}@{{$basepath}}'</strong>{{$subdir}}</div> +<div id="settings-nickname-desc">{{$desc}} <strong>'{{$nickname}}@{{$basepath}}'</strong></div> +{{if $davpath}} +<br> +<div id="settings-dav-desc">{{$davdesc}} <strong>'{{$davpath}}'</strong></div> +{{/if}} </div> <div id="settings-nick-end" ></div> diff --git a/view/tpl/siteinfo.tpl b/view/tpl/siteinfo.tpl index e50284b9c..a5b99fd83 100755 --- a/view/tpl/siteinfo.tpl +++ b/view/tpl/siteinfo.tpl @@ -1,26 +1,41 @@ <div class="generic-content-wrapper-styled"> -<h3>{{$title}}</h3> -<p></p> -<p>{{$description}}</p> -{{if $version}} -<p>{{$version}}{{if $commit}}+{{$commit}}{{/if}}</p> +<h2>{{$title}}</h2> + +<h3>{{$sitenametxt}}</h3> + +<div>{{$sitename}}</div> + +<h3>{{$headline}}</h3> + +<div>{{if $site_about}}{{$site_about}}{{else}}--{{/if}}</div> + +<h3>{{$admin_headline}}</h3> + +<div>{{if $admin_about}}{{$admin_about}}{{else}}--{{/if}}</div> + +<br><br> +<div><a href="help/TermsOfService">{{$terms}}</a></div> + +<hr> + +<h2>{{$prj_header}}</h2> + +<div>{{$prj_name}} ({{$z_server_role}})</div> + +{{if $prj_version}} +<div>{{$prj_version}}</div> {{/if}} -{{if $tag}} -<p>{{$tag_txt}} {{$tag}}</p> -{{/if}} -{{if $polled}} -<p>{{$polled}} {{$lastpoll}}</p> -{{/if}} -<p>{{$load_average}} {{$loadavg_all}}</p> -<p>{{$web_location}}</p> -<p>{{$visit}}</p> -<p>{{$bug_text}} <a href="{{$bug_link_url}}">{{$bug_link_text}}</a></p> -<p>{{$adminlabel}}</p> -<p>{{$admininfo}}</p> -<p>{{$contact}}</p> -<p>{{$plugins_text}}</p> -{{if $plugins_list}} - <div style="margin-left: 25px; margin-right: 25px;">{{$plugins_list}}</div> -{{/if}} -<p>{{$donate}}</p> + + +<h3>{{$prj_linktxt}}</h3> + +<div>{{$prj_link}}</div> + +<h3>{{$prj_srctxt}}</h3> + +<div>{{$prj_src}}</div> + +<br><br> +<div>{{$prj_transport}} ({{$transport_link}})</div> + </div> diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 4eefb3189..af6b6800e 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -1,169 +1,131 @@ -<style type="text/css" media="screen"> - #ace-editor { - position: relative; - width: 100%; - height: 500px; - } - .fade.in { - -webkit-transition: opacity 0.5s 0.5s ease; - -moz-transition: opacity 0.5s 0.5s ease; - -o-transition: opacity 0.5s 0.5s ease; - transition: opacity 0.5s 0.5s ease; - } -</style> -<div class="generic-content-wrapper"> - <div class="section-title-wrapper"> - - <div class="pull-right"> - {{if $showPageControls}} - <div class="btn-group"> +<div class="generic-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}> + <div class="section-title-wrapper"> + <div class="pull-right"> + {{if $showPageControls}} + <div id="page-tools" class="btn-group" style="display: none;"> <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-caret-down"></i> {{$tools_label}} </button> - <ul class="dropdown-menu"> - - <li class="nav-item"> - <a id="rename-page" class="nav-link" href="#"><i class="fa fa-edit"></i> Rename Page</a> - </li> + <ul class="dropdown-menu dropdown-menu-right"> + {{if $renamePage}} <li class="nav-item"> - <a id="delete-page" class="nav-link" href="#"><i class="fa fa-trash-o"></i> Delete Page</a> + <a class="nav-link rename-page" href="#"><i class="fa fa-edit"></i> {{$renamePage}}</a> </li> + {{/if}} <li class="nav-item"> <a id="embed-image" class="nav-link" href="#"><i class="fa fa-picture-o"></i> Embed Image</a> </li> - </ul> </div> - - {{/if}} - - <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button> - <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button> - </div> - <h2><span id="wiki-header-name">{{$wikiheaderName}}</span>: <span id="wiki-header-page">{{$wikiheaderPage}}</span></h2> - <div class="clear"></div> - </div> - - - <div id="new-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> - <form id="new-page-form" action="wiki/create/page" method="post" > - <div class="clear"></div> - {{include file="field_input.tpl" field=$pageName}} - <div class="btn-group pull-right"> - <button id="new-page-submit" class="btn btn-success" type="submit" name="submit" >Create Page</button> - </div> - </form> <div class="clear"></div> - <hr> - </div> - - <div id="rename-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> - <form id="rename-page-form" action="wiki/rename/page" method="post" > - <div class="clear"></div> - {{include file="field_input.tpl" field=$pageRename}} - <div class="btn-group pull-right"> - <button id="rename-page-submit" class="btn btn-warning" type="submit" name="submit" >Rename Page</button> - </div> - </form> <div class="clear"></div> - <hr> - </div> - - <div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}> - <ul class="nav nav-tabs" id="wiki-nav-tabs"> - <li id="edit-pane-tab"><a data-toggle="tab" href="#edit-pane">Edit</a></li> - <li class="active"><a data-toggle="tab" href="#preview-pane" id="wiki-get-preview">Preview</a></li> - <li {{if $hidePageHistory}}style="display: none;"{{/if}}><a data-toggle="tab" href="#page-history-pane" id="wiki-get-history">History</a></li> - - </ul> - - <div class="tab-content" id="wiki-page-tabs"> - - <div id="edit-pane" class="tab-pane fade"> - <div id="ace-editor"></div> - </div> - <div id="preview-pane" class="tab-pane fade in active"> - <div id="wiki-preview" class="section-content-wrapper"> - {{$renderedContent}} - </div> - </div> - <div id="page-history-pane" class="tab-pane fade" {{if $hidePageHistory}}style="display: none;"{{/if}}> - <div id="page-history-list" class="section-content-wrapper"> - </div> - </div> - - - </div> - </div> - {{if $showCommitMsg}} - {{if $showPageControls}} - <div class="section-content-wrapper"> - <div id="id_{{$commitMsg.0}}_wrapper" class='form-group field input'> - <label for='id_{{$commitMsg.0}}' id='label_{{$commitMsg.0}}'>{{$commitMsg.1}}{{if $commitMsg.4}}<span class="required"> {{$commitMsg.4}}</span>{{/if}}</label> - <span> - <input class="" style="width: 80%;" name='{{$commitMsg.0}}' id='id_{{$commitMsg.0}}' type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}> - <a id="save-page" href="#" class="btn btn-primary btn-md">Save</a> - </span> - <span id='help_{{$commitMsg.0}}' class='help-block'>{{$commitMsg.3}}</span> - + {{/if}} + <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(); adjustFullscreenEditorHeight();"><i class="fa fa-expand"></i></button> + <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false); adjustInlineEditorHeight()"><i class="fa fa-compress"></i></button> + </div> + <h2> + <span id="wiki-header-name">{{$wikiheaderName}}</span>: + <span id="wiki-header-page">{{$wikiheaderPage}}</span> + </h2> <div class="clear"></div> </div> - </div> - {{/if}} - {{/if}} + <div id="rename-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> + <form id="rename-page-form" action="wiki/rename/page" method="post" > + {{include file="field_input.tpl" field=$pageRename}} + <div class="form-group"> + <div class="pull-right"> + <button id="rename-page-submit" class="btn btn-primary" type="submit" name="submit">Submit</button> + </div> + <div> + <button class="btn btn-default rename-page" type="button">Cancel</button> + </div> + <div class="clear"></div> + </div> + </form> + </div> + <div id="wiki-content-container" class="section-content-wrapper"> + <ul class="nav nav-tabs" id="wiki-nav-tabs"> + <li id="edit-pane-tab"><a data-toggle="tab" href="#edit-pane">{{$editOrSourceLabel}}</a></li> + <li class="active"><a data-toggle="tab" href="#preview-pane" id="wiki-get-preview">View</a></li> + <li><a data-toggle="tab" href="#page-history-pane" id="wiki-get-history">History</a></li> + </ul> + <div class="tab-content" id="wiki-page-tabs"> + <div id="edit-pane" class="tab-pane fade"> + {{if !$mimeType || $mimeType == 'text/markdown'}} + <div id="ace-editor"></div> + {{else}} + <div id="editor-wrapper"> + <textarea id="editor">{{$content}}</textarea> + </div> + {{/if}} + {{if $showPageControls}} + <div> + <div id="id_{{$commitMsg.0}}_wrapper" class="field input"> + <div class="input-group"> + <input class="widget-input" name="{{$commitMsg.0}}" id="id_{{$commitMsg.0}}" type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}> + <div class="input-group-btn"> + <button id="save-page" type="button" class="btn btn-primary btn-sm disabled">Save</button> + </div> + </div> + </div> + </div> + {{/if}} + </div> + <div id="preview-pane" class="tab-pane fade in active"> + <div id="wiki-preview"> + {{$renderedContent}} + </div> + </div> + <div id="page-history-pane" class="tab-pane fade"> + <div id="page-history-list"></div> + </div> + </div> + </div> </div> {{$wikiModal}} - <div class="modal" id="embedPhotoModal" tabindex="-1" role="dialog" aria-labelledby="embedPhotoLabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="embedPhotoModalLabel">{{$embedPhotosModalTitle}}</h4> - </div> - <div class="modal-body" id="embedPhotoModalBody" > - <div id="embedPhotoModalBodyAlbumListDialog" class="hide"> - <div id="embedPhotoModalBodyAlbumList"></div> - </div> - <div id="embedPhotoModalBodyAlbumDialog" class="hide"> - </div> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">{{$embedPhotosModalCancel}}</button> - <button id="embed-photo-OKButton" type="button" class="btn btn-primary">{{$embedPhotosModalOK}}</button> - </div> - </div><!-- /.modal-content --> - </div><!-- /.modal-dialog --> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="embedPhotoModalLabel">{{$embedPhotosModalTitle}}</h4> + </div> + <div class="modal-body" id="embedPhotoModalBody" > + <div id="embedPhotoModalBodyAlbumListDialog" class="hide"> + <div id="embedPhotoModalBodyAlbumList"></div> + </div> + <div id="embedPhotoModalBodyAlbumDialog" class="hide"></div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{$embedPhotosModalCancel}}</button> + <button id="embed-photo-OKButton" type="button" class="btn btn-primary">{{$embedPhotosModalOK}}</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> </div><!-- /.modal --> - <script> - window.wiki_resource_id = '{{$resource_id}}'; - window.wiki_page_name = '{{$page}}'; - window.wiki_page_content = {{$content}}; - window.wiki_page_commit = '{{$commit}}'; - - if (window.wiki_page_name === 'Home') { - $('#delete-page').hide(); - $('#rename-page').hide(); - } - - $("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); - $("#generic-modal-ok-{{$wikiModalID}}").addClass('btn-danger'); - - $('#rename-page').click(function (ev) { - $('#rename-page-form-wrapper').show(); - ev.preventDefault(); - }); - - $( "#rename-page-form" ).submit(function( event ) { - $.post("wiki/{{$channel}}/rename/page", - { - oldName: window.wiki_page_name, - newName: $('#id_pageRename').val(), - resource_id: window.wiki_resource_id - }, - function (data) { + window.wiki_resource_id = '{{$resource_id}}'; + window.wiki_page_name = '{{$page}}'; + window.wiki_page_content = {{if !$mimeType || $mimeType == 'text/markdown'}}{{$content}}{{else}}`{{$content}}`{{/if}}; + window.wiki_page_commit = '{{$commit}}'; + + $("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); + $("#generic-modal-ok-{{$wikiModalID}}").addClass('btn-danger'); + + $('.rename-page').click(function (ev) { + $('#rename-page-form-wrapper').toggle(); + ev.preventDefault(); + }); + + $( "#rename-page-form" ).submit(function( event ) { + $.post("wiki/{{$channel}}/rename/page", + { + oldName: window.wiki_page_name, + newName: $('#id_pageRename').val(), + resource_id: window.wiki_resource_id + }, + function (data) { if (data.success) { $('#rename-page-form-wrapper').hide(); window.console.log('data: ' + JSON.stringify(data)); @@ -173,46 +135,79 @@ } else { window.console.log('Error renaming page.'); } - }, 'json'); - event.preventDefault(); - }); - - var editor = ace.edit("ace-editor"); - editor.setOptions({ - theme: "ace/theme/github", - mode: "ace/mode/markdown", - - wrap: true, - - minLines: 30, - maxLines: Infinity, - - printMargin: false - }); - - editor.getSession().setValue(window.wiki_page_content); - window.editor = editor; // Store the editor in the window object so the anonymous function can use it. - - $('#edit-pane-tab').click(function (ev) { - setTimeout(function() {window.editor.focus();}, 500); // Return the focus to the editor allowing immediate text entry - }); + }, 'json'); + event.preventDefault(); + }); + + {{if !$mimeType || $mimeType == 'text/markdown'}} + var editor = ace.edit("ace-editor"); + editor.setOptions({ + theme: "ace/theme/github", + mode: "ace/mode/markdown", + + maxLines: Infinity, + minLines: 30, + + wrap: true, + + printMargin: false + }); + + editor.getSession().setValue(window.wiki_page_content); + window.editor = editor; // Store the editor in the window object so the anonymous function can use it. + {{else}} + window.editor = editor = $('#editor'); + {{/if}} + + {{if !$showPageControls}} + {{if !$mimeType || $mimeType == 'text/markdown'}} + editor.setReadOnly(true); // Disable editing if the viewer lacks edit permission + {{else}} + editor.prop('readonly', true); + {{/if}} + {{/if}} - $('#wiki-get-preview').click(function (ev) { - $.post("wiki/{{$channel}}/preview", {content: editor.getValue(), resource_id: window.wiki_resource_id}, function (data) { - if (data.success) { - $('#wiki-preview').html(data.html); - $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); - } else { - window.console.log('Error previewing page.'); + $('#edit-pane-tab').click(function (ev) { + setTimeout(function() { + window.editor.focus(); + if($('main').hasClass('fullscreen')) { + adjustFullscreenEditorHeight(); } - }, 'json'); - ev.preventDefault(); - }); + else { + adjustInlineEditorHeight(); + } + }, 500); // Return the focus to the editor allowing immediate text entry + $('#page-tools').show(); + }); + + $('#wiki-get-preview').click(function (ev) { + $.post("wiki/{{$channel}}/preview", { + {{if !$mimeType || $mimeType == 'text/markdown'}} + content: editor.getValue(), + {{else}} + content: editor.val(), + {{/if}} + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { + $('#wiki-preview').html(data.html); + {{if !$mimeType || $mimeType == 'text/markdown'}} + $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); + {{/if}} + $('#page-tools').hide(); + } else { + window.console.log('Error previewing page.'); + } + }, 'json'); + ev.preventDefault(); + }); - $('#wiki-get-history').click(function (ev) { - $.post("wiki/{{$channel}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) { + $('#wiki-get-history').click(function (ev) { + $.post("wiki/{{$channel}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) { if (data.success) { $('#page-history-list').html(data.historyHTML); + $('#page-tools').hide(); } else { window.console.log('Error getting page history.'); } @@ -220,162 +215,103 @@ ev.preventDefault(); }); - function wiki_delete_wiki(wikiHtmlName, resource_id) { - if(!confirm('Are you sure you want to delete the entire wiki: ' + JSON.stringify(wikiHtmlName))) { - return; + function wiki_refresh_page_list() { + if (window.wiki_resource_id === '') { + return false; } - $.post("wiki/{{$channel}}/delete/wiki", {resource_id: resource_id}, function (data) { + $.post("wiki/{{$channel}}/get/page/list/", {resource_id: window.wiki_resource_id}, function (data) { if (data.success) { - window.console.log('Wiki deleted'); - // Refresh list and redirect page as necessary - window.location = 'wiki/{{$channel}}'; + $('#wiki_page_list_container').html(data.pages); + $('#wiki_page_list_container').show(); } else { - alert('Error deleting wiki!'); - window.console.log('Error deleting wiki.'); + alert('Error fetching page list!'); + window.console.log('Error fetching page list!'); } - }, 'json'); - } - - - function wiki_download_wiki(resource_id) { - window.location = "wiki/{{$channel}}/download/wiki/" + resource_id; - } + }, 'json'); + return false; + } - $('#new-page-submit').click(function (ev) { - if (window.wiki_resource_id === '') { - window.console.log('You must have a wiki open in order to create pages.'); - ev.preventDefault(); - return false; - } - $.post("wiki/{{$channel}}/create/page", {name: $('#id_pageName').val(), resource_id: window.wiki_resource_id}, - function (data) { - if (data.success) { - window.location = data.url; - } else { - window.console.log('Error creating page.'); - } - }, 'json'); + $('#save-page').click(function (ev) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '') { + window.console.log('You must have a wiki page open in order to edit pages.'); ev.preventDefault(); - }); - - function wiki_refresh_page_list() { - if (window.wiki_resource_id === '') { - return false; - } - $.post("wiki/{{$channel}}/get/page/list/", {resource_id: window.wiki_resource_id}, function (data) { - if (data.success) { - $('#wiki_page_list_container').html(data.pages); - $('#wiki_page_list_container').show(); - {{if $showNewPageButton}} - $('#new-page-button').show(); - {{else}} - $('#new-page-button').hide(); - {{/if}} - } else { - alert('Error fetching page list!'); - window.console.log('Error fetching page list!'); - } - }, 'json'); return false; } + {{if !$mimeType || $mimeType == 'text/markdown'}} + var currentContent = editor.getValue(); + {{else}} + var currentContent = editor.val(); + {{/if}} - $('#save-page').click(function (ev) { - if (window.wiki_resource_id === '' || window.wiki_page_name === '') { - window.console.log('You must have a wiki page open in order to edit pages.'); - ev.preventDefault(); - return false; - } - var currentContent = editor.getValue(); - if (window.wiki_page_content === currentContent) { + if (window.wiki_page_content === currentContent) { + $('#save-page').addClass('disabled'); // Disable the save button window.console.log('No edits to save.'); ev.preventDefault(); return false; - } - $.post("wiki/{{$channel}}/save/page", - { content: currentContent, - commitMsg: $('#id_commitMsg').val(), - name: window.wiki_page_name, - resource_id: window.wiki_resource_id - }, - function (data) { - if (data.success) { + } + $.post("wiki/{{$channel}}/save/page", { + content: currentContent, + commitMsg: $('#id_commitMsg').val(), + name: window.wiki_page_name, + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { window.console.log('Page saved successfully.'); window.wiki_page_content = currentContent; $('#id_commitMsg').val(''); // Clear the commit message box - $('#wiki-get-history').click(); - } else { + $('#save-page').addClass('disabled'); // Disable the save button + {{if !$mimeType || $mimeType == 'text/markdown'}} + window.editor.getSession().getUndoManager().markClean(); // Reset the undo history for the editor + {{/if}} + + window.editor.focus(); // Return focus to the editor for continued editing + // $('#wiki-get-history').click(); + } else { alert('Error saving page.'); // TODO: Replace alerts with auto-timeout popups window.console.log('Error saving page.'); - } - }, 'json'); - ev.preventDefault(); - }); - - $('#delete-page').click(function (ev) { - if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_name === 'Home') { - window.console.log('You must have a wiki page open in order to delete pages.'); - ev.preventDefault(); - return false; } - if(!confirm('Are you sure you want to delete the page: ' + window.wiki_page_name)) { - ev.preventDefault(); - return; - } - $.post("wiki/{{$channel}}/delete/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, - function (data) { - if (data.success) { - window.console.log('Page deleted successfully.'); - var url = window.location.href; - if (url.substr(-1) == '/') url = url.substr(0, url.length - 2); - url = url.split('/'); - url.pop(); - window.location = url.join('/'); - } else { - alert('Error deleting page.'); // TODO: Replace alerts with auto-timeout popups - window.console.log('Error deleting page.'); - } - }, 'json'); - ev.preventDefault(); - }); + }, 'json'); + ev.preventDefault(); + }); - function wiki_revert_page(commitHash) { - if (window.wiki_resource_id === '' || window.wiki_page_name === '') { + function wiki_revert_page(commitHash) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '') { window.console.log('You must have a wiki page open in order to revert pages.'); return false; - } - $.post("wiki/{{$channel}}/revert/page", {commitHash: commitHash, name: window.wiki_page_name, resource_id: window.wiki_resource_id}, - function (data) { - if (data.success) { - $('button[id^=revert-]').removeClass('btn-success'); - $('button[id^=revert-]').addClass('btn-danger'); - $('button[id^=revert-]').html('Revert'); - $('#revert-'+commitHash).removeClass('btn-danger'); - $('#revert-'+commitHash).addClass('btn-success'); - $('#revert-'+commitHash).html('Page reverted<br>but not saved'); - window.wiki_page_commit = commitHash; - // put contents in editor - editor.getSession().setValue(data.content); - } else { - window.console.log('Error reverting page.'); - } - }, 'json'); } + $.post("wiki/{{$channel}}/revert/page", {commitHash: commitHash, name: window.wiki_page_name, resource_id: window.wiki_resource_id}, + function (data) { + if (data.success) { + $('button[id^=revert-]').removeClass('btn-success'); + $('button[id^=revert-]').addClass('btn-danger'); + $('button[id^=revert-]').html('Revert'); + $('#revert-'+commitHash).removeClass('btn-danger'); + $('#revert-'+commitHash).addClass('btn-success'); + $('#revert-'+commitHash).html('Page reverted<br>but not saved'); + window.wiki_page_commit = commitHash; + // put contents in editor + editor.getSession().setValue(data.content); + } else { + window.console.log('Error reverting page.'); + } + }, 'json'); + } - function wiki_compare_page(compareCommit) { - if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_commit === '') { + function wiki_compare_page(compareCommit) { + if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_commit === '') { window.console.log('You must have a wiki page open in order to revert pages.'); return false; - } - $.post("wiki/{{$channel}}/compare/page", - { - compareCommit: compareCommit, - currentCommit: window.wiki_page_commit, - name: window.wiki_page_name, - resource_id: window.wiki_resource_id - }, - function (data) { - console.log(data); - if (data.success) { + } + $.post("wiki/{{$channel}}/compare/page", { + compareCommit: compareCommit, + currentCommit: window.wiki_page_commit, + name: window.wiki_page_name, + resource_id: window.wiki_resource_id + }, + function (data) { + console.log(data); + if (data.success) { var modalBody = $('#generic-modal-body-{{$wikiModalID}}'); modalBody.html('<div class="descriptive-text">'+data.diff+'</div>'); $('.modal-dialog').addClass('modal-lg'); @@ -385,134 +321,153 @@ $('#generic-modal-{{$wikiModalID}}').modal('hide'); }); $('#generic-modal-{{$wikiModalID}}').modal(); - } else { + } else { window.console.log('Error comparing page.'); - } - }, 'json'); - } + } + }, 'json'); + } - $('#embed-image').click(function (ev) { - initializeEmbedPhotoDialog(); - ev.preventDefault(); + function adjustFullscreenEditorHeight() { + $('#editor, #ace-editor').height($(window).height() - $('#id_commitMsg_wrapper').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - $('#wiki-nav-tabs').outerHeight(true) - 17); + {{if !$mimeType || $mimeType == 'text/markdown'}} + editor.setOptions({ + maxLines: null, + minLines: null }); + editor.resize(); + {{/if}} + } + function adjustInlineEditorHeight() { + {{if !$mimeType || $mimeType == 'text/markdown'}} + editor.setOptions({ + maxLines: Infinity, + minLines: 30 + }); + editor.resize(); + {{else}} + editor.height(editor[0].scrollHeight); + {{/if}} + } - var initializeEmbedPhotoDialog = function () { - $('.embed-photo-selected-photo').each(function (index) { - $(this).removeClass('embed-photo-selected-photo'); - }); - getPhotoAlbumList(); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal(); - }; + $('#embed-image').click(function (ev) { + initializeEmbedPhotoDialog(); + ev.preventDefault(); + }); - var choosePhotoFromAlbum = function (album) { - $.post("embedphotos/album", {name: album}, - function(data) { - if (data['status']) { - $('#embedPhotoModalLabel').html('{{$modalchooseimages}}'); - $('#embedPhotoModalBodyAlbumDialog').html('\ - <div><ul class="nav">\n\ - <li><a href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\ - <i class="fa fa-chevron-left"></i> \n\ - {{$modaldiffalbum}}\n\ - </a>\n\ - </li>\n\ - </ul><br></div>') - $('#embedPhotoModalBodyAlbumDialog').append(data['content']); - $('#embedPhotoModalBodyAlbumDialog').click(function (evt) { - evt.preventDefault(); - var image = document.getElementById(evt.target.id); - if (typeof($(image).parent()[0]) !== 'undefined') { - var imageparent = document.getElementById($(image).parent()[0].id); - $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('hide'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('hide'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); - $.post("embedphotos/photolink", {href: href}, - function(ddata) { - if (ddata['status']) { - var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' ) - editor.getSession().insert(editor.getCursorPosition(), imgURL) - } else { - window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']); - } - return false; - }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); - }); - } else { - window.console.log('{{$modalerroralbum}} ' + JSON.stringify(album) + ':' + data['errormsg']); - } - return false; - }, - 'json'); - }; - - var getPhotoAlbumList = function () { - $.post("embedphotos/albumlist", {}, - function(data) { - if (data['status']) { - var albums = data['albumlist']; //JSON.parse(data['albumlist']); - $('#embedPhotoModalLabel').html('{{$modalchoosealbum}}'); - $('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>'); - for(var i=0; i<albums.length; i++) { - var albumName = albums[i].text; - var albumLink = '<li>'; - albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + albumName + '\');return false;">' + albumName + '</a>'; - albumLink += '</li>'; - $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink); + var initializeEmbedPhotoDialog = function () { + $('.embed-photo-selected-photo').each(function (index) { + $(this).removeClass('embed-photo-selected-photo'); + }); + getPhotoAlbumList(); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal(); + }; + + var choosePhotoFromAlbum = function (album) { + $.post("embedphotos/album", {name: album}, + function(data) { + if (data['status']) { + $('#embedPhotoModalLabel').html("{{$modalchooseimages}}"); + $('#embedPhotoModalBodyAlbumDialog').html('\ + <div><ul class="nav">\n\ + <li><a href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\ + <i class="fa fa-chevron-left"></i> \n\ + {{$modaldiffalbum}}\n\ + </a>\n\ + </li>\n\ + </ul><br></div>') + $('#embedPhotoModalBodyAlbumDialog').append(data['content']); + $('#embedPhotoModalBodyAlbumDialog').click(function (evt) { + evt.preventDefault(); + var image = document.getElementById(evt.target.id); + if (typeof($(image).parent()[0]) !== 'undefined') { + var imageparent = document.getElementById($(image).parent()[0].id); + $(imageparent).toggleClass('embed-photo-selected-photo'); } - $('#embedPhotoModalBodyAlbumDialog').addClass('hide'); - $('#embedPhotoModalBodyAlbumListDialog').removeClass('hide'); - } else { - window.console.log('{{$modalerrorlist}}' + ':' + data['errormsg']); + }); + $('#embedPhotoModalBodyAlbumListDialog').addClass('hide'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('hide'); + $('#embed-photo-OKButton').click(function () { + $('.embed-photo-selected-photo').each(function (index) { + var href = $(this).attr('href'); + $.post("embedphotos/photolink", {href: href}, + function(ddata) { + if (ddata['status']) { + {{if !$mimeType || $mimeType == 'text/markdown'}} + var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' ) + editor.getSession().insert(editor.getCursorPosition(), imgURL) + {{else}} + var currentContent = $('#editor').val(); + $('#editor').val(currentContent + ddata['photolink']); + {{/if}} + } else { + window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); + } + return false; + }, + 'json'); + }); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + }); + } else { + window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); + } + return false; + }, + 'json'); + }; + + var getPhotoAlbumList = function () { + $.post("embedphotos/albumlist", {}, + function(data) { + if (data['status']) { + var albums = data['albumlist']; //JSON.parse(data['albumlist']); + $('#embedPhotoModalLabel').html("{{$modalchoosealbum}}"); + $('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>'); + for(var i = 0; i < albums.length; i++) { + var albumName = albums[i].text; + var jsAlbumName = albums[i].jstext; + var albumLink = '<li>'; + albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>'; + albumLink += '</li>'; + $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink); } - return false; - }, - 'json'); - }; - - function wiki_show_new_wiki_form() { - $('#new-page-form-wrapper').hide(); - $('#edit-wiki-form-wrapper').hide(); - $('#new-wiki-form-wrapper').toggle(); - return false; - } - - function wiki_show_new_page_form() { - $('#edit-wiki-form-wrapper').hide(); - $('#new-wiki-form-wrapper').hide(); - $('#new-page-form-wrapper').toggle(); - return false; - } + $('#embedPhotoModalBodyAlbumDialog').addClass('hide'); + $('#embedPhotoModalBodyAlbumListDialog').removeClass('hide'); + } else { + window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']); + } + return false; + }, + 'json'); + }; + + $(document).ready(function () { + wiki_refresh_page_list(); + + {{if !$mimeType || $mimeType == 'text/markdown'}} + $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); + window.editor.on("input", function() { + if(window.editor.getSession().getUndoManager().isClean()) { + $('#save-page').addClass('disabled'); + } else { + $('#save-page').removeClass('disabled'); + } + }); + {{else}} + window.editor.on("input", function() { + $('#save-page').removeClass('disabled'); + }); + window.editor.bbco_autocomplete('bbcode'); + {{/if}} + }); - function wiki_show_edit_wiki_form(wiki_title, wiki_resource_id) { - window.wiki_resource_id = wiki_resource_id; - window.wiki_title = wiki_title; - $('#new-page-form-wrapper').hide(); - $('#new-wiki-form-wrapper').hide(); - $('#edit-wiki-form-wrapper').toggle(); - return false; + $(window).resize(function () { + if($('main').hasClass('fullscreen')) { + adjustFullscreenEditorHeight(); } - - $(document).ready(function () { - wiki_refresh_page_list(); - $("#wiki-toc").toc({content: "#wiki-preview", headings: "h1,h2,h3,h4"}); - // Show Edit tab first. Otherwise the Ace editor does not load. - $("#wiki-nav-tabs li:eq(1) a").tab('show'); - {{if $showNewWikiButton}} - $('#new-wiki-button').show(); - {{else}} - $('#new-wiki-button').hide(); - {{/if}} - }); + }); </script> diff --git a/view/tpl/wiki_page_history.tpl b/view/tpl/wiki_page_history.tpl index 9a313f767..ca16e8333 100644 --- a/view/tpl/wiki_page_history.tpl +++ b/view/tpl/wiki_page_history.tpl @@ -1,6 +1,7 @@ <style> .diff { width:100%; + word-break: break-all; } .diff td{ @@ -44,8 +45,10 @@ <table id="rev-{{$commit.hash}}" onclick="$('#details-{{$commit.hash}}').show()" width="100%"> <tr><td width="10%">Date</td><td width="70%">{{$commit.date}}</td> <td rowspan="3" width="20%" align="right"> + {{if $permsWrite}} <button id="revert-{{$commit.hash}}" class="btn btn-danger btn-xs" onclick="wiki_revert_page('{{$commit.hash}}')">Revert</button> <br><br> + {{/if}} <button id="compare-{{$commit.hash}}" class="btn btn-warning btn-xs" onclick="wiki_compare_page('{{$commit.hash}}')">Compare</button> </td></tr> <tr><td>Name</td><td>{{$commit.name}} <{{$commit.email}}></td></tr> diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl index c020f2520..a270e6cee 100644 --- a/view/tpl/wiki_page_list.tpl +++ b/view/tpl/wiki_page_list.tpl @@ -1,14 +1,76 @@ {{if $not_refresh}}<div id="wiki_page_list_container" {{if $hide}} style="display: none;" {{/if}}>{{/if}} <div id="wiki_page_list" class="widget" > <h3>{{$header}}</h3> - <ul class="nav nav-pills nav-stacked"> {{if $pages}} {{foreach $pages as $page}} - <li><a href="/wiki/{{$channel}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a></li> + <li id="{{$page.link_id}}"> + {{if $page.resource_id && $canadd}} + <i class="widget-nav-pills-icons fa fa-trash-o drop-icons" onclick="wiki_delete_page('{{$page.title}}', '{{$page.url}}', '{{$page.resource_id}}', '{{$page.link_id}}')"></i> + {{/if}} + <a href="/wiki/{{$channel}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a> + </li> {{/foreach}} {{/if}} - {{if $canadd}}<li><a href="#" onclick="wiki_show_new_page_form(); return false;"><i class="fa fa-plus-circle"></i> {{$addnew}}</a></li>{{/if}} + {{if $canadd}} + <li><a href="#" onclick="wiki_show_new_page_form(); return false;"><i class="fa fa-plus-circle"></i> {{$addnew}}</a></li> + {{/if}} </ul> + {{if $canadd}} + <div id="new-page-form-wrapper" class="sub-menu" style="display:none;"> + <form id="new-page-form" action="wiki/{{$channel}}/create/page" method="post" > + <input type="hidden" name="resource_id" value="{{$resource_id}}"> + {{include file="field_input.tpl" field=$pageName}} + <button id="new-page-submit" class="btn btn-primary" type="submit" name="submit" >Submit</button> + </form> + </div> + {{/if}} </div> {{if $not_refresh}}</div>{{/if}} + +<script> + $('#new-page-submit').click(function (ev) { + $.post("wiki/{{$channel}}/create/page", {pageName: $('#id_pageName').val(), resource_id: window.wiki_resource_id}, + function(data) { + if(data.success) { + window.location = data.url; + } else { + window.console.log('Error creating page.'); + } + }, 'json'); + ev.preventDefault(); + }); + + function wiki_delete_page(wiki_page_name, wiki_page_url, wiki_resource_id, wiki_link_id) { + if(!confirm('Are you sure you want to delete the page: ' + wiki_page_name)) { + return; + } + $.post("wiki/{{$channel}}/delete/page", {name: wiki_page_url, resource_id: wiki_resource_id}, + function (data) { + if (data.success) { + window.console.log('Page deleted successfully.'); + if(wiki_page_url == window.wiki_page_name) { + var url = window.location.href; + if(url.substr(-1) == '/') + url = url.substr(0, url.length - 2); + url = url.split('/'); + url.pop(); + window.location = url.join('/'); + } + else { + $('#' + wiki_link_id).remove(); + } + } else { + alert('Error deleting page.'); // TODO: Replace alerts with auto-timeout popups + window.console.log('Error deleting page.'); + } + }, 'json'); + return false; + } + + function wiki_show_new_page_form() { + $('#new-page-form-wrapper').toggle(); + $('#id_pageName').focus(); + return false; + } +</script> diff --git a/view/tpl/wikilist.tpl b/view/tpl/wikilist.tpl index d3c6b867f..af566dc98 100644 --- a/view/tpl/wikilist.tpl +++ b/view/tpl/wikilist.tpl @@ -1,49 +1,78 @@ -<div id="wiki_list" class="widget"> - <h3>{{$header}}</h3> - <ul class="nav nav-pills nav-stacked"> - {{if $wikis}} - {{foreach $wikis as $wiki}} - <li>{{if $owner}}<a href="#" onclick="$('div[id^=\'edit-wiki-form-wrapper\']').hide(); $('div[id^=\'new-wiki-form-wrapper\']').hide(); openClose('edit-wiki-form-wrapper-{{$wiki.resource_id}}'); return false;" class="pull-right wikilist" title="{{$edit}}"><i class="fa fa-pencil"></i></a>{{/if}} - <a href="#" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;" title="{{$download}}" class="pull-right wikilist"><i class="fa fa-download"></i></a> - <a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="{{$view}}"{{if $wiki.active}} class="active"{{/if}}>{{$wiki.title}}</a> - {{if $owner}} - <div id="edit-wiki-form-wrapper-{{$wiki.resource_id}}" class="section-content-tools-wrapper" style="display:none;"> - <form id="edit-wiki-form" action="wiki/edit/wiki" method="post" > - <div class="clear"></div> - <div class="btn-group pull-right"> - <button class="btn btn-xs btn-danger" onclick="wiki_delete_wiki('{{$wiki.title}}', '{{$wiki.resource_id}}'); return false;"><i class="fa fa-trash-o"></i> Delete Wiki</button> - </div> - </form> - <div class="clear"></div> - </div> - {{/if}} - </li> - {{/foreach}} - {{/if}} +<div class="generic-content-wrapper"> + <div class="section-title-wrapper"> {{if $owner}} - <li><a href="#" class="fakelink" onclick="$('div[id^=\'edit-wiki-form-wrapper\']').hide(); openClose('new-wiki-form-wrapper'); return false;"><i id="new-wiki-button" class="fa fa-plus-circle"></i> {{$addnew}}</a></li> + <button type="button" class="btn btn-success btn-xs pull-right acl-form-trigger" onclick="openClose('new-wiki-form-wrapper');" data-form_id="new-wiki-form"><i class="fa fa-plus-circle"></i> {{$create}}</button> {{/if}} - </ul> + <h2>{{$header}}</h2> + </div> {{if $owner}} - <div id="new-wiki-form-wrapper" class="sub-menu" style="display:none;"> + <div id="new-wiki-form-wrapper" class="section-content-tools-wrapper"> <form id="new-wiki-form" action="wiki/{{$channel}}/create/wiki" method="post" class="acl-form" data-form_id="new-wiki-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'> {{include file="field_input.tpl" field=$wikiName}} - <div id="post-visible-container" class="checkbox"> - <label> - <input name="postVisible" id="postVisible" value="0" type="checkbox">{{$notify}} - </label> - </div> + {{include file="field_select.tpl" field=$mimeType}} + {{include file="field_checkbox.tpl" field=$notify}} <div> - <div id="profile-jot-submit-right" class="btn-group"> + <div class="btn-group pull-right"> <button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" title="Permission settings" onclick="return false;"> - <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons"></i>{{$bang}} + <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons"></i> </button> - <button id="new-wiki-submit" class="btn btn-primary btn-sm" type="submit" name="submit" >{{$create}}</button> + <button id="new-wiki-submit" class="btn btn-primary btn-sm" type="submit" name="submit" >{{$submit}}</button> </div> </div> </form> + {{$acl}} <div class="clear"></div> </div> {{/if}} + <div class="section-content-wrapper-np"> + <table id="wikis-index"> + <tr> + <th width="96%">{{$name}}</th> + <th width="1%">{{$type}}</th> + <th width="1%" class="wikis-index-tool"></th> + <th width="1%" class="wikis-index-tool"></th> + {{if $owner}} + <th width="1%"></th> + {{/if}} + </tr> + {{foreach $wikis as $wiki}} + <tr class="wikis-index-row"> + <td><a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="{{$view}}"{{if $wiki.active}} class="active"{{/if}}>{{$wiki.title}}</a></td> + <td>{{$wiki.mimeType}}</td> + <td class="wiki-index-tool dropdown"> + {{if $wiki.lock}} + <i class="fa fa-lock dropdown-toggle lockview" data-toggle="dropdown" onclick="lockview('item',{{$wiki.id}});"></i></button> + <ul id="panel-{{$wiki.id}}" class="lockview-panel dropdown-menu dropdown-menu-right"></ul> + {{/if}} + </td> + <!-- td class="wiki-index-tool"><i class="fa fa-download fakelink" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;"></i></td --!> + {{if $owner}} + <td><i class="fa fa-trash-o drop-icons" onclick="wiki_delete_wiki('{{$wiki.title}}', '{{$wiki.resource_id}}'); return false;"></i></td> + {{/if}} + </tr> + {{/foreach}} + </table> + </div> </div> -{{$acl}} +<script> + {{if $owner}} + function wiki_delete_wiki(wikiHtmlName, resource_id) { + if(!confirm('Are you sure you want to delete the entire wiki: ' + JSON.stringify(wikiHtmlName))) { + return; + } + $.post("wiki/{{$channel}}/delete/wiki", {resource_id: resource_id}, function (data) { + if (data.success) { + window.console.log('Wiki deleted'); + // Refresh list and redirect page as necessary + window.location = 'wiki/{{$channel}}'; + } else { + alert('Error deleting wiki!'); + window.console.log('Error deleting wiki.'); + } + }, 'json'); + } + {{/if}} + function wiki_download_wiki(resource_id) { + window.location = "wiki/{{$channel}}/download/wiki/" + resource_id; + } +</script> diff --git a/view/tpl/wikilist_widget.tpl b/view/tpl/wikilist_widget.tpl new file mode 100644 index 000000000..1f92b5807 --- /dev/null +++ b/view/tpl/wikilist_widget.tpl @@ -0,0 +1,8 @@ +<div id="wiki_list" class="widget"> + <h3>{{$header}}</h3> + <ul class="nav nav-pills nav-stacked"> + {{foreach $wikis as $wiki}} + <li><a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="{{$view}}">{{$wiki.title}}</a></li> + {{/foreach}} + </ul> +</div> |