Reworked expiration settings

This commit is contained in:
Michael 2020-02-16 20:44:55 +00:00
parent da124af6ed
commit 101251668c
3 changed files with 46 additions and 58 deletions

View File

@ -1151,13 +1151,12 @@ function settings_content(App $a)
$expire_arr = [
'days' => ['expire', DI::l10n()->t("Automatically expire posts after this many days:"), $expire, DI::l10n()->t('If empty, posts will not expire. Expired posts will be deleted')],
'advanced' => DI::l10n()->t('Advanced expiration settings'),
'label' => DI::l10n()->t('Advanced Expiration'),
'items' => ['expire_items', DI::l10n()->t("Expire posts:"), $expire_items],
'notes' => ['expire_notes', DI::l10n()->t("Expire personal notes:"), $expire_notes],
'starred' => ['expire_starred', DI::l10n()->t("Expire starred posts:"), $expire_starred],
'photos' => ['expire_photos', DI::l10n()->t("Expire photos:"), $expire_photos],
'network_only' => ['expire_network_only', DI::l10n()->t("Only expire posts by others:"), $expire_network_only],
'label' => DI::l10n()->t('Expiration settings'),
'items' => ['expire_items', DI::l10n()->t('Expire posts'), $expire_items, DI::l10n()->t('When activated, posts and comments will be expired.')],
'notes' => ['expire_notes', DI::l10n()->t('Expire personal notes'), $expire_notes, DI::l10n()->t('When activated, the personal notes on your profile page will be expired.')],
'starred' => ['expire_starred', DI::l10n()->t('Expire starred posts'), $expire_starred, DI::l10n()->t('Starring posts keeps them from being expired. That behaviour is overwritten by this setting.')],
'photos' => ['expire_photos', DI::l10n()->t('Expire photos'), $expire_photos, DI::l10n()->t('When activated, photos will be expired.')],
'network_only' => ['expire_network_only', DI::l10n()->t('Only expire posts by others'), $expire_network_only, DI::l10n()->t('When activated, your own posts never expire. Then the settings above are only valid for posts you received.')],
];
$group_select = Group::displayGroupSelection(local_user(), $a->user['def_gid']);

View File

@ -61,27 +61,8 @@
{{$unkmail nofilter}}
{{include file="field_input.tpl" field=$cntunkmail}}
{{include file="field_input.tpl" field=$expire.days}}
<div class="field input">
<span class="field_help"><a href="#advanced-expire-popup" id="advanced-expire" class='popupbox' title="{{$expire.advanced}}">{{$expire.label}}</a></span>
<div style="display: none;">
<div id="advanced-expire-popup" style="width:auto;height:auto;overflow:auto;">
<h3>{{$expire.advanced}}</h3>
{{include file="field_checkbox.tpl" field=$expire.items}}
{{include file="field_checkbox.tpl" field=$expire.notes}}
{{include file="field_checkbox.tpl" field=$expire.starred}}
{{include file="field_checkbox.tpl" field=$expire.network_only}}
</div>
</div>
</div>
<div id="settings-default-perms" class="settings-default-perms" >
<a href="#profile-jot-acl-wrapper" id="settings-default-perms-menu" class='popupbox'>{{$permissions}} {{$permdesc}}</a>
<div id="settings-default-perms-menu-end"></div>
@ -100,15 +81,25 @@
<div id="settings-default-perms-end"></div>
{{$group_select nofilter}}
<div class="settings-submit-wrapper" >
<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
</div>
</div>
<h3 class="settings-heading"><a href="javascript:;">{{$expire.label}}</a></h3>
<div class="settings-content-block">
<div id="settings-expiry">
{{include file="field_input.tpl" field=$expire.days}}
{{include file="field_checkbox.tpl" field=$expire.items}}
{{include file="field_checkbox.tpl" field=$expire.notes}}
{{include file="field_checkbox.tpl" field=$expire.starred}}
{{include file="field_checkbox.tpl" field=$expire.network_only}}
<div class="settings-submit-wrapper" >
<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
</div>
</div>
</div>
<h3 class="settings-heading"><a href="javascript:;">{{$h_not}}</a></h3>
<div class="settings-content-block">
@ -171,7 +162,6 @@
</div>
</div>
<h3 class="settings-heading"><a href="javascript:;">{{$h_advn}}</a></h3>
<div class="settings-content-block">
<div id="settings-pagetype-desc">{{$h_descadvn}}</div>
@ -202,6 +192,3 @@
<input type="submit" name="resend_relocate" class="settings-submit" value="{{$relocate_button}}" />
</div>
</div>

View File

@ -99,30 +99,6 @@
{{include file="field_input.tpl" field=$cntunkmail}}
{{include file="field_input.tpl" field=$expire.days}}
<div id="settings-advanced-expire">
<a id="advanced-expire-menu" title="{{$expire.advanced}}" data-toggle="modal" data-target="#aeModal">{{$expire.label}}</a>
{{* The modal for advanced-expire *}}
<div class="modal" id="aeModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">{{$expire.advanced}}</h4>
</div>
<div class="modal-body">
{{include file="field_checkbox.tpl" field=$expire.items}}
{{include file="field_checkbox.tpl" field=$expire.notes}}
{{include file="field_checkbox.tpl" field=$expire.starred}}
{{include file="field_checkbox.tpl" field=$expire.network_only}}
</div>
</div>
</div>
</div>
</div>
{{* Block for setting default permissions *}}
<div id="settings-default-perms" class="settings-default-perms">
<a id="settings-default-perms-menu" class="settings-default-perms" data-toggle="modal" data-target="#aclModal">{{$permissions}} {{$permdesc}}</a>
@ -144,10 +120,36 @@
</div>
</div>
<br/>
<div class="clear"></div>
{{$group_select nofilter}}
<div class="form-group pull-right settings-submit-wrapper" >
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="expire-settings">
<h4>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#settings" href="#expire-settings-collapse" aria-expanded="false" aria-controls="expire-settings-collapse">
{{$expire.label}}
</a>
</h4>
</div>
<div id="expire-settings-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="expire-settings">
<div class="section-content-tools-wrapper">
{{include file="field_input.tpl" field=$expire.days}}
{{include file="field_checkbox.tpl" field=$expire.items}}
{{include file="field_checkbox.tpl" field=$expire.notes}}
{{include file="field_checkbox.tpl" field=$expire.starred}}
{{include file="field_checkbox.tpl" field=$expire.network_only}}
<div class="form-group pull-right settings-submit-wrapper" >
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
</div>