<commit_before><div class="navigation"><%
  render_tabnav :project do
    add_tab({:html => {:id => 'projects_tab',
                       :class => 'nav_tab',
                       :li_class => 'nav_tab_container',
                       :li_end => projects_tab_list(current_user.projects.unarchived)}
            }) do |t|
      name = project ? truncate(project.name, :length => 30) : t('shared.navigation.all_projects')
      t.named "#{name} #{image_tag('triangle.png', :class => 'triangle')}"
      t.links_to(project ? project_path(project) : projects_path)
      t.highlights_on :controller => :projects, :action => :index
      t.highlights_on :controller => :projects, :action => :show
      t.tab_index = 100
    end

    if project.nil?
      add_tab do |t|
       t.named t('shared.project_navigation.all_task_lists')
       t.links_to task_lists_path
       t.highlights_on :controller => :task_lists, :action => :index
       t.tab_index = 110
      end

      add_tab do |t|
       t.named t('shared.project_navigation.gantt')
       t.links_to gantt_view_task_lists_path
       t.highlights_on :controller => :task_lists, :action => :gantt_view
       t.tab_index = 120
      end

      if time_tracking_enabled?
        add_tab do |t|
          t.named t('shared.project_navigation.time_tracking')
          t.links_to time_path
          t.highlights_on :controller => :hours, :action => :index
          t.tab_index = 130
        end
      end

      # If we're on the community version, we'll show only one organization
      if Teambox.config.community && Organization.last
        add_tab do |t|
         t.named t('shared.project_navigation.organization')
         t.links_to organization_path(Organization.last)
         t.highlights_on :controller => :organizations
         t.li_class = 'organizations'
         t.li_class = 'right_side'
         t.tab_index = 140
        end
      elsif !Teambox.config.community
        add_tab do |t|
         t.named t('shared.project_navigation.organizations')
         t.links_to organizations_path
         t.highlights_on :controller => :organizations
         t.li_class = 'organizations'
         t.li_class = 'right_side'
         t.tab_index = 140
        end
      end

    else
      add_tab do |t|
        t.named t('shared.project_navigation.conversations')
        t.links_to  project_conversations_path(project)
        t.highlights_on :controller => :conversations
        t.tab_index = 110
      end

      add_tab do |t|
        t.named t('shared.project_navigation.task_lists')
        t.links_to  project_task_lists_path(project)
        t.highlights_on :controller => :task_lists
        t.highlights_on :controller => :tasks
        t.tab_index = 120
      end

      add_tab(:html => {:id => 'pages_tab',
                        :class => 'nav_tab',
                        :li_class => 'nav_tab_container',
                        :li_end => pages_tab_list(project, project.pages) }) do |t|
        t.named "#{t('shared.project_navigation.pages')} #{image_tag('triangle.png', :class => 'triangle')}"
        t.links_to  project_pages_path(project)
        t.highlights_on :controller => :pages
        t.tab_index = 130
      end

      if time_tracking_enabled? and project.tracks_time
        add_tab do |t|
          t.named t('shared.project_navigation.time_tracking')
          t.links_to  project_time_path(project)
          t.highlights_on :controller => :hours
          t.tab_index = 140
        end
      end

      add_tab do |t|
        t.named t('shared.project_navigation.files')
        t.links_to  project_uploads_path(project)
        t.highlights_on :controller => :uploads
        t.tab_index = 150
      end

      add_tab do |t|
        t.named t('shared.project_navigation.people')
        t.links_to  project_people_path(project)
        t.highlights_on :controller => :people
        t.li_class = 'right_side'
        t.tab_index = 170
      end

      if project.admin?(current_user)
        add_tab do |t|<commit_msg>Pages tab should not appear until you belong to the project<commit_after><div class="navigation"><%
  render_tabnav :project do
    add_tab({:html => {:id => 'projects_tab',
                       :class => 'nav_tab',
                       :li_class => 'nav_tab_container',
                       :li_end => projects_tab_list(current_user.projects.unarchived)}
            }) do |t|
      name = project ? truncate(project.name, :length => 30) : t('shared.navigation.all_projects')
      t.named "#{name} #{image_tag('triangle.png', :class => 'triangle')}"
      t.links_to(project ? project_path(project) : projects_path)
      t.highlights_on :controller => :projects, :action => :index
      t.highlights_on :controller => :projects, :action => :show
      t.tab_index = 100
    end

    if project.nil?
      add_tab do |t|
       t.named t('shared.project_navigation.all_task_lists')
       t.links_to task_lists_path
       t.highlights_on :controller => :task_lists, :action => :index
       t.tab_index = 110
      end

      add_tab do |t|
       t.named t('shared.project_navigation.gantt')
       t.links_to gantt_view_task_lists_path
       t.highlights_on :controller => :task_lists, :action => :gantt_view
       t.tab_index = 120
      end

      if time_tracking_enabled?
        add_tab do |t|
          t.named t('shared.project_navigation.time_tracking')
          t.links_to time_path
          t.highlights_on :controller => :hours, :action => :index
          t.tab_index = 130
        end
      end

      # If we're on the community version, we'll show only one organization
      if Teambox.config.community && Organization.last
        add_tab do |t|
         t.named t('shared.project_navigation.organization')
         t.links_to organization_path(Organization.last)
         t.highlights_on :controller => :organizations
         t.li_class = 'organizations'
         t.li_class = 'right_side'
         t.tab_index = 140
        end
      elsif !Teambox.config.community
        add_tab do |t|
         t.named t('shared.project_navigation.organizations')
         t.links_to organizations_path
         t.highlights_on :controller => :organizations
         t.li_class = 'organizations'
         t.li_class = 'right_side'
         t.tab_index = 140
        end
      end

    else
      add_tab do |t|
        t.named t('shared.project_navigation.conversations')
        t.links_to  project_conversations_path(project)
        t.highlights_on :controller => :conversations
        t.tab_index = 110
      end

      add_tab do |t|
        t.named t('shared.project_navigation.task_lists')
        t.links_to  project_task_lists_path(project)
        t.highlights_on :controller => :task_lists
        t.highlights_on :controller => :tasks
        t.tab_index = 120
      end
			
			page_tab = project.has_member?(current_user) ? {:id => 'pages_tab', :class => 'nav_tab', :li_class => 'nav_tab_container', :li_end => pages_tab_list(project, project.pages) } : {}
			
      add_tab(:html => page_tab) do |t|
        t.named "#{t('shared.project_navigation.pages')} #{image_tag('triangle.png', :class => 'triangle') if project.has_member?(current_user)}"
        t.links_to  project_pages_path(project)
        t.highlights_on :controller => :pages
        t.tab_index = 130
      end

      if time_tracking_enabled? and project.tracks_time
        add_tab do |t|
          t.named t('shared.project_navigation.time_tracking')
          t.links_to  project_time_path(project)
          t.highlights_on :controller => :hours
          t.tab_index = 140
        end
      end

      add_tab do |t|
        t.named t('shared.project_navigation.files')
        t.links_to  project_uploads_path(project)
        t.highlights_on :controller => :uploads
        t.tab_index = 150
      end

      add_tab do |t|
        t.named t('shared.project_navigation.people')
        t.links_to  project_people_path(project)
        t.highlights_on :controller => :people
        t.li_class = 'right_side'
        t.tab_index = 170
      end

      if project.admin?(current_user)
        add_tab do |t|
{'fraction_non_alphanumeric': 0.10665193912616593, 'fraction_numerical': 0.009327442317133039, 'mean_word_length': 2.2991902834008098, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4424218', 'n_tokens_mistral': 2649, 'n_tokens_neox': 2500, 'n_words': 514}