Commit 6b359969 authored by Francisco Juan's avatar Francisco Juan

Added all plugins required in ohwr.org

parent 8884f43b
Copyright (C) 2011 by Splendeo Innovación
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
== Redmine/Chiliproject Featured Projects Plugin
This plugin allows the redmine/chiliproject administrator to mark any project he wants as "featured" (notice that this is an "admin" right, not a project administrator right).
It also changes the redmine home page to show a "featured projects" box. This box replaces the default "Latest projects" box.
Finally, it adds two named scopes to Project: Project.featured and Project.not_featured
This plugin can be used in consonance with our Redmine Project Filtering plugin ( https://github.com/splendeo/redmine_project_filtering )
== Installation
1. Copy the plugin directory into the vendor/plugins directory
2. Migrate plugin:
rake db:migrate_plugins
3. Start Redmine
Installed plugins are listed and can be configured from 'Admin -> Plugins' screen.
== Credits
Development of this plugin was financed by the Open Hardware Repository - www.ohwr.org
<% content_for :header_tags do %>
<%= stylesheet_link_tag "featured_projects.css", :plugin => "featured_projects" %>
<% end %>
<% if User.current.allowed_to?(:update_featured_project_flags, nil, :global => true) %>
<p><%= form.check_box :is_featured %></p>
<% elsif project.is_featured? %>
<p><span class="icon icon-featured"><%= t('label_project_featured') %></span></p>
<% end %>
<h2><%= l(:label_home) %></h2>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "featured_projects.css", :plugin => "featured_projects", :media => "screen" %>
<% end %>
<div class="splitcontentleft">
<div class="wiki"><%= textilizable Setting.welcome_text %></div>
<% if @news.any? %>
<div class="news box">
<h3><%=l(:label_news_latest)%></h3>
<%= render :partial => 'news/news', :collection => @news %>
<%= link_to l(:label_news_view_all), :controller => 'news' %>
</div>
<% end %>
<%= call_hook(:view_welcome_index_left, :projects => @projects) %>
</div>
<div class="splitcontentright">
<% if @projects.any? %>
<div class="box">
<h3 class="icon icon-featured"><%=l(:label_featured_projects)%></h3>
<ul>
<% for project in @projects %>
<% @project = project %>
<li>
<%= link_to_project project %> (<%= format_time(project.created_on) %>)
<%= textilizable project.short_description, :project => project %>
</li>
<% end %>
<% @project = nil %>
</ul>
</div>
<% end %>
<%= call_hook(:view_welcome_index_right, :projects => @projects) %>
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'news', :action => 'index', :key => User.current.rss_key, :format => 'atom'},
:title => "#{Setting.app_title}: #{l(:label_news_latest)}") %>
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :key => User.current.rss_key, :format => 'atom'},
:title => "#{Setting.app_title}: #{l(:label_activity)}") %>
<% end %>
.icon-featured { background-image: url(../images/ribbon-16x16.png); }
# featured projects
en:
field_is_featured: Featured Project
label_featured_projects: Featured Projects
label_project_featured: This project is featured
# Sample plugin migration
# Use rake db:migrate_plugins to migrate installed plugins
class AddIsFeaturedToProjects < ActiveRecord::Migration
def self.up
add_column :projects, :is_featured, :boolean, :default => false, :null => false
end
def self.down
remove_column :accounts, :is_featured
end
end
# Redmine sample plugin
require 'redmine'
require 'dispatcher'
Dispatcher.to_prepare :featured_projects do
require_dependency 'featured_projects/hooks'
require_dependency 'project'
Project.send(:include, FeaturedProjects::Patches::ProjectPatch)
require_dependency 'welcome_controller'
unless WelcomeController.included_modules.include? FeaturedProjects::Patches::WelcomeControllerPatch
WelcomeController.send(:include, FeaturedProjects::Patches::WelcomeControllerPatch)
end
end
Redmine::Plugin.register :featured_projects do
name 'Featured Projects'
author 'Enrique García'
description 'Redmine featured projects'
version '0.0.1'
end
module FeaturedProjects
class Hooks < Redmine::Hook::ViewListener
# :project
# :form
render_on :view_projects_form, :partial => 'hooks/projects/featured_project_fields'
end
end
module FeaturedProjects
module Patches
module ProjectPatch
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
safe_attributes 'is_featured',
:if => lambda {|project, user| user.allowed_to?(:update_featured_project_flags, nil, :global => true) }
named_scope :featured, {:conditions => {:is_featured => true}}
named_scope :not_featured, { :conditions => ["#{Project.table_name}.is_featured <> :true", {:true => true}] }
end
end
module ClassMethods
end
module InstanceMethods
end
end
end
end
module FeaturedProjects
module Patches
module WelcomeControllerPatch
def self.included(base)
base.class_eval do
unloadable # Send unloadable so it will not be unloaded in development
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :index, :featured_projects
end
end
end
module InstanceMethods
def index_with_featured_projects
index_without_featured_projects
@projects = Project.visible.featured.all(:order => 'name ASC')
end
end
end
end
end
Redmine Piwik is a Redmine plugin to insert the Piwik
tracking code into Redmine based on user roles.
Copyright (C) 2009 Jörg Winter, B-Net1 Developments
Copyright (C) 2008 Eric Davis, Little Stream Software
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.
Thanks go to the following people for patches and contributions:
Maintainers
* Eric Davis of Little Stream Software
Contributors
* Gergő Jónás
This diff is collapsed.
= Redmine Piwik Plugins
Redmine plugin to insert the Piwik tracking code into Redmine based on user roles.
== Features
Adds your Piwik code to every pageview depending on your User roles; Anonymous user, Authenticated User, and Administrator.
== Installation and Setup
1. Download the plugin. There are three supported ways:
* Downloading the latest archive file from B-Net1 Developments projects (http://projekte.dev.b-net1.de/projects/bn1redminepiwik/files)
* Checkout the source from Subversion
svn co http://svn.dev.b-net1.de/bn1redminepiwik/trunk/piwik_plugin
* Install it using Rail's plugin installer
script/plugin install http://svn.dev.b-net1.de/bn1redminepiwik/trunk/piwik_plugin
2. Login to your Redmine install as an Administrator.
3. Configure your settings in Administration > Information > Configure
== License
This plugin is licensed under the GNU GPL v2. See COPYRIGHT.txt and GPL.txt for details.
== Project help
If you need help you can contact the maintainer at the Bug Tracker. The bug tracker is located at https://projekte.dev.b-net1.de/projects/bn1redminepiwik/issues
#!/usr/bin/env ruby
require 'redmine_plugin_support'
Dir[File.expand_path(File.dirname(__FILE__)) + "/lib/tasks/**/*.rake"].sort.each { |ext| load ext }
RedminePluginSupport::Base.setup do |plugin|
plugin.project_name = 'piwik_plugin'
plugin.default_task = [:spec]
end
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "piwik_plugin"
s.summary = "Redmine plugin to insert the Piwik tracking code into Redmine based on user roles."
s.email = "winter@b-net1.de"
s.homepage = "http://projekte.dev.b-net1.de/projects/bn1redminepiwik"
s.description = "Redmine plugin to insert the Piwik tracking code into Redmine based on user roles."
s.authors = ["Jörg Winter, Eric Davis"]
s.rubyforge_project = "piwik_plugin" # TODO
s.files = FileList[
"[A-Z]*",
"init.rb",
"rails/init.rb",
"{bin,generators,lib,test,app,assets,config,lang}/**/*",
'lib/jeweler/templates/.gitignore'
]
end
Jeweler::GemcutterTasks.new
Jeweler::RubyforgeTasks.new do |rubyforge|
rubyforge.doc_task = "rdoc"
end
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
<p>
<%= l(:piwik_directions) %>
</p>
<p>
<label><%= l(:piwik_log_url_label) %></label><%= text_field_tag 'settings[piwik_log_url]', @settings['piwik_log_url'] %>
</p>
<p>
<label><%= l(:piwik_log_id_label) %></label><%= text_field_tag 'settings[piwik_log_id]', @settings['piwik_log_id'], :size => 4, :maxlength => 5 %>
</p>
<p>
<label><%= l(:piwik_log_anonymous_label) %></label><%= check_box_tag 'settings[piwik_log_anonymous]', '1', @settings['piwik_log_anonymous'] %>
</p>
<p>
<label><%= l(:piwik_log_authenticated_label) %></label><%= check_box_tag 'settings[piwik_log_authenticated]', '1', @settings['piwik_log_authenticated'] %>
</p>
<p>
<label><%= l(:piwik_log_administrator_label) %></label><%= check_box_tag 'settings[piwik_log_administrator]', '1', @settings['piwik_log_administrator'] %>
</p>
de:
piwik_directions: Gib die URL deiner <a href="http://www.piwik.org">Piwik</a>-Installation ein, ebenso die Piwik-ID deiner Website <br />und wähle deine Log-Optionen.
piwik_log_url_label: URL der Piwik Installation
piwik_log_id_label: ID der Piwik Website
piwik_log_anonymous_label: Logge anonyme Benutzer
piwik_log_authenticated_label: Logge authentifizierte Benutzer
piwik_log_administrator_label: Logge Administratoren
en:
piwik_directions: Enter the URL of your <a href="http://www.piwik.org">Piwik</a> installation, the Piwik-ID of your Website <br />and choose your logging options.
piwik_log_url_label: URL of the Piwik installation
piwik_log_id_label: ID of the Piwik Website
piwik_log_anonymous_label: Log anonymous users
piwik_log_authenticated_label: Log authenticated user
piwik_log_administrator_label: Log administrator users
require File.dirname(__FILE__) + "/rails/init"
# German strings go here
piwik_directions: Gib die URL deiner <a href="http://www.piwik.org">Piwik</a>-Installation ein, ebenso die Piwik-ID deiner Website <br />und wähle deine Log-Optionen.
piwik_log_url_label: URL der Piwik Installation
piwik_log_id_label: ID der Piwik Website
piwik_log_anonymous_label: Logge anonyme Benutzer
piwik_log_authenticated_label: Logge authentifizierte Benutzer
piwik_log_administrator_label: Logge Administratoren
# English strings go here
piwik_directions: Enter the URL of your <a href="http://www.piwik.org">Piwik</a> installation, the Piwik-ID of your Website <br />and choose your logging options.
piwik_log_url_label: URL of the Piwik installation
piwik_log_id_label: ID of the Piwik Website
piwik_log_anonymous_label: Log anonymous users
piwik_log_authenticated_label: Log authenticated user
piwik_log_administrator_label: Log administrator users
# This class hooks into Redmine's View Listeners in order to
# add content to the page
class PiwikHooks < Redmine::Hook::ViewListener
# Adds the Piwik code to the layout if the current user meets
# the conditions setup by the System Administrator
def view_layouts_base_body_bottom(context = { })
log_anon = Setting.plugin_piwik_plugin['piwik_log_anonymous']
log_auth = Setting.plugin_piwik_plugin['piwik_log_authenticated']
log_admin = Setting.plugin_piwik_plugin['piwik_log_administrator']
log_url = Setting.plugin_piwik_plugin['piwik_log_url']
log_id = Setting.plugin_piwik_plugin['piwik_log_id']
if (!log_url.nil? && !log_id.nil?)
if (context[:request].env['HTTPS'] == 'on')
log_url = log_url.gsub(/http:|https:/, 'https:')
else
log_url = log_url.gsub(/http:|https:/, 'http:')
end
if (User.current.anonymous? && log_anon) || # Anon user
(User.current.logged? && log_auth && !User.current.admin?) || # Auth users who are not admins
(User.current.admin? && log_admin) # Admin user
output = "<!-- Piwik -->
<script type=\"text/javascript\" src=\"#{log_url}piwik.js\"></script>
<script type=\"text/javascript\">
try {
var piwikTracker = Piwik.getTracker(\"#{log_url}piwik.php\", #{log_id});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src=\"#{log_url}piwik.php?idsite=#{log_id}\" style=\"border:0\" alt=\"\"/></p></noscript>
<!-- End Piwik Tag -->"
return output
else
return ''
end
else
return ''
end
end
end
# Generated by jeweler
# DO NOT EDIT THIS FILE
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{piwik_plugin}
s.version = "0.1.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jörg Winter, Eric Davis"]
s.date = %q{2009-10-17}
s.description = %q{Redmine plugin to insert the Piwik tracking code into Redmine based on user roles.}
s.email = %q{winter@b-net1.de}
s.extra_rdoc_files = [
"README.rdoc"
]
s.files = [
"COPYRIGHT.txt",
"CREDITS.txt",
"GPL.txt",
"README.rdoc",
"Rakefile",
"VERSION",
"app/views/settings/_piwik_settings.rhtml",
"config/locales/de.yml",
"config/locales/en.yml",
"config/locales/hu.yml",
"config/locales/it.yml",
"init.rb",
"lang/de.yml",
"lang/en.yml",
"lang/hu.yml",
"lang/it.yml",
"lib/piwik_hooks.rb",
"rails/init.rb",
"test/test_helper.rb"
]
s.homepage = %q{http://projekte.dev.b-net1.de/projects/bn1redminepiwik}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{piwik_plugin}
s.rubygems_version = %q{1.3.5}
s.summary = %q{Redmine plugin to insert the Piwik tracking code into Redmine based on user roles.}
s.test_files = [
"test/test_helper.rb"
]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end
require 'redmine'
require_dependency 'piwik_hooks'
Redmine::Plugin.register :piwik_plugin do
name 'Piwik plugin'
author 'Jörg Winter'
description 'Redmine plugin to insert the Piwik tracking code into Redmine based on user roles.'
url 'http://projekte.dev.b-net1.de/projects/bn1redminepiwik'
author_url 'http://www.b-net1.de'
version '0.1.1'
requires_redmine :version_or_higher => '0.8.0'
settings :default => {
'piwik_log_url' => '',
'piwik_log_id' => '',
'piwik_log_anonymous' => true,
'piwik_log_authenticated' => true,
'piwik_log_administrator' => true
}, :partial => 'settings/piwik_settings'
end
# 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
This Redmine plugin adds the environment name as class to the body of every HTML page.
\ No newline at end of file
require 'redmine'
require 'patches/application_helper_patch'
Redmine::Plugin.register :redmine_polls do
name 'Environmnet CSS'
author 'Francisco de Juan'
url 'http://development.splendeo.es/projects/redm-environment-css'
author_url 'http://www.splendeo.es'
description 'A plugin for adding the environment name as class to the body of every HTML page'
version '0.1'
end
require_dependency 'application_helper'
module ApplicationHelperPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :body_css_classes, :environment
end
end
module InstanceMethods
def body_css_classes_with_environment
"#{body_css_classes_without_environment} environment-#{Rails.env}"
end
end
end
ApplicationHelper.send(:include, ApplicationHelperPatch)
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<loadpath>
<pathentry path="" type="src"/>
<pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/>
</loadpath>