diff options
author | Go MAEDA <maeda@farend.jp> | 2023-04-13 04:20:25 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-04-13 04:20:25 +0000 |
commit | 2d7d01e633a30362e665370a081e3e3bad241432 (patch) | |
tree | f8e914bc5af859d347d58080b74a1d424e11534a /app | |
parent | cba427ec251527442a38c977e45d755a1ae21ac7 (diff) | |
download | redmine-2d7d01e633a30362e665370a081e3e3bad241432.tar.gz redmine-2d7d01e633a30362e665370a081e3e3bad241432.zip |
Export a version as changelog text (#36679).
Patch by Mizuki ISHIKAWA.
git-svn-id: https://svn.redmine.org/redmine/trunk@22179 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/versions_controller.rb | 4 | ||||
-rw-r--r-- | app/helpers/versions_helper.rb | 1 | ||||
-rw-r--r-- | app/views/versions/show.html.erb | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index d2beef253..cdec397a8 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -27,6 +27,7 @@ class VersionsController < ApplicationController accept_api_auth :index, :show, :create, :update, :destroy + include VersionsHelper helper :custom_fields helper :projects @@ -73,6 +74,9 @@ class VersionsController < ApplicationController to_a end format.api + format.text do + send_data(version_to_text(@version), type: 'text/plain', filename: "#{@version.name}.txt") + end end end diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb index d613f6d2a..54f553d48 100644 --- a/app/helpers/versions_helper.rb +++ b/app/helpers/versions_helper.rb @@ -18,6 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module VersionsHelper + include Redmine::Export::Text::VersionsTextHelper def version_anchor(version) if @project == version.project diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index 0527eae9c..e17571075 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -56,6 +56,10 @@ <% end %> </div> +<% other_formats_links do |f| %> + <%= f.link_to_with_query_parameters 'TXT' %> +<% end %> + <%= call_hook :view_versions_show_bottom, :version => @version %> <% html_title @version.name %> |