mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 10:05:52 +02:00
Adds a branch for unlimited project hierarchy.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/work@2148 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Sample plugin controller
|
||||
class ExampleController < ApplicationController
|
||||
unloadable
|
||||
|
||||
layout 'base'
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
def say_hello
|
||||
@value = Setting.plugin_sample_plugin['sample_setting']
|
||||
end
|
||||
|
||||
def say_goodbye
|
||||
end
|
||||
|
||||
private
|
||||
def find_project
|
||||
@project=Project.find(params[:id])
|
||||
end
|
||||
end
|
||||
11
nested_projects/extra/sample_plugin/app/models/meeting.rb
Normal file
11
nested_projects/extra/sample_plugin/app/models/meeting.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class Meeting < ActiveRecord::Base
|
||||
belongs_to :project
|
||||
|
||||
acts_as_event :title => Proc.new {|o| "#{o.scheduled_on} Meeting"},
|
||||
:datetime => :scheduled_on,
|
||||
:author => nil,
|
||||
:url => Proc.new {|o| {:controller => 'meetings', :action => 'show', :id => o.id}}
|
||||
|
||||
acts_as_activity_provider :timestamp => 'scheduled_on',
|
||||
:find_options => { :include => :project }
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
<p class="icon icon-example-works"><%= l(:text_say_goodbye) %></p>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag "example.css", :plugin => "sample_plugin", :media => "screen" %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,9 @@
|
||||
<p class="icon icon-example-works"><%= l(:text_say_hello) %></p>
|
||||
|
||||
<p><label>Example setting</label>: <%= @value %></p>
|
||||
|
||||
<%= link_to_if_authorized 'Good bye', :action => 'say_goodbye', :id => @project %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag "example.css", :plugin => "sample_plugin", :media => "screen" %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,3 @@
|
||||
<p><label>Example setting</label><%= text_field_tag 'settings[sample_setting]', @settings['sample_setting'] %></p>
|
||||
|
||||
<p><label>Foo</label><%= text_field_tag 'settings[foo]', @settings['foo'] %></p>
|
||||
Reference in New Issue
Block a user