<commit_before>= search_form_for @search, :url => admin_schedules_path, :wrapper => :admin, :html => { :class => "form-horizontal" } do |f|
  .well
    fieldset
      legend 搜尋      
      .row
        .span6
          .control-group
            label.control-label= f.label :branch_name_eq
            .controls= f.select :branch_name_eq,
            collect_for_schedule_branch_names, include_blank: "請選擇"
        .span6
          .control-group
            label.control-label= f.label :court_full_name_eq
            .controls= f.select :court_id_eq, 
            collect_for_courts, include_blank: "請選擇"
      .row
        .span6
          .control-group#datepicker
            label.control-label= f.label :date_gteq
            .controls= f.search_field :date_gteq, placeholder: "起始時間，非必填"
            label.control-label= f.label :date_lteq
            .controls= f.search_field :date_lteq, placeholder: "結束時間，非必填"
  
    .form-actions
      = f.submit :value => "搜尋", :class => "btn btn-primary"
      = " "
      = link_to "清空搜尋結果", admin_schedules_path, :class => "btn btn-default"

= admin_widget_box "庭期表列表", icon: :pencil do
  .dataTables_wrapper
    table.table.table-bordered.table-striped.table-hover
      thead
        tr
          th= sort_link(@search, :id, "#")
          th= sort_link(@search, :court_full_name, "開庭法院")
          th 案件
          th 主審法官
          th= sort_link(@search, :branch_name, "股別名稱")
          th= sort_link(@search, :date, "開庭時間")
      tbody
        - @schedules.each do |schedule|
          tr
            td= schedule.id
            td= link_to "#{schedule.court.full_name}", admin_court_path(schedule.court)
            td= link_to "#{schedule.story.identity}", admin_story_path(schedule.story)
            td= link_to "#{schedule.story.main_judge.name}", admin_judge_path(schedule.story.main_judge)
            td= schedule.branch_name
            td= schedule.date
    .ui-toolbar.ui-widget-header<commit_msg>view fix 預防 story 抓不到 main_judge 時的狀況<commit_after>= search_form_for @search, :url => admin_schedules_path, :wrapper => :admin, :html => { :class => "form-horizontal" } do |f|
  .well
    fieldset
      legend 搜尋      
      .row
        .span6
          .control-group
            label.control-label= f.label :branch_name_eq
            .controls= f.select :branch_name_eq,
            collect_for_schedule_branch_names, include_blank: "請選擇"
        .span6
          .control-group
            label.control-label= f.label :court_full_name_eq
            .controls= f.select :court_id_eq, 
            collect_for_courts, include_blank: "請選擇"
      .row
        .span6
          .control-group#datepicker
            label.control-label= f.label :date_gteq
            .controls= f.search_field :date_gteq, placeholder: "起始時間，非必填"
            label.control-label= f.label :date_lteq
            .controls= f.search_field :date_lteq, placeholder: "結束時間，非必填"
  
    .form-actions
      = f.submit :value => "搜尋", :class => "btn btn-primary"
      = " "
      = link_to "清空搜尋結果", admin_schedules_path, :class => "btn btn-default"

= admin_widget_box "庭期表列表", icon: :pencil do
  .dataTables_wrapper
    table.table.table-bordered.table-striped.table-hover
      thead
        tr
          th= sort_link(@search, :id, "#")
          th= sort_link(@search, :court_full_name, "開庭法院")
          th 主審法官
          th 案件
          th= sort_link(@search, :branch_name, "股別名稱")
          th= sort_link(@search, :date, "開庭時間")
      tbody
        - @schedules.each do |schedule|
          tr
            td= schedule.id
            td= link_to "#{schedule.court.full_name}", admin_court_path(schedule.court)
            td= link_to schedule.story.main_judge.name, admin_judge_path(schedule.story.main_judge) if schedule.story.main_judge  
            td= link_to "#{schedule.story.identity}", admin_story_path(schedule.story)
            td= schedule.branch_name
            td= schedule.date    
    .ui-toolbar.ui-widget-header
{'fraction_non_alphanumeric': 0.11577096936212958, 'fraction_numerical': 0.0015067805123053742, 'mean_word_length': 2.183852917665867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '6528035', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1401, 'n_words': 253}