Commit a4d75e3a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add ability to edit and show release notes

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ba67af79
......@@ -39,6 +39,9 @@ class Dispatcher
shortcut_handler = new ShortcutsNavigation()
new DropzoneInput($('.merge-request-form'))
new IssuableForm($('.merge-request-form'))
when 'projects:releases:edit'
new ZenMode()
new DropzoneInput($('.release-form'))
when 'projects:merge_requests:show'
new Diff()
shortcut_handler = new ShortcutsIssuable()
......
......@@ -16,6 +16,7 @@
.append-bottom-10 { margin-bottom:10px }
.append-bottom-15 { margin-bottom:15px }
.append-bottom-20 { margin-bottom:20px }
.append-bottom-default { margin-bottom: $gl-padding; }
.inline { display: inline-block }
.center { text-align: center }
......
......@@ -7,6 +7,7 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :release
def show
@commit = @repository.commit(@tag.target)
end
def edit
......
......@@ -32,7 +32,7 @@
Files
- if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories tags branches)) do
= nav_link(controller: %w(commit commits compare repositories tags branches releases)) do
= link_to project_commits_path(@project), title: 'Commits', class: 'shortcuts-commits', data: {placement: 'right'} do
= icon('history fw')
%span
......
......@@ -12,7 +12,7 @@
Branches
%span.badge.js-totalbranch-count= @repository.branches.size
= nav_link(controller: :tags) do
= nav_link(controller: [:tags, :releases]) do
= link_to namespace_project_tags_path(@project.namespace, @project) do
Tags
%span.badge.js-totaltags-count= @repository.tags.length
= form_for(@release, method: :put, url: namespace_project_tag_release_path(@project.namespace, @project, @tag.name), html: { class: 'form-horizontal gfm-form' }) do |f|
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
= render 'projects/zen', f: f, attr: :description, classes: 'js-quick-submit'
= render 'projects/notes/hints'
.error-alert
= f.submit 'Save changes', class: 'btn btn-save'
= render "projects/commits/header_title"
= render "projects/commits/head"
.gray-content-block
.oneline
Release notes for #{@tag.name}
.prepend-top-default
= form_for(@release, method: :put, url: namespace_project_tag_release_path(@project.namespace, @project, @tag.name), html: { class: 'form-horizontal gfm-form release-form' }) do |f|
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
= render 'projects/zen', f: f, attr: :description, classes: 'description js-quick-submit'
= render 'projects/notes/hints'
.error-alert
.prepend-top-default
= f.submit 'Save changes', class: 'btn btn-save'
- if @release.persisted?
= link_to "Cancel", namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: "btn btn-default btn-cancel"
= debug @release
- page_title @release.tag, "Releases"
= render "projects/commits/header_title"
= render "projects/commits/head"
.gray-content-block
.pull-right
= link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn-grouped btn' do
= icon("pencil")
.oneline Release notes for #{@tag.name}
.append-bottom-default.prepend-top-default
- if @release.description.present?
.description
.wiki
= preserve do
= markdown @release.description
- else
This tag has no release notes yet. Press edit button to add one
.gray-content-block.middle-block.clearfix
= link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped' do
Browse code
= link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped' do
Commits
- if can? current_user, :download_code, @project
= render 'projects/repositories/download_archive', ref: @tag.name, btn_class: 'btn-grouped'
-#- if can?(current_user, :admin_project, @project)
= link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped', method: :delete, data: { confirm: 'Removed tag cannot be restored. Are you sure?'}, remote: true do
%i.fa.fa-trash-o
.gray-content-block.second-block
- if @commit
= render 'projects/commits/commit', commit: @commit, project: @project
- else
Cant find HEAD commit for this tag
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment