{% set base_url = '/comments/' + comment_id %} {% macro comment_thread_action_button(base_url, comment_id, action, following, muted) %} {% set btn_style = 'btn-' + ('success' if action == 'follow' else 'warning') %} {% set title = 'Thread ' + ('followed' if action == 'follow' else 'muted') %} {% set data_module_content = 'You are now following comments on this thread.' if action == 'follow' else 'You have muted comment notifications on this thread.' %} {% if action == 'follow' and (following or (following_content and not muted)) %} {% set hidden_class = True %} {% elif action == 'mute' and (muted or (not following_content and not following)) %} {% set hidden_class = True %} {% else %} {% set hidden_class = False %} {% endif %} {% endmacro %}