diff --git a/inc/config.php b/inc/config.php index eff1c596..9140201c 100644 --- a/inc/config.php +++ b/inc/config.php @@ -688,6 +688,27 @@ // a link to an email address or IRC chat room to appeal the ban. $config['ban_page_extra'] = ''; + // Pre-configured ban reasons that pre-fill the ban form when clicked. + // $config['premade_ban_reasons'] = array( + // array( + // 'reason' => 'Low-quality posting', + // 'length' => '1d' + // ), + // array( + // 'reason' => 'Off-topic', + // 'length' => '1d' + // ), + // array( + // 'reason' => 'Ban evasion', + // 'length' => '30d' + // ), + // array( + // 'reason' => 'Illegal content', + // 'length' => '' + // ) + //); + $config['premade_ban_reasons'] = false; + // Allow users to appeal bans through vichan. $config['ban_appeals'] = false; diff --git a/inc/mod/pages.php b/inc/mod/pages.php index f5ea284c..1e803424 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1586,6 +1586,7 @@ function mod_ban_post($board, $delete, $post, $token = false) { 'board' => $board, 'delete' => (bool)$delete, 'boards' => listBoards(), + 'reasons' => $config['premade_ban_reasons'], 'token' => $security_token ); diff --git a/js/mod/mod_snippets.js b/js/mod/mod_snippets.js new file mode 100644 index 00000000..6c61ad6a --- /dev/null +++ b/js/mod/mod_snippets.js @@ -0,0 +1,12 @@ +/* + * mod_snippets.js + * + * Javascript snippets to be loaded when in mod mode + * + */ + +function populateFormJQuery(frm, data) { + $.each(data, function(key, value){ + $('[name='+key+']', frm).val(value); + }); +} diff --git a/stylesheets/style.css b/stylesheets/style.css index 4f81b1a5..6d1d1829 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -1225,3 +1225,13 @@ table.fileboard .intro a { div.mix { display: inline-block; } + +.ban-reason-table .warning-reason-table tr td:first-child { + text-align: right; + padding-right: 10px; +} + +.ban-reason-table .warning-reason-table tr:hover td { + cursor: pointer; + background-color: rgba(100%,100%,100%,0.2); +} diff --git a/templates/header.html b/templates/header.html index be20fed1..d35fabb9 100644 --- a/templates/header.html +++ b/templates/header.html @@ -16,6 +16,9 @@ {% if not config.additional_javascript_compile %} {% for javascript in config.additional_javascript %}{% endfor %} {% endif %} + {% if mod %} + + {% endif %} {% endif %} {% if config.recaptcha %}