debian-mirror-gitlab/app/helpers/releases_helper.rb

36 lines
976 B
Ruby
Raw Normal View History

2019-12-04 20:38:33 +05:30
# frozen_string_literal: true
module ReleasesHelper
IMAGE_PATH = 'illustrations/releases.svg'
DOCUMENTATION_PATH = 'user/project/releases/index'
def illustration
image_path(IMAGE_PATH)
end
def help_page
help_page_path(DOCUMENTATION_PATH)
end
def data_for_releases_page
{
project_id: @project.id,
illustration_path: illustration,
2019-12-21 20:55:43 +05:30
documentation_path: help_page
2020-04-08 14:13:33 +05:30
}.tap do |data|
data[:new_release_path] = new_project_tag_path(@project) if can?(current_user, :create_release, @project)
end
2019-12-04 20:38:33 +05:30
end
2019-12-21 20:55:43 +05:30
def data_for_edit_release_page
{
project_id: @project.id,
tag_name: @release.tag,
markdown_preview_path: preview_markdown_path(@project),
markdown_docs_path: help_page_path('user/markdown'),
2019-12-26 22:10:19 +05:30
releases_page_path: project_releases_path(@project, anchor: @release.tag),
update_release_api_docs_path: help_page_path('api/releases/index.md', anchor: 'update-a-release')
2019-12-21 20:55:43 +05:30
}
2019-12-04 20:38:33 +05:30
end
end