Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
20
extra/sample_plugin/app/controllers/example_controller.rb
Normal file
20
extra/sample_plugin/app/controllers/example_controller.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Sample plugin controller
|
||||
class ExampleController < ApplicationController
|
||||
unloadable
|
||||
|
||||
layout 'base'
|
||||
before_action :find_project, :authorize
|
||||
menu_item :sample_plugin
|
||||
|
||||
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
|
12
extra/sample_plugin/app/models/meeting.rb
Normal file
12
extra/sample_plugin/app/models/meeting.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
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',
|
||||
:scope => includes(:project),
|
||||
:permission => nil
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
<h2>Good Bye</h2>
|
||||
|
||||
<p class="icon icon-example-works"><%= l(:text_say_goodbye) %></p>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag 'example', :plugin => 'sample_plugin', :media => "screen" %>
|
||||
<% end %>
|
15
extra/sample_plugin/app/views/example/say_hello.html.erb
Normal file
15
extra/sample_plugin/app/views/example/say_hello.html.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
<h2>Hello</h2>
|
||||
|
||||
<p class="icon icon-example-works"><%= l(:text_say_hello) %></p>
|
||||
|
||||
<p><label>Example setting</label>: <%= @value %></p>
|
||||
|
||||
<%= link_to('Good bye', :action => 'say_goodbye', :id => @project) if User.current.allowed_to?(:example_say_goodbye, @project) %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<p>Adding content to the sidebar...</p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag 'example', :plugin => 'sample_plugin', :media => "screen" %>
|
||||
<% end %>
|
|
@ -0,0 +1,3 @@
|
|||
<h3>Sample block</h3>
|
||||
|
||||
You are <strong><%= h(User.current) %></strong> and this is a sample block for My Page added from a plugin.
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue