Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 60e54fd82581b5e9f72f7c92fa68e3f8c271006f 0 parents
zouchaoqun authored
31 README.rdoc
@@ -0,0 +1,31 @@
+=== ezSidebar Plugin 0.1.0
+
+This is a plugin to make it easy to add content(like google ads) to redmine' right sidebar.
+ONLY compatible with Redmine 0.9 or last devel.
+Maybe compatible with Redmine 0.8.4 but not tested.
+
+=== Plugin installation
+
+1. Copy the plugin directory(redmine_ezsidebar) into the vendor/plugins directory
+ NOTE: The plugin directory must be redmine_ezsidebar!
+
+2. Start Redmine
+
+Installed plugins are listed on 'Admin -> Plugin' screen.
+
+=== Usage
+
+1. Input content's html code you want to display in sidebar in plugin's setting page.
+
+2. Now the content will be displayed in every page's sidebar.
+
+=== Roadmap
+
+1. Able to choose projects and modules where to add the content.
+
+2. Able to input distinct content for different projects.
+
+=== Contact info
+
+Homepage -> http://ezwork.techcon.thtf.com.cn/projects/ezwork powered by redmine
+Email -> zouchaoqun@gmail.com
4 app/views/settings/_settings.html.erb
@@ -0,0 +1,4 @@
+<p>
+ <label><%= l(:label_sidebar_content) %></label>
+ <%= text_area_tag 'settings[sidebar_content]', @settings['sidebar_content'], :rows => 10, :cols => 80 %>
+</p>
2  config/locales/en.yml
@@ -0,0 +1,2 @@
+en:
+ label_sidebar_content: "Sidebar Content(HTML)"
2  config/locales/zh.yml
@@ -0,0 +1,2 @@
+zh:
+ label_sidebar_content: "边栏内容(HTML)"
33 init.rb
@@ -0,0 +1,33 @@
+# ezSidebar plugin for redMine
+# Copyright (C) 2008-2009 Zou Chaoqun
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require 'redmine'
+
+# Hooks
+require_dependency 'ezsidebar_layouts_hook'
+
+Redmine::Plugin.register :redmine_ezsidebar do
+ name 'Redmine ezSidebar plugin'
+ author 'Zou Chaoqun'
+ description 'This is a plugin for Redmine to make easy to insert content to its sidebar'
+ version '0.1.0'
+ url 'http://ezwork.techcon.thtf.com.cn/projects/ezwork'
+ author_url 'mailto:zouchaoqun@gmail.com'
+ settings :default => {'sidebar_content' => '[input html code here]'}, :partial => 'settings/settings'
+
+
+end
2  lang/en.yml
@@ -0,0 +1,2 @@
+en:
+ label_sidebar_content: "Sidebar Content(HTML)"
2  lang/zh.yml
@@ -0,0 +1,2 @@
+zh:
+ label_sidebar_content: "边栏内容(HTML)"
10 lib/ezsidebar_layouts_hook.rb
@@ -0,0 +1,10 @@
+# Hooks to attach to the Redmine base layouts(for right sidebar).
+class EzsidebarLayoutHook < Redmine::Hook::ViewListener
+
+ def view_layouts_base_sidebar(context = { })
+ if !Setting.plugin_redmine_ezsidebar['sidebar_content'].empty?
+ "<p>#{Setting.plugin_redmine_ezsidebar['sidebar_content']}</p>"
+ end
+ end
+
+end
5 test/test_helper.rb
@@ -0,0 +1,5 @@
+# Load the normal Rails helper
+require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
+
+# Ensure that we are using the temporary fixture path
+Engines::Testing.set_fixture_path
Please sign in to comment.
Something went wrong with that request. Please try again.