index.html.haml 2.09 KB
Newer Older
1 2
.top-area
  .nav-text
3 4
    - full_count_title = "#{@public_forks_count} public and #{@private_forks_count} private"
    == #{pluralize(@total_forks_count, 'fork')}: #{full_count_title}
5

6
  .nav-controls
7 8 9
    = form_tag request.original_url, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f|
      = search_field_tag :filter_projects, nil, placeholder: 'Search forks', class: 'projects-list-filter project-filter-form-field form-control input-short',
        spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' }
10

11
    .dropdown
12 13 14 15 16 17 18 19 20 21 22
      %button.dropdown-toggle.btn.sort-forks{type: 'button', 'data-toggle' => 'dropdown'}
        %span.light sort:
        - if @sort.present?
          = sort_options_hash[@sort]
        - else
          = sort_title_recently_created
        %b.caret
      %ul.dropdown-menu.dropdown-menu-align-right
        %li
          - excluded_filters = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id]
          = link_to page_filter_path(sort: sort_value_recently_created, without: excluded_filters) do
23
            = sort_title_recently_created
24 25 26 27 28 29
          = link_to page_filter_path(sort: sort_value_oldest_created, without: excluded_filters) do
            = sort_title_oldest_created
          = link_to page_filter_path(sort: sort_value_recently_updated, without: excluded_filters) do
            = sort_title_recently_updated
          = link_to page_filter_path(sort: sort_value_oldest_updated, without: excluded_filters) do
            = sort_title_oldest_updated
30

31 32 33
    - if current_user && can?(current_user, :fork_project, @project)
      - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
        = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-new' do
Annabel Dunstone's avatar
Annabel Dunstone committed
34
          = custom_icon('icon_fork')
35 36 37
          Fork
      - else
        = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-new' do
Annabel Dunstone's avatar
Annabel Dunstone committed
38
          = custom_icon('icon_fork')
39
          Fork
40 41


42
= render 'projects', projects: @forks