Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

first commit

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

0 comments on commit 60e54fd

Please sign in to comment.
Something went wrong with that request. Please try again.