<commit_before>#overlay

#content_box

#main
  - flash.each do |_, msg|
    %div
      = msg

  #title_box
    - if user_signed_in?
      #admin_panel
        .dropdown
          %p{class: 'dropdown-toggle', 'data-toggle' => 'dropdown'}
            Admin Panel
          %ul.dropdown-menu
            %li
              = link_to "Sign Out", destroy_user_session_path, :method => :get
            %li
              = link_to "Change your password", edit_user_registration_path

            - if user_signed_in? and current_user.root?
              %li
                = link_to "Create new account", new_account_path, :method => :get
              %li
                = link_to "Delete existing accounts", edit_account_path("root"), :method => :get
    - else
      = link_to('Sign In', new_user_session_path)
    
    #event_creation_box
      - if user_signed_in?
        = form_tag new_event_path, method: :get, id: 'new_event', format: :js, remote: true do
          -# this path does an ajax GET to the event controller action "new"
          = submit_tag '+', class: ['main_organization', 'event_creation_button']

        = form_tag third_party_events_path, method: :get, id: 'third_party', format: :js, remote: true  do
          -# this path does an ajax GET to the event controller action "third_party"
          = submit_tag '+ 3rd Party', class: ['event_creation_button','third_party_organization']
          
      - else
        = form_tag new_event_path, method: :get, id: 'suggest_event', format: :js, remote: true do
          -# this path does an ajax GET to the event controller action "new"
          = hidden_field_tag 'suggested_event', 'True'
          = submit_tag 'Suggest Event', class: ['main_organization', 'event_creation_button', 'button_right']

    .clear
        
  = form_for :event, :url => { :action => "show", :anchor => 'page' }, :method => "get", :html => {:id => 'filter_form'} do |f|
    %h4 Filter by: 
    = f.select(:filter, options_for_select([['Family Friendly', 'family_friendly'], ['Free', 'free']], :selected => @filter), {:include_blank=> 'No Filter', :class => 'filter_dropdown'}, onchange: "$('#filter_form').submit();")
    
  #color_keys
    %table
      %tr
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#2E9AFE"}

        %td{:class => "color_category"} Hike
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#86B404"}

        %td{:class => "color_category"} Plant
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#FAAC58"}

        %td{:class => "color_category"} Volunteer
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#F7FE2E"}

        %td{:class => "color_category"} Learn
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#F781BE"}

        %td{:class => "color_category"} Performance
          
          

  - # Div for calendar and sidepanel
  #wrap
    #calendar
    - # Div for event side panel
    #panel_wrapper
      #panel_header
        %h2 Event Details
      #panel
        %h4.default_event_message Click an event!

    .clear
    
#admin_panel
  - if user_signed_in?
    %div{ class: 'container' }
      %br
      %h2
        %strong Events
      %br
    #upcoming.container
      %ul.nav.nav-tabs.containter.clearfix
        - @tabs.each do |tab|
          - if tab.eql? "Upcoming"
            %li{class: 'active', id: "#{tab}"}
              %a{ href: "##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab}
          - else
            %li{id: "#{tab}"}
              - if tab.eql? "Pending"
                %a{ :href =>"#pending_events", 'data-toggle' => 'tab' } Pending (#{@pending_count})
              - else
                %li{id: "#{tab}"}
                  - if tab.eql? "Pending"
                    %a{ :href =>"#pending_events", 'data-toggle' => 'tab' } Pending (#{@pending_count})
                  - else
                    %a{ :href =>"##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab}
        
        %div.tab-content.clearfix.container
          %br
          - @tabs.each do |tab|
            - if tab.eql? "Upcoming"
              %li{class: 'active', id: "#{tab}"}
                %a{ href: "##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab}
            - else
              %li{id: "#{tab}"}
                - if tab.eql? "Pending"
                  %a{ :href =>"#pending_events", 'data-toggle' => 'tab' } Pending (#{@pending_count})
                - else
                  %li{id: "#{tab}"}
                    - if tab.eql? "Pending"
                      %a{ :href =>"#pending_events", 'data-toggle' => 'tab' } Pending (#{@pending_count})
                    - else
                      %a{ :href =>"##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab}
        
          %div.tab-content.clearfix.container
            %br
            - @tabs.each do |tab|
              - if tab.eql? "Upcoming"
                %div{ class: 'tab-pane active', id: "#{tab.downcase}_events" }
                  = render partial: 'admin_panel', locals: {tab: tab}
              - else
                %div{ class: 'tab-pane', id: "#{tab.downcase}_events" }
                  = render partial: 'admin_panel', locals: { tab: tab }
            %br
%br

#sync_status
  - if user_signed_in?
    %h2
      %strong Sync Status
    .container.row
      #status.container.col-sm-8
        .button_right
          Sync
          %i.fa.fa-refresh
        = render partial: 'sync_panel'
      #add_cal.container.col-sm-4
        %h3 Add New Calendar
        = form_tag syncs_path do
          = label :sync, :url, "URL"
          = text_field :sync, :url
          = submit_tag 'Add Calendar'

:javascript
  $(document).ready(function(){
    var show_btns = $("a:contains('Show')");
    
    show_btns.each(function(index){
    
      $(this).on("click", function() {
      
        $(this).html("" + (($(this).attr("aria-expanded") == "true") ? "Show More <i class='fa fa-angle-down'></i>" : "Show Less <i class='fa fa-angle-up'></i>") );
      });
    });
  });
  <commit_msg>cleaned up admin panel code in calendar haml<commit_after>#overlay

#content_box

#main
  - flash.each do |_, msg|
    %div
      = msg

  #title_box
    - if user_signed_in?
      #admin_panel
        .dropdown
          %p{class: 'dropdown-toggle', 'data-toggle' => 'dropdown'}
            Admin Panel
          %ul.dropdown-menu
            %li
              = link_to "Sign Out", destroy_user_session_path, :method => :get
            %li
              = link_to "Change your password", edit_user_registration_path

            - if user_signed_in? and current_user.root?
              %li
                = link_to "Create new account", new_account_path, :method => :get
              %li
                = link_to "Delete existing accounts", edit_account_path("root"), :method => :get
    - else
      = link_to('Sign In', new_user_session_path)
    
    #event_creation_box
      - if user_signed_in?
        = form_tag new_event_path, method: :get, id: 'new_event', format: :js, remote: true do
          -# this path does an ajax GET to the event controller action "new"
          = submit_tag '+', class: ['main_organization', 'event_creation_button']

        = form_tag third_party_events_path, method: :get, id: 'third_party', format: :js, remote: true  do
          -# this path does an ajax GET to the event controller action "third_party"
          = submit_tag '+ 3rd Party', class: ['event_creation_button','third_party_organization']
          
      - else
        = form_tag new_event_path, method: :get, id: 'suggest_event', format: :js, remote: true do
          -# this path does an ajax GET to the event controller action "new"
          = hidden_field_tag 'suggested_event', 'True'
          = submit_tag 'Suggest Event', class: ['main_organization', 'event_creation_button', 'button_right']

    .clear
        
  = form_for :event, :url => { :action => "show", :anchor => 'page' }, :method => "get", :html => {:id => 'filter_form'} do |f|
    %h4 Filter by: 
    = f.select(:filter, options_for_select([['Family Friendly', 'family_friendly'], ['Free', 'free']], :selected => @filter), {:include_blank=> 'No Filter', :class => 'filter_dropdown'}, onchange: "$('#filter_form').submit();")
    
  #color_keys
    %table
      %tr
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#2E9AFE"}

        %td{:class => "color_category"} Hike
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#86B404"}

        %td{:class => "color_category"} Plant
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#FAAC58"}

        %td{:class => "color_category"} Volunteer
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#F7FE2E"}

        %td{:class => "color_category"} Learn
        
        %td{:class => "color_cube"}
          %svg{:xmlns => "http://www.w3.org/2000/svg", :version => "1.1", :width => 15, :height => 15}
            %rect{:width => 15, :height => 15, :fill => "#F781BE"}

        %td{:class => "color_category"} Performance
          
          

  - # Div for calendar and sidepanel
  #wrap
    #calendar
    - # Div for event side panel
    #panel_wrapper
      #panel_header
        %h2 Event Details
      #panel
        %h4.default_event_message Click an event!

    .clear

- if user_signed_in?    
  #admin_panel
    .container
      %br
      %h2
        %strong Events
      %br
    #upcoming.container
      %ul.nav.nav-tabs.container.clearfix
        - @tabs.each do |tab|
          - if tab.eql? "Upcoming"
            %li{ class: 'active', id: "#{tab}"}
              %a{ :href => "##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab}
          - elsif tab.eql? "Pending"
            %li{id: "#{tab}"}
              %a{ :href => "##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab} (#{@pending_count})
          - else
            %li{id: "#{tab}"}
              %a{ :href => "##{tab.downcase}_events", 'data-toggle' => 'tab' } #{tab}
      .tab-content.clearfix.container
        - @tabs.each do |tab|
          - if tab.eql? "Upcoming"
            .container{ class: 'tab-pane active', id: "#{tab.downcase}_events" }
              = render partial: 'admin_panel', locals: { tab: tab }
          - else
            .container{ class: 'tab-pane',        id: "#{tab.downcase}_events" }
              = render partial: 'admin_panel', locals: { tab: tab }
%br

#sync_status
  - if user_signed_in?
    %h2
      %strong Sync Status
    .container.row
      #status.container.col-sm-8
        .button_right
          Sync
          %i.fa.fa-refresh
        = render partial: 'sync_panel'
      #add_cal.container.col-sm-4
        %h3 Add New Calendar
        = form_tag syncs_path do
          = label :sync, :url, "URL"
          = text_field :sync, :url
          = submit_tag 'Add Calendar'

:javascript
  $(document).ready(function(){
    var show_btns = $("a:contains('Show')");
    
    show_btns.each(function(index){
    
      $(this).on("click", function() {
      
        $(this).html("" + (($(this).attr("aria-expanded") == "true") ? "Show More <i class='fa fa-angle-down'></i>" : "Show Less <i class='fa fa-angle-up'></i>") );
      });
    });
  });
  
{'fraction_non_alphanumeric': 0.16915064102564104, 'fraction_numerical': 0.015705128205128205, 'mean_word_length': 2.052335534360479, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 147, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 10}, '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': '116682', 'n_tokens_mistral': 4256, 'n_tokens_neox': 4048, 'n_words': 949}