Skip to content

Commit

Permalink
Add checkbox to quick thread creation
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyHackGUT committed Oct 14, 2021
1 parent 13b0ba8 commit 7899878
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
5 changes: 4 additions & 1 deletion _output/template_modifications/_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"admin/hlmod_forum_rules_accept_forum_edit_row.json": {
"hash": "a54324f77cab384754110160be865fbf"
},
"public/hlmod_forum_rules_accept_forum_post_qthread_accept.json": {
"hash": "25468dd593c7f83f6cd3e001c9bcf089"
},
"public/hlmod_forum_rules_accept_forum_post_thread_accept.json": {
"hash": "1ef6d0c0408ec4f5e0462339463e088e"
"hash": "2ef277dd547d19b581d810d7c367bf0e"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"template": "forum_post_quick_thread",
"description": "Adds the row for accepting forum rules",
"execution_order": 25,
"enabled": true,
"action": "str_replace",
"find": "<xf:captcharow label=\"{{ phrase('verification') }}\" rowtype=\"fullWidth noGutter noLabel\" />",
"replace": "$0\n\n<xf:macro template=\"hlmod_forum_rules_accept_macros\" name=\"accept_rules\"\n\t\t arg-forum=\"{$forum}\" arg-rowType=\"fullWidth noGutter noLabel\"\n\t\t arg-container=\".formButtonGroup-primary\"\n\t\t arg-controls=\"button[type=submit]:not([name=more-options])\" />"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"enabled": true,
"action": "str_replace",
"find": "<xf:captcharow label=\"{{ phrase('verification') }}\" />",
"replace": "$0\n<xf:if is=\"$forum.hlmod_rules_url is not empty\">\n\t<xf:checkboxrow>\n\t\t<xf:option data-xf-init=\"disabler\" data-container=\".formSubmitRow\">\n\t\t\t{{ phrase('hlmod_forum_rules_accept.i_read_and_accept_forum_rules', {'url': $forum.hlmod_rules_url}) }}\n\t\t</xf:option>\n\t</xf:checkboxrow>\n</xf:if>"
"replace": "$0\n\n<xf:macro template=\"hlmod_forum_rules_accept_macros\" name=\"accept_rules\"\n\t\t arg-forum=\"{$forum}\" />"
}
7 changes: 7 additions & 0 deletions _output/templates/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"public/hlmod_forum_rules_accept_macros.html": {
"version_id": 1000170,
"version_string": "1.0.1",
"hash": "ab0db537fe5313ae97e6327c87dca7c3"
}
}
10 changes: 10 additions & 0 deletions _output/templates/public/hlmod_forum_rules_accept_macros.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<xf:macro name="accept_rules" arg-forum="!" arg-container=".formSubmitRow" arg-controls="button[type=submit]"
arg-rowType="">
<xf:if is="$forum.hlmod_rules_url is not empty">
<xf:checkboxrow rowtype="{$rowType}">
<xf:option data-xf-init="disabler" data-container="{$container}" data-controls="{$controls}">
{{ phrase('hlmod_forum_rules_accept.i_read_and_accept_forum_rules', {'url': $forum.hlmod_rules_url}) }}
</xf:option>
</xf:checkboxrow>
</xf:if>
</xf:macro>
4 changes: 2 additions & 2 deletions addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"legacy_addon_id": "",
"title": "[HLModerators] Node Rules Accept",
"description": "Adds a checkbox \"I read and accept rules\" in thread creation interface",
"version_id": 1000070,
"version_string": "1.0.0",
"version_id": 1000170,
"version_string": "1.0.1",
"dev": "HLModerators",
"dev_url": "https://hlmod.ru/?utm_source=xenforo_acp&utm_campaign=node_rules_accept",
"faq_url": "",
Expand Down

0 comments on commit 7899878

Please sign in to comment.