Add 'Landing page' field to project form and db
This commit is contained in:
parent
ea7a166835
commit
5dfaf0c641
2
app/views/projects/_landing_page.html.erb
Normal file
2
app/views/projects/_landing_page.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<p><%= label_tag('project[landing_page]', l(:label_landing_page)) %>
|
||||||
|
<%= text_field_tag 'project[landing_page]', nil, :size => 60, :placeholder => 'http://localhost/projects/demo/wiki/Wiki' %></p>
|
@ -1,3 +1,3 @@
|
|||||||
# English strings go here for Rails i18n
|
# English strings go here for Rails i18n
|
||||||
en:
|
en:
|
||||||
my_label: "My label"
|
label_landing_page: "Landing page"
|
||||||
|
9
db/migrate/001_add_landing_page_to_projects.rb
Normal file
9
db/migrate/001_add_landing_page_to_projects.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class AddLandingPageToProjects < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
add_column :projects, :landing_page, :string
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
remove_column :projects, :landing_page
|
||||||
|
end
|
||||||
|
end
|
10
init.rb
10
init.rb
@ -2,9 +2,11 @@ require 'redmine'
|
|||||||
|
|
||||||
Redmine::Plugin.register :redmine_landing_page do
|
Redmine::Plugin.register :redmine_landing_page do
|
||||||
name 'Redmine Landing Page plugin'
|
name 'Redmine Landing Page plugin'
|
||||||
author 'Author name'
|
author 'Igor Zubkov'
|
||||||
description 'This is a plugin for Redmine'
|
description 'Redmine Landing Page plugin'
|
||||||
version '0.0.1'
|
version '0.0.1'
|
||||||
url 'http://example.com/path/to/plugin'
|
url 'https://github.com/biow0lf/redmine_landing_page'
|
||||||
author_url 'http://example.com/about'
|
author_url 'https://github.com/biow0lf'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require 'redmine_landing_page/hooks/view_projects_form_hook'
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
module RedmineLandingPage
|
||||||
|
module Hooks
|
||||||
|
class ViewProjectsFormHook < Redmine::Hook::ViewListener
|
||||||
|
render_on(:view_projects_form, :partial => 'projects/landing_page', :layout => false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user