Skip to content

Commit

Permalink
1.1.0-b1
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWCS committed Dec 9, 2023
1 parent 49ae35b commit 4ef8f4e
Show file tree
Hide file tree
Showing 22 changed files with 505 additions and 276 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ on:
jobs:
# START Basic Checks Job (EPV, code sniffer, images check, etc.)
basic-checks:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- php: '7.1'
- php: '7.3'
db: "none"
NOTESTS: 1

Expand Down
32 changes: 0 additions & 32 deletions lukewcs/statspermissions/adm/style/acp_stats_permissions.css

This file was deleted.

72 changes: 0 additions & 72 deletions lukewcs/statspermissions/adm/style/acp_stats_permissions.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/* GENERAL */

.stats_permissions_footer {
margin-top: 1em;
text-align: center;
font-size: .75em;
}

/* SETTINGS */

input[type=button][name*="stats_permissions_"],
.submit-buttons input[type=submit],
.submit-buttons input[type=button] {
padding: 3px 4px;
}

legend {
top: 0;
margin-left: -11px;
padding: 2px 10px;
border-radius: 5px 5px 0 0;
border-top: inherit;
border-left: inherit;
background-color: inherit;
}

fieldset dt label {
cursor: inherit;
}

/*
* phpBB ACP Toggles - A CSS class that makes it easy to display checkboxes as toggles.
* Source : https://danklammer.com/articles/simple-css-toggle-switch/
* Revision by: Kirk (customization and optimization), LukeWCS (optimization)
*/

.toggle {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 38px;
height: 17px;
position: relative;
border-radius: 50px;
cursor: pointer;
font-family: FontAwesome;
transition: background-color 0.2s;
}

.toggle:before {
position: absolute;
width: 14px;
height: 13px;
background-color: #ffffff;
top: 2px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
left: 22px;
content: "\f00d";
transition: 0.2s;
}

.toggle,
.toggle:hover,
.toggle:focus {
background-color: #cccccc;
border: none;
color: #000000;
}

.toggle:checked {
background-color: #3b87ab;
}

.toggle:checked:before {
left: 2px;
content: "\f00c";
}

/* RESPONSIVE */

@media (max-width: 700px) {
legend {
margin-left: -6px;
padding: 2px 5px;
}

#stats_permissions_form dd {
margin-top: .5em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,56 @@
#}

{% INCLUDE 'overall_header.html' %}

{% set switch_type = TOGGLECTRL_TYPE ?? 'toggle' %}

<a id="maincontent"></a>

<h1>{{ lang('STATS_PERMISSIONS_CONFIG_TITLE') }}</h1>
<p>{{ lang('STATS_PERMISSIONS_CONFIG_DESC', STATS_PERMISSIONS_EXT_NAME) }}</p>
<p>{{ lang('STATS_PERMISSIONS_CONFIG_DESC', STATS_PERMISSIONS_METADATA.EXT_NAME) }}</p>

{% if STATS_PERMISSIONS_NOTES|length %}
<div class="errorbox notice">
{% for note in STATS_PERMISSIONS_NOTES %}
<p>{{ note }}</p>
{% endfor %}
</div>
{% endif %}
{{ _self.notes(STATS_PERMISSIONS_NOTES) }}

<form id="stats_permissions_form" method="post" action="{{ U_ACTION }}">
<fieldset>
<legend>{{ lang('STATS_PERMISSIONS_SECTION_PERMISSIONS') }}</legend>

<dl id="stats_permissions_opt_admin_mode">
<dl>
<dt><label>{{ lang('STATS_PERMISSIONS_ADMIN_MODE') ~ lang('COLON') }}</label><br><span>{{ lang('STATS_PERMISSIONS_ADMIN_MODE_EXP') }}</span></dt>
<dd>
{{ _self.switch('stats_permissions_admin_mode', STATS_PERMISSIONS_ADMIN_MODE) }}
{{ _self.switch('stats_permissions_admin_mode', STATS_PERMISSIONS_ADMIN_MODE, switch_type) }}
</dd>
</dl>

<dl id="stats_permissions_opt_use_permissions">
<dl>
<dt><label>{{ lang('STATS_PERMISSIONS_USE_PERMISSIONS') ~ lang('COLON') }}</label><br><span>{{ lang('STATS_PERMISSIONS_USE_PERMISSIONS_EXP') }}</span></dt>
<dd>
{{ _self.switch('stats_permissions_use_permissions', STATS_PERMISSIONS_USE_PERMISSIONS) }}
{{ _self.switch('stats_permissions_use_permissions', STATS_PERMISSIONS_USE_PERMISSIONS, switch_type) }}
</dd>
</dl>

<dl id="stats_permissions_opt_disp_for_guests">
<dl>
<dt><label>{{ lang('STATS_PERMISSIONS_DISP_FOR_GUESTS') ~ lang('COLON') }}</label><br><span>{{ lang('STATS_PERMISSIONS_DISP_FOR_GUESTS_EXP') }}</span></dt>
<dd>
<select name="stats_permissions_disp_for_guests">
<option value="3"{{ STATS_PERMISSIONS_DISP_FOR_GUESTS == 3 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_STATS_NEWEST') }}</option>
<option value="2"{{ STATS_PERMISSIONS_DISP_FOR_GUESTS == 2 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_NEWEST') }}</option>
<option value="1"{{ STATS_PERMISSIONS_DISP_FOR_GUESTS == 1 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_STATS') }}</option>
<option value="0"{{ STATS_PERMISSIONS_DISP_FOR_GUESTS == 0 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_NOTHING') }}</option>
</select>
{{ _self.select('stats_permissions_disp_for_guests', STATS_PERMISSIONS_DISP_FOR_GUESTS, STATS_PERMISSIONS_OPTIONS) }}
</dd>
</dl>

<dl id="stats_permissions_opt_disp_for_bots">
<dl>
<dt><label>{{ lang('STATS_PERMISSIONS_DISP_FOR_BOTS') ~ lang('COLON') }}</label><br><span>{{ lang('STATS_PERMISSIONS_DISP_FOR_BOTS_EXP') }}</span></dt>
<dd>
<select name="stats_permissions_disp_for_bots">
<option value="3"{{ STATS_PERMISSIONS_DISP_FOR_BOTS == 3 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_STATS_NEWEST') }}</option>
<option value="2"{{ STATS_PERMISSIONS_DISP_FOR_BOTS == 2 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_NEWEST') }}</option>
<option value="1"{{ STATS_PERMISSIONS_DISP_FOR_BOTS == 1 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_STATS') }}</option>
<option value="0"{{ STATS_PERMISSIONS_DISP_FOR_BOTS == 0 ? ' selected' }}>{{ lang('STATS_PERMISSIONS_PERM_NOTHING') }}</option>
</select>
{{ _self.select('stats_permissions_disp_for_bots', STATS_PERMISSIONS_DISP_FOR_BOTS, STATS_PERMISSIONS_OPTIONS) }}
</dd>
</dl>
</fieldset>

<fieldset>
<legend>{{ lang('STATS_PERMISSIONS_SECTION_RESET') }}</legend>

<dl id="stats_permissions_opt_defaults">
<dl>
<dt><label>{{ lang('STATS_PERMISSIONS_DEFAULTS') ~ lang('COLON') }}</label><br><span>{{ lang('STATS_PERMISSIONS_DEFAULTS_EXP') }}</span></dt>
<dd>
<input class="button2" type="button" name="stats_permissions_defaults" value="{{ lang('STATS_PERMISSIONS_BUTTON_DEFAULTS') }}">
{{ _self.js_button('stats_permissions_defaults', 'STATS_PERMISSIONS_BUTTON_DEFAULTS') }}
</dd>
</dl>
</fieldset>
Expand All @@ -80,24 +67,54 @@ <h1>{{ lang('STATS_PERMISSIONS_CONFIG_TITLE') }}</h1>

<p class="submit-buttons">
<input class="button1" type="submit" name="submit" value="{{ lang('SUBMIT') }}">&nbsp;
<input class="button2" type="button" name="form_reset" value="{{ lang('RESET') }}">
<input class="button2" type="reset" name="reset" value="{{ lang('RESET') }}">
</p>
</fieldset>

{{ S_FORM_TOKEN }}
</form>

<p class="stats_permissions_copyright">
{{ STATS_PERMISSIONS_EXT_NAME }} v{{ STATS_PERMISSIONS_EXT_VER }} &copy; LukeWCS<br>
{{ lang('STATS_PERMISSIONS_LANG_DESC') }} v{{ lang('STATS_PERMISSIONS_LANG_EXT_VER') }} &bull; {{ lang('STATS_PERMISSIONS_LANG_AUTHOR') }}
</p>
{{ _self.footer(STATS_PERMISSIONS_METADATA) }}

{% INCLUDE 'overall_footer.html' %}

{% INCLUDEJS '@lukewcs_statspermissions/acp_stats_permissions.js' %}
{% INCLUDECSS '@lukewcs_statspermissions/acp_stats_permissions.css' %}
{% INCLUDECSS '@lukewcs_statspermissions/acp_toggle.css' %}
{% INCLUDEJS '@lukewcs_statspermissions/acp_stats_permissions_settings.js' %}
{% INCLUDECSS '@lukewcs_statspermissions/acp_stats_permissions_settings.css' %}

{% macro switch(name, checked = false) -%}
<input type="checkbox" class="toggle" name="{{ name }}" value="1"{{ checked ? ' checked' }}>
{% macro switch(name, checked = false, type = 'toggle') -%}
{% if type == 'toggle' || type == 'checkbox' -%}
<input type="checkbox"{{ type == 'toggle' ? ' class="toggle"' }} name="{{ name }}" value="1"{{ checked ? ' checked' }}>
{%- elseif type == 'radio' -%}
<label><input type="radio" class="radio" name="{{ name }}" value="1"{{ checked ? ' checked' }}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="{{ name }}" value="0"{{ !checked ? ' checked' }}> {{ lang('NO') }}</label>
{%- endif %}
{%- endmacro %}

{% macro select(name, value, options) -%}
<select name="{{ name }}">
{% for opt_lang_var, opt_value in options %}
<option value="{{ opt_value }}"{{ opt_value == value ? ' selected' }}>{{ lang(opt_lang_var) }}</option>
{% endfor %}
</select>
{%- endmacro %}

{% macro js_button(name, lang_var) -%}
<input type="button" class="button2" name="{{ name }}" value="{{ lang(lang_var) }}">
{%- endmacro %}

{% macro notes(notes) %}
{% if notes|length %}
<div class="successbox notice">
{% for note in notes %}
<p>{{ note }}</p>
{% endfor %}
</div>
{% endif %}
{% endmacro %}

{% macro footer(metadata) %}
<p class="{{ metadata.CLASS }}">
{{ metadata.EXT_NAME }} {{ metadata.EXT_VER }} &copy; LukeWCS<br>
{{ metadata.LANG_DESC|e('html') }} {{ metadata.LANG_VER|e('html') }} &bull; {{ metadata.LANG_AUTHOR|e('html') }}
</p>
{% endmacro %}
Loading

0 comments on commit 4ef8f4e

Please sign in to comment.