debian-mirror-gitlab/app/views/shared/projects/_list.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
4.8 KiB
Text
Raw Normal View History

2015-09-25 12:07:36 +05:30
- projects_limit = 20 unless local_assigns[:projects_limit]
- avatar = true unless local_assigns[:avatar] == false
2016-04-02 18:10:28 +05:30
- use_creator_avatar = false unless local_assigns[:use_creator_avatar] == true
2015-09-25 12:07:36 +05:30
- stars = true unless local_assigns[:stars] == false
2019-02-15 15:39:39 +05:30
- pipeline_status = true unless local_assigns[:pipeline_status] == false
2015-10-24 18:46:33 +05:30
- skip_namespace = false unless local_assigns[:skip_namespace] == true
2018-03-17 18:26:18 +05:30
- user = local_assigns[:user]
2016-04-02 18:10:28 +05:30
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true
2016-06-02 11:05:42 +05:30
- remote = false unless local_assigns[:remote] == true
2018-12-05 23:21:45 +05:30
- skip_pagination = false unless local_assigns[:skip_pagination] == true
2019-02-15 15:39:39 +05:30
- compact_mode = false unless local_assigns[:compact_mode] == true
- css_classes = "#{'compact' if compact_mode} #{'explore' if explore_projects_tab?}"
2019-03-02 22:35:43 +05:30
- contributed_projects_current_user_empty_message_header = s_('UserProfile|Explore public groups to find projects to contribute to.')
- contributed_projects_visitor_empty_message = s_('UserProfile|This user hasn\'t contributed to any projects')
2023-06-20 00:43:36 +05:30
- starred_projects_illustration_path = 'illustrations/empty-state/empty-projects-starred-md.svg'
2019-10-12 21:52:04 +05:30
- starred_projects_current_user_empty_message_header = s_('UserProfile|Star projects to track their progress and show your appreciation.')
- starred_projects_visitor_empty_message = s_('UserProfile|This user hasn\'t starred any projects')
2023-06-20 00:43:36 +05:30
- own_projects_illustration_path = 'illustrations/empty-state/empty-projects-md.svg'
2019-03-02 22:35:43 +05:30
- own_projects_current_user_empty_message_header = s_('UserProfile|You haven\'t created any personal projects.')
- own_projects_current_user_empty_message_description = s_('UserProfile|Your projects can be available publicly, internally, or privately, at your choice.')
2023-03-17 16:20:25 +05:30
- own_projects_visitor_empty_message = s_('UserProfile|There are no projects available to be displayed here.')
2019-10-12 21:52:04 +05:30
- explore_page_empty_message = s_('UserProfile|Explore public groups to find projects to contribute to.')
- new_project_button_label = _('New project')
- new_project_button_link = new_project_path
- explore_projects_button_label = _('Explore projects')
- explore_projects_button_link = explore_projects_path
- explore_groups_button_label = _('Explore groups')
- explore_groups_button_link = explore_groups_path
2015-09-25 12:07:36 +05:30
2019-12-26 22:10:19 +05:30
.js-projects-list-holder{ data: { qa_selector: 'projects_list' } }
2017-09-10 17:25:29 +05:30
- if any_projects?(projects)
2019-09-30 21:07:59 +05:30
- load_pipeline_status(projects) if pipeline_status
2020-01-01 13:55:28 +05:30
- load_max_project_member_accesses(projects) # Prime cache used in shared/projects/project view rendered below
2023-01-13 00:05:48 +05:30
%ul.projects-list.gl-text-secondary.gl-w-full.gl-my-2{ class: css_classes }
2016-06-02 11:05:42 +05:30
- projects.each_with_index do |project, i|
2017-09-10 17:25:29 +05:30
- css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil
2016-06-02 11:05:42 +05:30
= render "shared/projects/project", project: project, skip_namespace: skip_namespace,
2020-03-13 15:44:24 +05:30
avatar: avatar, stars: stars, css_class: css_class, use_creator_avatar: use_creator_avatar,
2023-04-23 21:23:45 +05:30
forks: able_to_see_forks_count?(project, user), show_last_commit_as_description: show_last_commit_as_description,
2022-06-21 17:19:12 +05:30
user: user, merge_requests: able_to_see_merge_requests?(project, user), issues: able_to_see_issues?(project, user),
2021-04-17 20:07:23 +05:30
pipeline_status: pipeline_status, compact_mode: compact_mode
2018-12-05 23:21:45 +05:30
= paginate_collection(projects, remote: remote) unless skip_pagination
2016-04-02 18:10:28 +05:30
- else
2019-03-02 22:35:43 +05:30
- if @contributed_projects
2023-06-20 00:43:36 +05:30
= render partial: 'shared/empty_states/profile_tabs', locals: { illustration_path: own_projects_illustration_path,
2019-03-02 22:35:43 +05:30
current_user_empty_message_header: contributed_projects_current_user_empty_message_header,
2019-10-12 21:52:04 +05:30
primary_button_label: new_project_button_label,
primary_button_link: new_project_button_link,
secondary_button_label: explore_groups_button_label,
secondary_button_link: explore_groups_button_link,
2019-03-02 22:35:43 +05:30
visitor_empty_message: contributed_projects_visitor_empty_message }
2019-10-12 21:52:04 +05:30
- elsif @starred_projects
= render partial: 'shared/empty_states/profile_tabs', locals: { illustration_path: starred_projects_illustration_path,
current_user_empty_message_header: starred_projects_current_user_empty_message_header,
primary_button_label: explore_projects_button_label,
primary_button_link: explore_projects_button_link,
visitor_empty_message: starred_projects_visitor_empty_message }
2019-03-02 22:35:43 +05:30
- else
= render partial: 'shared/empty_states/profile_tabs', locals: { illustration_path: own_projects_illustration_path,
current_user_empty_message_header: own_projects_current_user_empty_message_header,
current_user_empty_message_description: own_projects_current_user_empty_message_description,
2019-10-12 21:52:04 +05:30
primary_button_label: new_project_button_label,
primary_button_link: new_project_button_link,
visitor_empty_message: defined?(explore_page) && explore_page ? explore_page_empty_message : own_projects_visitor_empty_message }