<commit_before>{{#if menuVisible}}
  <div class="topic-admin-menu">
    <h3>{{i18n admin_title}}</h3>

    <ul>
        <li>
          <button {{action toggleMultiSelect}} class='btn btn-admin'><i class='fa fa-tasks'></i> {{i18n topic.actions.multi_select}}</button>
        </li>

      {{#if details.can_delete}}
        <li>
          <button {{action deleteTopic}} class='btn btn-admin btn-danger'><i class='fa fa-trash-o'></i> {{i18n topic.actions.delete}}</button>
        </li>
      {{/if}}

      {{#if showRecover}}
        <li>
          <button {{action recoverTopic}} class='btn btn-admin'><i class='fa fa-undo'></i> {{i18n topic.actions.recover}}</button>
        </li>
      {{/if}}

      <li>
        {{#if closed}}
          <button {{action toggleClosed}} class='btn btn-admin'><i class='fa fa-unlock'></i> {{i18n topic.actions.open}}</button>
        {{else}}
          <button {{action toggleClosed}} class='btn btn-admin'><i class='fa fa-lock'></i> {{i18n topic.actions.close}}</button>
          <button {{action showAutoClose}} class='btn btn-admin'><i class='fa fa-clock-o'></i> {{i18n topic.actions.auto_close}}</button>
        {{/if}}
      </li>

      {{#unless isPrivateMessage}}
        <li>
          {{#if isBanner}}
            <button {{action removeBanner}} class='btn btn-admin'><i class='fa fa-bullhorn'></i> {{i18n topic.actions.remove_banner}}</button>
          {{else}}
            <button {{action makeBanner}} class='btn btn-admin'><i class='fa fa-bullhorn'></i> {{i18n topic.actions.make_banner}}</button>
          {{/if}}
        </li>

        <li>
          {{#if pinned_at}}
            <button {{action togglePinned}} class='btn btn-admin'><i class='fa fa-thumb-tack'></i> {{i18n topic.actions.unpin}}</button>
          {{else}}
            <button {{action togglePinned}} class='btn btn-admin'><i class='fa fa-thumb-tack'></i> {{i18n topic.actions.pin}}</button>
            <button {{action togglePinnedGlobally}} class='btn btn-admin'><i class='fa fa-thumb-tack'></i> {{i18n topic.actions.pin_globally}}</button>
          {{/if}}
        </li>
      {{/unless}}

      <li>
        {{#if archived}}
          <button {{action toggleArchived}} class='btn btn-admin'><i class='fa fa-folder'></i> {{i18n topic.actions.unarchive}}</button>
        {{else}}
          <button {{action toggleArchived}} class='btn btn-admin'><i class='fa fa-folder'></i> {{i18n topic.actions.archive}}</button>
        {{/if}}
      </li>

      <li>
        {{#if visible}}
          <button {{action toggleVisibility}} class='btn btn-admin'><i class='fa fa-eye-slash'></i> {{i18n topic.actions.invisible}}</button>
        {{else}}
          <button {{action toggleVisibility}} class='btn btn-admin'><i class='fa fa-eye'></i> {{i18n topic.actions.visible}}</button>
        {{/if}}
      </li>
<commit_msg>BUGFIX: prevent invisible topic from being pinned or becoming a banner<commit_after>{{#if menuVisible}}
  <div class="topic-admin-menu">
    <h3>{{i18n admin_title}}</h3>

    <ul>
        <li>
          <button {{action toggleMultiSelect}} class='btn btn-admin'><i class='fa fa-tasks'></i> {{i18n topic.actions.multi_select}}</button>
        </li>

      {{#if details.can_delete}}
        <li>
          <button {{action deleteTopic}} class='btn btn-admin btn-danger'><i class='fa fa-trash-o'></i> {{i18n topic.actions.delete}}</button>
        </li>
      {{/if}}

      {{#if showRecover}}
        <li>
          <button {{action recoverTopic}} class='btn btn-admin'><i class='fa fa-undo'></i> {{i18n topic.actions.recover}}</button>
        </li>
      {{/if}}

      <li>
        {{#if closed}}
          <button {{action toggleClosed}} class='btn btn-admin'><i class='fa fa-unlock'></i> {{i18n topic.actions.open}}</button>
        {{else}}
          <button {{action toggleClosed}} class='btn btn-admin'><i class='fa fa-lock'></i> {{i18n topic.actions.close}}</button>
          <button {{action showAutoClose}} class='btn btn-admin'><i class='fa fa-clock-o'></i> {{i18n topic.actions.auto_close}}</button>
        {{/if}}
      </li>

      {{#unless isPrivateMessage}}
          <li>
            {{#if isBanner}}
              <button {{action removeBanner}} class='btn btn-admin'><i class='fa fa-bullhorn'></i> {{i18n topic.actions.remove_banner}}</button>
            {{else}}
              {{#if visible}}
                <button {{action makeBanner}} class='btn btn-admin'><i class='fa fa-bullhorn'></i> {{i18n topic.actions.make_banner}}</button>
              {{/if}}
            {{/if}}
          </li>

          <li>
            {{#if pinned_at}}
              <button {{action togglePinned}} class='btn btn-admin'><i class='fa fa-thumb-tack'></i> {{i18n topic.actions.unpin}}</button>
            {{else}}
              {{#if visible}}
                <button {{action togglePinned}} class='btn btn-admin'><i class='fa fa-thumb-tack'></i> {{i18n topic.actions.pin}}</button>
                <button {{action togglePinnedGlobally}} class='btn btn-admin'><i class='fa fa-thumb-tack'></i> {{i18n topic.actions.pin_globally}}</button>
              {{/if}}
            {{/if}}
          </li>
      {{/unless}}

      <li>
        {{#if archived}}
          <button {{action toggleArchived}} class='btn btn-admin'><i class='fa fa-folder'></i> {{i18n topic.actions.unarchive}}</button>
        {{else}}
          <button {{action toggleArchived}} class='btn btn-admin'><i class='fa fa-folder'></i> {{i18n topic.actions.archive}}</button>
        {{/if}}
      </li>

      <li>
        {{#if visible}}
          <button {{action toggleVisibility}} class='btn btn-admin'><i class='fa fa-eye-slash'></i> {{i18n topic.actions.invisible}}</button>
        {{else}}
          <button {{action toggleVisibility}} class='btn btn-admin'><i class='fa fa-eye'></i> {{i18n topic.actions.visible}}</button>
        {{/if}}
      </li>

{'fraction_non_alphanumeric': 0.20557728277503826, 'fraction_numerical': 0.011562659411664683, 'mean_word_length': 2.5756838905775075, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6818135', 'n_tokens_mistral': 1986, 'n_tokens_neox': 1877, 'n_words': 392}