File: _readme.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (37 lines) | stat: -rw-r--r-- 1,968 bytes parent folder | download
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
- ref = local_assigns.fetch(:ref) { current_ref }
- project = local_assigns.fetch(:project) { @project }
- add_page_specific_style 'page_bundles/projects'
- unless @ref.blank? ||  @repository&.root_ref == @ref
  - compare_path = project_compare_index_path(@project, from:  @repository&.root_ref, to: @ref)

- if (readme = @repository.readme) && readme.rich_viewer
  .tree-holder.gl-mt-5
    - if params[:common_repository_blob_header_app] == 'true'
      #js-repository-blob-header-app{ data: { project_id: @project.id, ref: ref, ref_type: @ref_type.to_s, history_link: project_commits_path(@project, @ref), breadcrumbs: breadcrumb_data_attributes, project_root_path: project_path(@project), project_path: project.full_path, compare_path: compare_path, escaped_ref: ActionDispatch::Journey::Router::Utils.escape_path(ref) } }

    - else
      .nav-block.mt-0
        = render 'projects/tree/tree_header', tree: @tree
  %article.file-holder.readme-holder{ id: 'readme', class: ("limited-width-container" unless fluid_layout) }
    .js-file-title.file-title-flex-parent
      .file-header-content
        = blob_icon readme.mode, readme.name
        = link_to project_blob_path(@project, tree_join(@ref, readme.path)) do
          %strong
            = readme.name
    = render 'projects/blob/viewer', viewer: readme.rich_viewer, viewer_url: namespace_project_blob_path(@project.namespace, @project, tree_join(@ref, readme.path), viewer: :rich, format: :json)

- else
  .row-content-block.second-block.center
    %h4
      This project does not have a README yet

    - if can?(current_user, :push_code, @project)
      %p
        A
        %code README
        file contains information about other files in a repository and is commonly
        distributed with computer software, forming part of its documentation.
        GitLab will render it here instead of this message.
      %p
        = link_button_to "Add Readme", @project.add_readme_path, variant: :confirm