<commit_before>header#header(
  ng-mouseenter="App.State.titlebar='toolbox'"
  ng-controller="HeaderCtrl as Header")
  .container.containing-block

    .titlebar-container.text-center(
      ng-switch="App.State.titlebar")
      div.titlebar(ng-switch-when="title")
        h1(no-animate)
          //- The title that reflects the currently spied perspective title
          span.title(
            ng-repeat="title in Header.Spy.spies track by $index"
            ng-class="{'is-prev': Header.Spy.current > $index, 'is-next': Header.Spy.current < $index}" ng-bind-html="::title")
      aside.titlebar.toolbox(ng-switch-when="toolbox")
        .toolbox-btn-group.btn-group(dropdown)

          button.btn(
            ng-click="Header.openInfoModal()"
            tooltip="關於比較表"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ga ga-label="'toolbox.info'"
          )
            span.glyphicon.glyphicon-info-sign

          button.btn(
            dropdown-toggle
            tooltip="面相／主題"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ga ga-label="'toolbox.perspectives'"
          )
            span.glyphicon.glyphicon-th-list

          ul.dropdown-menu.menu-perspective(role="menu")
            li(ng-repeat="title in Header.Spy.spies track by $index")
              a(ng-href="#{{title}}" ng-click="Header.scrollTo($event, title)" ng-bind-html="::title")

        .toolbox-btn-group.btn-group
          button.btn(
            tooltip="{{ Header.labelAction }}爭議標記"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ng-class="{active: App.State.labels}"
            ng-click="Header.toggleLabels()"
            ga ga-label="'toolbox.toggle'"
          )
            span.glyphicon.glyphicon-tags

        .toolbox-btn-group.btn-group
          a.btn(
            tooltip="編輯表格"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ga ga-label="'toolbox.edit'"
            ng-href="{{App.EDIT_URL}}"
          )
            span.glyphicon.glyphicon-pencil

//- The scroll spy placeholder for the page title
//- Should load only after App.TITLE is ready
div.scroll-anchor-container(ng-if="App.TITLE" ng-class="{'is-table': App.LAYOUT_TYPE==='TABLE'}")
  a.scroll-anchor(vu-spy="App.TITLE" id="{{App.TITLE}}")

div(ng-click="App.State.titlebar='title'"
  ng-switch="App.LAYOUT_TYPE")

  main#main.container(ng-switch-default)

    section.scroll-anchor-container(ng-repeat="row in ::App.data.perspectives" ng-cloak)
      a.scroll-anchor(id="{{::row.title}}" vu-spy="row.title")
      .row.col-xs-12
        h2(vu-compile tmpl="::row.titleHtml")

      .row.l-row
        .col-xs-1.l-col(
          ng-repeat="positions in ::row.positions"
          ng-switch="::positions.length"
          ng-style="{width: 100/row.positions.length+'%'}")
          h3(vu-compile tmpl="::App.data.positionTitle[$index]")
          div(ng-switch-default)
            ul
              li(ng-repeat="argument in ::positions.debateArguments" ng-class="{'has-ref':!!argument.ref, 'has-no-ref': App.EMPHASIZE_NO_REF && !argument.ref}" vu-track="{perspective: row.title, position: 0, content: argument.content}")
                div.content(vu-compile tmpl="::argument.content")
                div.ref(vu-compile tmpl="::argument.ref")
            p.add-more: a(ng-href="{{App.EDIT_URL}}" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")
              span.glyphicon.glyphicon-pencil
              | 我要補充……
          div(ng-switch-when="0"): .column-empty(ng-include="'empty.jade'" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")

  main#main.l-table(ng-switch-when="TABLE")

    //- Header row
    header.row-position-title: .container: .row.l-row
      .col-xs-1.l-col(ng-style="{width: 100/(App.data.positionTitle.length+1)+'%'}")
        h4 面相 ＼ 立場

      .col-xs-1.l-col(
        ng-style="{width: 100/(App.data.positionTitle.length+1)+'%'}"
        ng-repeat="title in ::App.data.positionTitle")
        h4(vu-compile tmpl="::title")

    //- Content rows
    section.container.scroll-anchor-container(
      ng-cloak
      ng-repeat="row in ::App.data.perspectives"
      ng-controller="TableRowCtrl as TableRow")

      a.scroll-anchor(id="{{::row.title}}" vu-spy="row.title")

      .row.l-row
        //- Perspective title
        .col-xs-1.l-col.col-perspective-title(
          ng-style="{width: 100/(row.positions.length+1)+'%'}"
          ng-click="TableRow.toggleExpand()")

          h2(vu-compile tmpl="::row.titleHtml")

        //- Arguments of the perspective
        .col-xs-1.l-col(
          ng-repeat="positions in ::row.positions"
          ng-switch="::positions.debateArguments.length"
          ng-style="{width: 100/(row.positions.length+1)+'%'}")

          div(ng-switch-default)
            h2(ng-click="TableRow.toggleExpand()")
              span(vu-compile tmpl="::positions.summary")
              span.glyphicon.glyphicon-chevron-down.arrow(ng-hide="TableRow.isExpanded")
              span.glyphicon.glyphicon-chevron-up.arrow(ng-show="TableRow.isExpanded")
            div(ng-show="TableRow.isExpanded")
              ul
                li(ng-repeat="argument in ::positions.debateArguments" ng-class="{'has-ref':!!argument.ref, 'has-no-ref': App.EMPHASIZE_NO_REF && !argument.ref}" vu-track="{perspective: row.title, position: 0, content: argument.content}")
                  div.content(vu-compile tmpl="::argument.content")
                  div.ref(vu-compile tmpl="::argument.ref")
              p.add-more: a(ng-href="{{App.EDIT_URL}}" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")
                span.glyphicon.glyphicon-pencil
                | 我要補充……

          div(ng-switch-when="0"): .column-empty(ng-include="'empty.jade'" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")


  div.container: div.main-loading.alert.alert-info.text-center(ng-hide="::App.data") Loading

  #edit.row: .col-lg-4.col-lg-offset-4.col-xs-8.col-xs-offset-2
    a.btn.btn-primary.btn-lg.btn-block(
      ng-href="{{::App.EDIT_URL}}"
      ga ga-label="'bottom.edit'")
      | 編輯表格<commit_msg>Fix horizontal scroll by correcting grid layout<commit_after>header#header(
  ng-mouseenter="App.State.titlebar='toolbox'"
  ng-controller="HeaderCtrl as Header")
  .container.containing-block

    .titlebar-container.text-center(
      ng-switch="App.State.titlebar")
      div.titlebar(ng-switch-when="title")
        h1(no-animate)
          //- The title that reflects the currently spied perspective title
          span.title(
            ng-repeat="title in Header.Spy.spies track by $index"
            ng-class="{'is-prev': Header.Spy.current > $index, 'is-next': Header.Spy.current < $index}" ng-bind-html="::title")
      aside.titlebar.toolbox(ng-switch-when="toolbox")
        .toolbox-btn-group.btn-group(dropdown)

          button.btn(
            ng-click="Header.openInfoModal()"
            tooltip="關於比較表"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ga ga-label="'toolbox.info'"
          )
            span.glyphicon.glyphicon-info-sign

          button.btn(
            dropdown-toggle
            tooltip="面相／主題"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ga ga-label="'toolbox.perspectives'"
          )
            span.glyphicon.glyphicon-th-list

          ul.dropdown-menu.menu-perspective(role="menu")
            li(ng-repeat="title in Header.Spy.spies track by $index")
              a(ng-href="#{{title}}" ng-click="Header.scrollTo($event, title)" ng-bind-html="::title")

        .toolbox-btn-group.btn-group
          button.btn(
            tooltip="{{ Header.labelAction }}爭議標記"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ng-class="{active: App.State.labels}"
            ng-click="Header.toggleLabels()"
            ga ga-label="'toolbox.toggle'"
          )
            span.glyphicon.glyphicon-tags

        .toolbox-btn-group.btn-group
          a.btn(
            tooltip="編輯表格"
            tooltip-placement="bottom" tooltip-append-to-body="true"
            ga ga-label="'toolbox.edit'"
            ng-href="{{App.EDIT_URL}}"
          )
            span.glyphicon.glyphicon-pencil

//- The scroll spy placeholder for the page title
//- Should load only after App.TITLE is ready
div.scroll-anchor-container(ng-if="App.TITLE" ng-class="{'is-table': App.LAYOUT_TYPE==='TABLE'}")
  a.scroll-anchor(vu-spy="App.TITLE" id="{{App.TITLE}}")

div(ng-click="App.State.titlebar='title'"
  ng-switch="App.LAYOUT_TYPE")

  main#main.container(ng-switch-default)

    section.scroll-anchor-container(ng-repeat="row in ::App.data.perspectives" ng-cloak)
      a.scroll-anchor(id="{{::row.title}}" vu-spy="row.title")
      .row.col-xs-12
        h2(vu-compile tmpl="::row.titleHtml")

      .row.l-row
        .col-xs-1.l-col(
          ng-repeat="positions in ::row.positions"
          ng-switch="::positions.length"
          ng-style="{width: 100/row.positions.length+'%'}")
          h3(vu-compile tmpl="::App.data.positionTitle[$index]")
          div(ng-switch-default)
            ul
              li(ng-repeat="argument in ::positions.debateArguments" ng-class="{'has-ref':!!argument.ref, 'has-no-ref': App.EMPHASIZE_NO_REF && !argument.ref}" vu-track="{perspective: row.title, position: 0, content: argument.content}")
                div.content(vu-compile tmpl="::argument.content")
                div.ref(vu-compile tmpl="::argument.ref")
            p.add-more: a(ng-href="{{App.EDIT_URL}}" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")
              span.glyphicon.glyphicon-pencil
              | 我要補充……
          div(ng-switch-when="0"): .column-empty(ng-include="'empty.jade'" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")

  main#main.l-table(ng-switch-when="TABLE")

    //- Header row
    header.row-position-title: .container: .row.l-row
      .col-xs-1.l-col(ng-style="{width: 100/(App.data.positionTitle.length+1)+'%'}")
        h4 面相 ＼ 立場

      .col-xs-1.l-col(
        ng-style="{width: 100/(App.data.positionTitle.length+1)+'%'}"
        ng-repeat="title in ::App.data.positionTitle")
        h4(vu-compile tmpl="::title")

    //- Content rows
    section.container.scroll-anchor-container(
      ng-cloak
      ng-repeat="row in ::App.data.perspectives"
      ng-controller="TableRowCtrl as TableRow")

      a.scroll-anchor(id="{{::row.title}}" vu-spy="row.title")

      .row.l-row
        //- Perspective title
        .col-xs-1.l-col.col-perspective-title(
          ng-style="{width: 100/(row.positions.length+1)+'%'}"
          ng-click="TableRow.toggleExpand()")

          h2(vu-compile tmpl="::row.titleHtml")

        //- Arguments of the perspective
        .col-xs-1.l-col(
          ng-repeat="positions in ::row.positions"
          ng-switch="::positions.debateArguments.length"
          ng-style="{width: 100/(row.positions.length+1)+'%'}")

          div(ng-switch-default)
            h2(ng-click="TableRow.toggleExpand()")
              span(vu-compile tmpl="::positions.summary")
              span.glyphicon.glyphicon-chevron-down.arrow(ng-hide="TableRow.isExpanded")
              span.glyphicon.glyphicon-chevron-up.arrow(ng-show="TableRow.isExpanded")
            div(ng-show="TableRow.isExpanded")
              ul
                li(ng-repeat="argument in ::positions.debateArguments" ng-class="{'has-ref':!!argument.ref, 'has-no-ref': App.EMPHASIZE_NO_REF && !argument.ref}" vu-track="{perspective: row.title, position: 0, content: argument.content}")
                  div.content(vu-compile tmpl="::argument.content")
                  div.ref(vu-compile tmpl="::argument.ref")
              p.add-more: a(ng-href="{{App.EDIT_URL}}" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")
                span.glyphicon.glyphicon-pencil
                | 我要補充……

          div(ng-switch-when="0"): .column-empty(ng-include="'empty.jade'" vu-track="{label: 'item.edit', perspective: row.title, position: 0}")


  div.container: div.main-loading.alert.alert-info.text-center(ng-hide="::App.data") Loading

  #edit.container: .row: .col-lg-4.col-lg-offset-4.col-xs-8.col-xs-offset-2
    a.btn.btn-primary.btn-lg.btn-block(
      ng-href="{{::App.EDIT_URL}}"
      ga ga-label="'bottom.edit'")
      | 編輯表格
{'fraction_non_alphanumeric': 0.17373899119295436, 'fraction_numerical': 0.007205764611689352, 'mean_word_length': 2.457237752560199, 'pattern_counts': {'":': 28, '<': 5, '<?xml version=': 0, '>': 5, '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': '787210', 'n_tokens_mistral': 4327, 'n_tokens_neox': 4071, 'n_words': 540}