| @@ -24,28 +24,9 @@ | ||
| 24 | 24 | |
| 25 | 25 | <?php do_action( 'bbp_theme_before_reply_form' ); ?> |
| 26 | 26 | |
| 27 | 27 | <fieldset class="bbp-form"> |
| 28 | - <legend> | |
| 29 | - <div class="frmx-reply-title"> | |
| 30 | - <a href="<?php bbp_topic_permalink(); ?>" class="frmx-back-btn"> | |
| 31 | - <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg> | |
| 32 | - </a> | |
| 33 | - <span><?php printf( esc_html__( 'Reply to: %s', 'forumax' ), ( bbp_get_form_reply_to() ) ? sprintf( esc_html__( 'Reply #%1$s in %2$s', 'forumax' ), bbp_get_form_reply_to(), bbp_get_topic_title() ) : bbp_get_topic_title() ); ?></span> | |
| 34 | - </div> | |
| 35 | - <div class="frmx-reply-subtitle"> | |
| 36 | - <?php | |
| 37 | - $reply_to = bbp_get_form_reply_to(); | |
| 38 | - if ( $reply_to ) { | |
| 39 | - $author_name = bbp_get_reply_author_display_name( $reply_to ); | |
| 40 | - printf( esc_html__( 'In response to %s • Just now', 'forumax' ), $author_name ); | |
| 41 | - } else { | |
| 42 | - $author_name = bbp_get_topic_author_display_name( bbp_get_topic_id() ); | |
| 43 | - printf( esc_html__( 'In response to %s • Just now', 'forumax' ), $author_name ); | |
| 44 | - } | |
| 45 | - ?> | |
| 46 | - </div> | |
| 47 | - </legend> | |
| 28 | + <legend><?php printf( esc_html__( 'Reply To: %s', 'forumax' ), ( bbp_get_form_reply_to() ) ? sprintf( esc_html__( 'Reply #%1$s in %2$s', 'forumax' ), bbp_get_form_reply_to(), bbp_get_topic_title() ) : bbp_get_topic_title() ); ?></legend> | |
| 48 | 29 | |
| 49 | 30 | <?php do_action( 'bbp_theme_before_reply_form_notices' ); ?> |
| 50 | 31 | |
| 51 | 32 | <?php if ( ! bbp_is_topic_open() && ! bbp_is_reply_edit() ) : ?> |
| @@ -89,69 +70,8 @@ | ||
| 89 | 70 | <?php bbp_the_content( array( 'context' => 'reply' ) ); ?> |
| 90 | 71 | |
| 91 | 72 | <?php do_action( 'bbp_theme_after_reply_form_content' ); ?> |
| 92 | 73 | |
| 93 | - <script> | |
| 94 | - /* Style TinyMCE iframe body + toolbar to match the reference design */ | |
| 95 | - document.addEventListener('DOMContentLoaded', function() { | |
| 96 | - if (typeof tinymce !== 'undefined') { | |
| 97 | - tinymce.on('AddEditor', function(e) { | |
| 98 | - e.editor.on('init', function() { | |
| 99 | - /* Style the iframe body */ | |
| 100 | - var body = this.getBody(); | |
| 101 | - if (body) { | |
| 102 | - body.style.backgroundColor = '#fff'; | |
| 103 | - body.style.fontFamily = "'Inter', 'Roboto', -apple-system, sans-serif"; | |
| 104 | - body.style.fontSize = '14px'; | |
| 105 | - body.style.lineHeight = '1.6'; | |
| 106 | - body.style.color = '#1a1a2e'; | |
| 107 | - body.style.padding = '14px 18px'; | |
| 108 | - } | |
| 109 | - | |
| 110 | - /* Style the toolbar container background */ | |
| 111 | - var container = this.getContainer(); | |
| 112 | - if (container) { | |
| 113 | - /* Remove TinyMCE skin border */ | |
| 114 | - container.style.border = 'none'; | |
| 115 | - container.style.boxShadow = 'none'; | |
| 116 | - | |
| 117 | - /* Toolbar group background */ | |
| 118 | - var toolbarGrp = container.querySelector('.mce-toolbar-grp'); | |
| 119 | - if (toolbarGrp) { | |
| 120 | - toolbarGrp.style.backgroundColor = '#f6f7f9'; | |
| 121 | - toolbarGrp.style.borderBottom = '1px solid #e5e7eb'; | |
| 122 | - toolbarGrp.style.borderTop = 'none'; | |
| 123 | - toolbarGrp.style.padding = '6px 10px'; | |
| 124 | - } | |
| 125 | - | |
| 126 | - /* Remove edit area border */ | |
| 127 | - var editArea = container.querySelector('.mce-edit-area'); | |
| 128 | - if (editArea) { | |
| 129 | - editArea.style.border = 'none'; | |
| 130 | - } | |
| 131 | - | |
| 132 | - /* Style individual toolbar buttons */ | |
| 133 | - var btns = container.querySelectorAll('.mce-btn'); | |
| 134 | - btns.forEach(function(btn) { | |
| 135 | - btn.style.background = 'transparent'; | |
| 136 | - btn.style.border = 'none'; | |
| 137 | - btn.style.boxShadow = 'none'; | |
| 138 | - }); | |
| 139 | - | |
| 140 | - /* Style button groups and add dividers */ | |
| 141 | - var groups = container.querySelectorAll('.mce-btn-group'); | |
| 142 | - groups.forEach(function(group) { | |
| 143 | - group.style.border = 'none'; | |
| 144 | - group.style.background = 'transparent'; | |
| 145 | - group.style.boxShadow = 'none'; | |
| 146 | - }); | |
| 147 | - } | |
| 148 | - }); | |
| 149 | - }); | |
| 150 | - } | |
| 151 | - }); | |
| 152 | - </script> | |
| 153 | - | |
| 154 | 74 | <?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?> |
| 155 | 75 | |
| 156 | 76 | <p class="form-allowed-tags"> |
| 157 | 77 | <label><?php esc_html_e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','forumax' ); ?></label><br /> |
| @@ -163,86 +83,41 @@ | ||
| 163 | 83 | <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) ) : ?> |
| 164 | 84 | |
| 165 | 85 | <?php do_action( 'bbp_theme_before_reply_form_tags' ); ?> |
| 166 | 86 | |
| 167 | - <div class="frmx-tags-field"> | |
| 168 | - <div class="frmx-tags-icon"> | |
| 169 | - <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><circle cx="7" cy="7" r="1.5"></circle></svg> | |
| 170 | - </div> | |
| 171 | - <div class="frmx-tags-chips" id="frmx-tags-chips"></div> | |
| 172 | - <input type="text" class="frmx-tags-input" id="frmx-tags-visible-input" placeholder="<?php esc_attr_e( 'Add tags…', 'forumax' ); ?>" <?php disabled( bbp_is_topic_spam() ); ?> /> | |
| 173 | - <input type="hidden" value="<?php bbp_form_topic_tags(); ?>" name="bbp_topic_tags" id="bbp_topic_tags" /> | |
| 174 | - </div> | |
| 87 | + <p> | |
| 88 | + <label for="bbp_topic_tags"><?php esc_html_e( 'Tags:', 'forumax' ); ?></label><br /> | |
| 89 | + <input type="text" value="<?php bbp_form_topic_tags(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> /> | |
| 90 | + </p> | |
| 175 | 91 | |
| 176 | - <script> | |
| 177 | - document.addEventListener('DOMContentLoaded', function() { | |
| 178 | - var chipsContainer = document.getElementById('frmx-tags-chips'); | |
| 179 | - var visibleInput = document.getElementById('frmx-tags-visible-input'); | |
| 180 | - var hiddenInput = document.getElementById('bbp_topic_tags'); | |
| 181 | - if (!chipsContainer || !visibleInput || !hiddenInput) return; | |
| 92 | + <?php do_action( 'bbp_theme_after_reply_form_tags' ); ?> | |
| 182 | 93 | |
| 183 | - var tags = hiddenInput.value | |
| 184 | - ? hiddenInput.value.split(',').map(function(t){ return t.trim(); }).filter(Boolean) | |
| 185 | - : []; | |
| 94 | + <?php endif; ?> | |
| 186 | 95 | |
| 187 | - function render() { | |
| 188 | - chipsContainer.innerHTML = ''; | |
| 189 | - tags.forEach(function(tag, i) { | |
| 190 | - var chip = document.createElement('span'); | |
| 191 | - chip.className = 'frmx-tag-chip'; | |
| 192 | - chip.innerHTML = '<span class="frmx-tag-text">' + tag + '</span>' + | |
| 193 | - '<button type="button" class="frmx-tag-remove" data-index="' + i + '">' + | |
| 194 | - '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>' + | |
| 195 | - '</button>'; | |
| 196 | - chipsContainer.appendChild(chip); | |
| 197 | - }); | |
| 198 | - hiddenInput.value = tags.join(', '); | |
| 199 | - } | |
| 96 | + <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( ! bbp_is_reply_edit() || ( bbp_is_reply_edit() && ! bbp_is_reply_anonymous() ) ) ) : ?> | |
| 200 | 97 | |
| 201 | - render(); | |
| 98 | + <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?> | |
| 202 | 99 | |
| 203 | - visibleInput.addEventListener('keydown', function(e) { | |
| 204 | - if (e.key === 'Enter' || e.key === ',') { | |
| 205 | - e.preventDefault(); | |
| 206 | - var val = visibleInput.value.trim().replace(/,$/,'').trim(); | |
| 207 | - if (val && tags.indexOf(val) === -1) { | |
| 208 | - tags.push(val); | |
| 209 | - render(); | |
| 210 | - } | |
| 211 | - visibleInput.value = ''; | |
| 212 | - } | |
| 213 | - if (e.key === 'Backspace' && !visibleInput.value && tags.length) { | |
| 214 | - tags.pop(); | |
| 215 | - render(); | |
| 216 | - } | |
| 217 | - }); | |
| 100 | + <p> | |
| 218 | 101 | |
| 219 | - chipsContainer.addEventListener('click', function(e) { | |
| 220 | - var btn = e.target.closest('.frmx-tag-remove'); | |
| 221 | - if (btn) { | |
| 222 | - var idx = parseInt(btn.dataset.index, 10); | |
| 223 | - tags.splice(idx, 1); | |
| 224 | - render(); | |
| 225 | - } | |
| 226 | - }); | |
| 102 | + <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> /> | |
| 227 | 103 | |
| 228 | - visibleInput.addEventListener('blur', function() { | |
| 229 | - var val = visibleInput.value.trim().replace(/,$/,'').trim(); | |
| 230 | - if (val && tags.indexOf(val) === -1) { | |
| 231 | - tags.push(val); | |
| 232 | - render(); | |
| 233 | - } | |
| 234 | - visibleInput.value = ''; | |
| 235 | - }); | |
| 236 | - }); | |
| 237 | - </script> | |
| 104 | + <?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?> | |
| 238 | 105 | |
| 239 | - <?php do_action( 'bbp_theme_after_reply_form_tags' ); ?> | |
| 106 | + <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'forumax' ); ?></label> | |
| 240 | 107 | |
| 241 | - <?php endif; ?> | |
| 108 | + <?php else : ?> | |
| 242 | 109 | |
| 110 | + <label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'forumax' ); ?></label> | |
| 243 | 111 | |
| 112 | + <?php endif; ?> | |
| 244 | 113 | |
| 114 | + </p> | |
| 115 | + | |
| 116 | + <?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?> | |
| 117 | + | |
| 118 | + <?php endif; ?> | |
| 119 | + | |
| 245 | 120 | <?php if ( bbp_is_reply_edit() ) : ?> |
| 246 | 121 | |
| 247 | 122 | <?php if ( current_user_can( 'moderate', bbp_get_reply_id() ) ) : ?> |
| 248 | 123 | |
| @@ -287,49 +162,8 @@ | ||
| 287 | 162 | <?php endif; ?> |
| 288 | 163 | |
| 289 | 164 | <?php endif; ?> |
| 290 | 165 | |
| 291 | - <div class="frmx-reply-bottom-grid"> | |
| 292 | - <div class="frmx-reply-attachments"> | |
| 293 | - <legend><?php esc_html_e( 'ATTACHMENTS', 'forumax' ); ?></legend> | |
| 294 | - <?php do_action( 'frmx_reply_attachments' ); ?> | |
| 295 | - </div> | |
| 296 | - | |
| 297 | - <div class="frmx-reply-options"> | |
| 298 | - <legend><?php esc_html_e( 'OPTIONS', 'forumax' ); ?></legend> | |
| 299 | - <div class="frmx-options-inner"> | |
| 300 | - <?php if ( bbp_is_subscriptions_active() && ! bbp_is_anonymous() && ( ! bbp_is_reply_edit() || ( bbp_is_reply_edit() && ! bbp_is_reply_anonymous() ) ) ) : ?> | |
| 301 | - | |
| 302 | - <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?> | |
| 303 | - | |
| 304 | - <div class="frmx-option-row"> | |
| 305 | - <div class="frmx-option-icon frmx-option-icon--notify"> | |
| 306 | - <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg> | |
| 307 | - </div> | |
| 308 | - <label for="bbp_topic_subscription" class="frmx-option-label"> | |
| 309 | - <?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?> | |
| 310 | - <span class="frmx-option-title"><?php esc_html_e( 'Email notifications', 'forumax' ); ?></span> | |
| 311 | - <span class="frmx-option-desc"><?php esc_html_e( 'Notify the author of follow-up replies', 'forumax' ); ?></span> | |
| 312 | - <?php else : ?> | |
| 313 | - <span class="frmx-option-title"><?php esc_html_e( 'Notify me of replies', 'forumax' ); ?></span> | |
| 314 | - <span class="frmx-option-desc"><?php esc_html_e( 'Get email alerts when someone responds', 'forumax' ); ?></span> | |
| 315 | - <?php endif; ?> | |
| 316 | - </label> | |
| 317 | - <label class="frmx-toggle" for="bbp_topic_subscription"> | |
| 318 | - <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> /> | |
| 319 | - <span class="frmx-toggle-slider"></span> | |
| 320 | - </label> | |
| 321 | - </div> | |
| 322 | - | |
| 323 | - <?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?> | |
| 324 | - | |
| 325 | - <?php endif; ?> | |
| 326 | - | |
| 327 | - <?php do_action( 'frmx_reply_options' ); ?> | |
| 328 | - </div> | |
| 329 | - </div> | |
| 330 | - </div> | |
| 331 | - | |
| 332 | 166 | <?php do_action( 'bbp_theme_before_reply_form_submit_wrapper' ); ?> |
| 333 | 167 | |
| 334 | 168 | <div class="bbp-submit-wrapper"> |
| 335 | 169 | |
| @@ -335,11 +169,10 @@ | ||
| 335 | 169 | |
| 336 | 170 | <?php do_action( 'bbp_theme_before_reply_form_submit_button' ); ?> |
| 337 | 171 | |
| 338 | 172 | <?php bbp_cancel_reply_to_link(); ?> |
| 339 | - <span class="frmx-cancel-divider"></span> | |
| 340 | 173 | |
| 341 | - <button type="submit" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit fill-brand"><?php esc_html_e( 'Post Reply', 'forumax' ); ?> <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-left:4px;"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg></button> | |
| 174 | + <button type="submit" id="bbp_reply_submit" name="bbp_reply_submit" class="button submit fill-brand"><?php esc_html_e( 'Submit', 'forumax' ); ?></button> | |
| 342 | 175 | |
| 343 | 176 | <?php do_action( 'bbp_theme_after_reply_form_submit_button' ); ?> |
| 344 | 177 | |
| 345 | 178 | </div> |
| @@ -379,35 +212,27 @@ | ||
| 379 | 212 | |
| 380 | 213 | <?php else : ?> |
| 381 | 214 | |
| 382 | 215 | <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply"> |
| 383 | - <?php if ( is_user_logged_in() ) : ?> | |
| 384 | - <div class="bbp-template-notice bbp-login-required-notice"> | |
| 385 | - <span class="bbp-notice-icon" aria-hidden="true"> | |
| 386 | - <svg viewBox="0 0 24 24" width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
| 387 | - <path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10Z" stroke="currentColor" stroke-width="1.8"/> | |
| 388 | - <path d="M12 10.5v6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/> | |
| 389 | - <path d="M12 7.75h.01" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/> | |
| 390 | - </svg> | |
| 391 | - </span> | |
| 392 | - <ul> | |
| 393 | - <li><?php esc_html_e( 'You cannot reply to this topic.', 'forumax' ); ?></li> | |
| 394 | - </ul> | |
| 395 | - </div> | |
| 396 | - <?php else : ?> | |
| 397 | - <div class="frmx-inline-login-prompt"> | |
| 398 | - <h3 class="frmx-inline-login-title"><?php echo esc_html__( 'Join the conversation', 'forumax' ); ?></h3> | |
| 399 | - <p class="frmx-inline-login-subtitle"><?php echo esc_html__( 'You must be logged in to reply to this topic.', 'forumax' ); ?></p> | |
| 400 | - <div class="frmx-subscription-login-form"> | |
| 401 | - <?php | |
| 402 | - if ( function_exists( 'forumax_get_opt' ) && forumax_get_opt( 'topic_login_shortcode' ) ) { | |
| 403 | - echo do_shortcode( forumax_get_opt( 'topic_login_shortcode' ) ); | |
| 404 | - } else { | |
| 405 | - bbp_get_template_part( 'form', 'user-login' ); | |
| 406 | - } | |
| 407 | - ?> | |
| 408 | - </div> | |
| 409 | - </div> | |
| 216 | + <div class="bbp-template-notice"> | |
| 217 | + <ul> | |
| 218 | + <li><?php is_user_logged_in() | |
| 219 | + ? esc_html_e( 'You cannot reply to this topic.', 'forumax' ) | |
| 220 | + : esc_html_e( 'You must be logged in to reply to this topic.', 'forumax' ); | |
| 221 | + ?></li> | |
| 222 | + </ul> | |
| 223 | + </div> | |
| 224 | + | |
| 225 | + <?php if ( ! is_user_logged_in() ) : ?> | |
| 226 | + | |
| 227 | + <?php | |
| 228 | + if ( forumax_get_opt('topic_login_shortcode') ) { | |
| 229 | + echo do_shortcode(forumax_get_opt('topic_login_shortcode')); | |
| 230 | + } else { | |
| 231 | + bbp_get_template_part('form', 'user-login'); | |
| 232 | + } | |
| 233 | + ?> | |
| 234 | + | |
| 410 | 235 | <?php endif; ?> |
| 411 | 236 | |
| 412 | 237 | </div> |
| 413 | 238 | |