<commit_before>- @title = "Setup Designs"

- content_for :header, @title

- content_for :breadcrumbs do
  %ol
    %li
      = link_to ae_module_dashboard_path(@project) do
        = icon("fas", "caret-left")
        ae dashboard
    %li.breadcrumb-muted setup designs

.d-flex
  .flex-fill.p-3
    %h2 Designs
    - designs = @project.designs.includes(:category).where(categories: { use_for_adverse_events: true }).order(:name)
    - designs = @project.designs.order(:name) # TODO: Remove?
    .aer-designs
      - designs.each do |design|
        .aer-design{ data: { object: "aer-designs-draggable", design_id: design.id } }
          = icon("fas", "arrows-alt")
          = design.name

  .flex-fill.p-3
    .mb-5
      %h2 Reporter
      .aer-designs{ data: { object: "aer-designs-sortable", url: ae_module_admins_submit_designs_path(@project, role: "reporter"), pathway_id: "reporter" } }
        - designments = @project.ae_designments.where(ae_team_pathway_id: nil, role: "reporter").order(Arel.sql("position nulls last")).includes(:design)
        = render "ae_module/admins/designments", project: @project, designments: designments

    - @project.ae_teams.each do |team|
      .mb-5
        %h2= team.name
        - if team.ae_team_pathways.present?
          - team.ae_team_pathways.each do |pathway|
            .mb-3
              %strong
                = pathway.name
              %small.text-muted= pluralize pathway.number_of_reviewers, "reviewers"
              .aer-designs{ data: { object: "aer-designs-sortable", url: ae_module_admins_submit_designs_path(@project, pathway_id: pathway.id, role: "team"), pathway_id: pathway.id } }
                - designments = pathway.ae_designments.includes(:design)
                = render "ae_module/admins/designments", project: @project, designments: designments
        - else
          .text-muted No pathways found.

    .mb-5
      %h2 AE Admin
      .aer-designs{ data: { object: "aer-designs-sortable", url: ae_module_admins_submit_designs_path(@project, role: "admin"), pathway_id: "admin" } }
        - designments = @project.ae_designments.where(ae_team_pathway_id: nil, role: "admin").order(Arel.sql("position nulls last")).includes(:design)
        = render "ae_module/admins/designments", project: @project, designments: designments<commit_msg>Only list designs that are part of adverse events category, addresses #692.<commit_after>- @title = "Setup Designs"

- content_for :header, @title

- content_for :breadcrumbs do
  %ol
    %li
      = link_to ae_module_dashboard_path(@project) do
        = icon("fas", "caret-left")
        ae dashboard
    %li.breadcrumb-muted setup designs

.d-flex
  .flex-fill.p-3
    %h2 Designs
    .mb-3.small.text-muted
      Set "Adverse Events" category on
      = link_to "designs", project_designs_path(@project)
      to see them listed here.
    - designs = @project.designs.includes(:category).where(categories: { use_for_adverse_events: true }).order(:name)
    .aer-designs
      - designs.each do |design|
        .aer-design{ data: { object: "aer-designs-draggable", design_id: design.id } }
          = icon("fas", "arrows-alt")
          = design.name

  .flex-fill.p-3
    .mb-5
      %h2 Reporter
      .aer-designs{ data: { object: "aer-designs-sortable", url: ae_module_admins_submit_designs_path(@project, role: "reporter"), pathway_id: "reporter" } }
        - designments = @project.ae_designments.where(ae_team_pathway_id: nil, role: "reporter").order(Arel.sql("position nulls last")).includes(:design)
        = render "ae_module/admins/designments", project: @project, designments: designments

    - @project.ae_teams.each do |team|
      .mb-5
        %h2= team.name
        - if team.ae_team_pathways.present?
          - team.ae_team_pathways.each do |pathway|
            .mb-3
              %strong= pathway.name
              .aer-designs{ data: { object: "aer-designs-sortable", url: ae_module_admins_submit_designs_path(@project, pathway_id: pathway.id, role: "team"), pathway_id: pathway.id } }
                - designments = pathway.ae_designments.includes(:design)
                = render "ae_module/admins/designments", project: @project, designments: designments
        - else
          .text-muted No pathways found.

    .mb-5
      %h2 AE Admin
      .aer-designs{ data: { object: "aer-designs-sortable", url: ae_module_admins_submit_designs_path(@project, role: "admin"), pathway_id: "admin" } }
        - designments = @project.ae_designments.where(ae_team_pathway_id: nil, role: "admin").order(Arel.sql("position nulls last")).includes(:design)
        = render "ae_module/admins/designments", project: @project, designments: designments
{'fraction_non_alphanumeric': 0.13187047294418405, 'fraction_numerical': 0.0051129100979974435, 'mean_word_length': 2.952020202020202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1784192', 'n_tokens_mistral': 1610, 'n_tokens_neox': 1560, 'n_words': 306}