2021-12-06 18:14:09 +00:00
- sort_value = @sort || sort_value_recently_created
- sort_title = forks_sort_options_hash[sort_value]
2016-02-03 00:08:30 +00:00
.top-area
.nav-text
2019-09-10 05:25:06 +00:00
- full_count_title = "#{@public_forks_count} public, #{@internal_forks_count} internal, and #{@private_forks_count} private"
2017-01-15 16:20:13 +00:00
#{pluralize(@total_forks_count, 'fork')}: #{full_count_title}
2016-01-12 00:16:29 +00:00
2021-12-06 18:14:09 +00:00
.gl-display-flex.gl-sm-flex-direction-column.gl-md-align-items-center
= form_tag request.original_url, method: :get, class: 'project-filter-form gl-display-flex gl-mt-3 gl-md-mt-0', 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 gl-flex-grow-1',
2016-03-03 12:09:58 +00:00
spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' }
2016-01-12 02:38:31 +00:00
2021-12-06 18:14:09 +00:00
.dropdown.gl-display-inline.gl-md-ml-3.issue-sort-dropdown.gl-mt-3.gl-md-mt-0
.btn-group{ role: 'group' }
.btn-group{ role: 'group' }
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'gl-button btn btn-default' }
= sort_title
= sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3")
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
%li
- excluded_filters = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id]
= sortable_item(sort_title_created_date, page_filter_path(sort: sort_value_recently_created, without: excluded_filters), sort_title)
= sortable_item(sort_title_latest_activity, page_filter_path(sort: sort_value_latest_activity, without: excluded_filters), sort_title)
= forks_sort_direction_button(sort_value)
2016-01-13 17:10:30 +00:00
2016-02-12 00:02:52 +00:00
- if current_user && can?(current_user, :fork_project, @project)
2022-01-18 21:16:02 +00:00
- if current_user.already_forked?(@project) && current_user.forkable_namespaces.size < 2
2021-12-06 18:14:09 +00:00
= link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: _('Go to your fork'), class: 'btn gl-button btn-confirm gl-md-ml-3' do
2018-01-16 15:52:22 +00:00
= sprite_icon('fork', size: 12)
2018-06-14 10:38:14 +00:00
%span= _('Fork')
2016-02-12 00:02:52 +00:00
- else
2021-12-06 18:14:09 +00:00
= link_to new_project_fork_path(@project), title: _("Fork project"), class: 'btn gl-button btn-confirm gl-md-ml-3 gl-mt-3 gl-md-mt-0' do
2018-01-16 15:52:22 +00:00
= sprite_icon('fork', size: 12)
2018-06-14 10:38:14 +00:00
%span= _('Fork')
2016-01-12 02:38:31 +00:00
2016-03-03 12:09:58 +00:00
= render 'projects', projects: @forks