Add 'Landing page' field to project form and db

This commit is contained in:
Igor Zubkov 2011-12-20 16:22:24 +02:00
parent ea7a166835
commit 5dfaf0c641
5 changed files with 25 additions and 5 deletions

View 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>

View File

@ -1,3 +1,3 @@
# English strings go here for Rails i18n
en:
my_label: "My label"
label_landing_page: "Landing page"

View 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
View File

@ -2,9 +2,11 @@ require 'redmine'
Redmine::Plugin.register :redmine_landing_page do
name 'Redmine Landing Page plugin'
author 'Author name'
description 'This is a plugin for Redmine'
author 'Igor Zubkov'
description 'Redmine Landing Page plugin'
version '0.0.1'
url 'http://example.com/path/to/plugin'
author_url 'http://example.com/about'
url 'https://github.com/biow0lf/redmine_landing_page'
author_url 'https://github.com/biow0lf'
end
require 'redmine_landing_page/hooks/view_projects_form_hook'

View File

@ -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