summaryrefslogtreecommitdiff
path: root/app/views/projects/_home_panel.html.haml
blob: 89582d2e3ba50fce2837d0a11fd53de5f6c8128c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- empty_repo = @project.empty_repo?
.project-home-panel{:class => ("empty-project" if empty_repo)}
  .project-identicon-holder
    = project_icon(@project, alt: '', class: 'avatar project-avatar')
  .project-home-row.project-home-row-top
    .project-home-desc
      - if @project.description.present?
        = escaped_autolink(@project.description)
      - if can?(current_user, :admin_project, @project)
        –
        = link_to 'Edit', edit_namespace_project_path
      - elsif !@project.empty_repo? && @repository.readme
        - readme = @repository.readme
        –
        = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do
          = readme.name
    .project-repo-buttons
      .inline.star.js-toggler-container{class: @show_star ? 'on' : ''}
        - if current_user
          = link_to_toggle_star('Star this project.', false)
          = link_to_toggle_star('Unstar this project.', true)
        - else
          = link_to new_user_session_path, class: 'btn star-btn has_tooltip', title: 'You must sign in to star a project' do
            %span
              = icon('star')
              Star
            %span.count
              = @project.star_count
      - unless @project.empty_repo?
        - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace
          .inline.fork-buttons.prepend-left-10
            - 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-sm btn-default' do
                = link_to_toggle_fork
            - else
              = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-sm btn-default' do
                = link_to_toggle_fork
%hr