mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
fixes #2407 allow clicking on section header to expand/collapse
and hide “Show/Hide expired keys” when the user has no expired keys
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
let PWG_TOKEN;
|
let PWG_TOKEN;
|
||||||
$(function() {
|
$(function() {
|
||||||
PWG_TOKEN = $('#pwg_token').val();
|
PWG_TOKEN = $('#pwg_token').val();
|
||||||
$('.profile-section .display-btn').on('click', function () {
|
$('.profile-section .display-section').on('click', function() {
|
||||||
const display = $(this).data('display');
|
const display = $(this).data('display');
|
||||||
const selector = $(`#${display}`);
|
const selector = $(`#${display}`);
|
||||||
const element = selector.get(0);
|
const element = selector.get(0);
|
||||||
|
const arrow = $(this).find('.display-btn');
|
||||||
|
|
||||||
if (selector.hasClass('open')) {
|
if (selector.hasClass('open')) {
|
||||||
// close
|
// close
|
||||||
@@ -12,17 +13,17 @@ $(function() {
|
|||||||
void element.offsetHeight;
|
void element.offsetHeight;
|
||||||
element.style.maxHeight = '1px';
|
element.style.maxHeight = '1px';
|
||||||
selector.removeClass('open');
|
selector.removeClass('open');
|
||||||
$(this).addClass('close');
|
arrow.addClass('close');
|
||||||
} else {
|
} else {
|
||||||
// open
|
// open
|
||||||
selector.addClass('open');
|
selector.addClass('open');
|
||||||
resetSection(display);
|
resetSection(display);
|
||||||
$(this).removeClass('close');
|
arrow.removeClass('close');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$('#account-section .display-btn').trigger('click');
|
$('#account-section .display-section').trigger('click');
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
$('#save_account').on('click', function() {
|
$('#save_account').on('click', function() {
|
||||||
@@ -283,6 +284,7 @@ function AddApiLine(lines, reset) {
|
|||||||
api_list.append(api_line);
|
api_list.append(api_line);
|
||||||
api_line.after(api_collapse);
|
api_line.after(api_collapse);
|
||||||
} else {
|
} else {
|
||||||
|
$('#show_expired_list').show();
|
||||||
api_list_expired.append(api_line);
|
api_list_expired.append(api_line);
|
||||||
api_line.after(api_collapse);
|
api_line.after(api_collapse);
|
||||||
api_line.find('.api-icon-action').remove();
|
api_line.find('.api-icon-action').remove();
|
||||||
|
|||||||
@@ -72,12 +72,12 @@ const str_must_not_empty = "{'must not be empty'|translate|escape:javascript}";
|
|||||||
|
|
||||||
{* ACCOUNT *}
|
{* ACCOUNT *}
|
||||||
<section id="account-section" class="profile-section">
|
<section id="account-section" class="profile-section">
|
||||||
<div class="title">
|
<div class="title display-section" data-display="account-display">
|
||||||
<div class="column-flex">
|
<div class="column-flex">
|
||||||
<h1>{'Account'|translate}</h1>
|
<h1>{'Account'|translate}</h1>
|
||||||
<p>{'Manage your account'|translate}</p>
|
<p>{'Manage your account'|translate}</p>
|
||||||
</div>
|
</div>
|
||||||
<i class="gallery-icon-up-open display-btn close" data-display="account-display"></i>
|
<i class="gallery-icon-up-open display-btn close"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form" id="account-display">
|
<div class="form" id="account-display">
|
||||||
<div class="column-flex first">
|
<div class="column-flex first">
|
||||||
@@ -106,12 +106,12 @@ const str_must_not_empty = "{'must not be empty'|translate|escape:javascript}";
|
|||||||
{* PREFERENCES *}
|
{* PREFERENCES *}
|
||||||
{if $ALLOW_USER_CUSTOMIZATION}
|
{if $ALLOW_USER_CUSTOMIZATION}
|
||||||
<section id="preferences-section" class="profile-section">
|
<section id="preferences-section" class="profile-section">
|
||||||
<div class="title">
|
<div class="title display-section" data-display="preferences-display">
|
||||||
<div class="column-flex">
|
<div class="column-flex">
|
||||||
<h1>{'Preferences'|translate}</h1>
|
<h1>{'Preferences'|translate}</h1>
|
||||||
<p>{'Choose how you want to see your gallery'|translate}</p>
|
<p>{'Choose how you want to see your gallery'|translate}</p>
|
||||||
</div>
|
</div>
|
||||||
<i class="gallery-icon-up-open display-btn close" data-display="preferences-display"></i>
|
<i class="gallery-icon-up-open display-btn close" ></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form" id="preferences-display">
|
<div class="form" id="preferences-display">
|
||||||
<div class="column-flex first">
|
<div class="column-flex first">
|
||||||
@@ -199,12 +199,12 @@ const str_must_not_empty = "{'must not be empty'|translate|escape:javascript}";
|
|||||||
{* PASSWORD *}
|
{* PASSWORD *}
|
||||||
{if not $SPECIAL_USER}
|
{if not $SPECIAL_USER}
|
||||||
<section id="password-section" class="profile-section">
|
<section id="password-section" class="profile-section">
|
||||||
<div class="title">
|
<div class="title display-section" data-display="password-display">
|
||||||
<div class="column-flex">
|
<div class="column-flex">
|
||||||
<h1>{'Password'|translate}</h1>
|
<h1>{'Password'|translate}</h1>
|
||||||
<p>{'Change your password'|translate}</p>
|
<p>{'Change your password'|translate}</p>
|
||||||
</div>
|
</div>
|
||||||
<i class="gallery-icon-up-open display-btn close" data-display="password-display"></i>
|
<i class="gallery-icon-up-open display-btn close" ></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form" id="password-display">
|
<div class="form" id="password-display">
|
||||||
<div class="column-flex">
|
<div class="column-flex">
|
||||||
@@ -246,12 +246,12 @@ const str_must_not_empty = "{'must not be empty'|translate|escape:javascript}";
|
|||||||
|
|
||||||
{* API KEY *}
|
{* API KEY *}
|
||||||
<section id="apikey-section" class="profile-section">
|
<section id="apikey-section" class="profile-section">
|
||||||
<div class="title">
|
<div class="title display-section" data-display="apikey-display">
|
||||||
<div class="column-flex">
|
<div class="column-flex">
|
||||||
<h1>{'API Keys'|translate}</h1>
|
<h1>{'API Keys'|translate}</h1>
|
||||||
<p>{'Create API Keys to secure your acount'|translate}</p>
|
<p>{'Create API Keys to secure your acount'|translate}</p>
|
||||||
</div>
|
</div>
|
||||||
<i class="gallery-icon-up-open display-btn close" data-display="apikey-display"></i>
|
<i class="gallery-icon-up-open display-btn close"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form" id="apikey-display">
|
<div class="form" id="apikey-display">
|
||||||
@@ -446,12 +446,12 @@ const str_must_not_empty = "{'must not be empty'|translate|escape:javascript}";
|
|||||||
{if isset($PLUGINS_PROFILE)}
|
{if isset($PLUGINS_PROFILE)}
|
||||||
{foreach from=$PLUGINS_PROFILE item=plugin_block key=k_block}
|
{foreach from=$PLUGINS_PROFILE item=plugin_block key=k_block}
|
||||||
<section id="{$k_block}-section" class="profile-section">
|
<section id="{$k_block}-section" class="profile-section">
|
||||||
<div class="title">
|
<div class="title display-section" data-display="{$k_block}-display">
|
||||||
<div class="column-flex">
|
<div class="column-flex">
|
||||||
<h1>{$plugin_block.name}</h1>
|
<h1>{$plugin_block.name}</h1>
|
||||||
<p>{$plugin_block.desc}</p>
|
<p>{$plugin_block.desc}</p>
|
||||||
</div>
|
</div>
|
||||||
<i class="gallery-icon-up-open display-btn close" data-display="{$k_block}-display"></i>
|
<i class="gallery-icon-up-open display-btn close" ></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form plugins" id="{$k_block}-display">
|
<div class="form plugins" id="{$k_block}-display">
|
||||||
{include file=$plugin_block.template}
|
{include file=$plugin_block.template}
|
||||||
|
|||||||
@@ -646,6 +646,10 @@ p.error-message,
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-section #show_expired_list {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.profile-section #api_key_list_expired .api_expiration {
|
.profile-section #api_key_list_expired .api_expiration {
|
||||||
text-overflow: unset;
|
text-overflow: unset;
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
@@ -708,6 +712,10 @@ p.error-message,
|
|||||||
font-family: monospace !important;
|
font-family: monospace !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-section .display-section {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
/* Modal */
|
/* Modal */
|
||||||
|
|
||||||
.bg-modal {
|
.bg-modal {
|
||||||
|
|||||||
Reference in New Issue
Block a user