redmine-custom_startpage 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +8 -0
- data/app/views/settings/_custom_startpage_settings.html.erb +23 -0
- data/config/locales/en.yml +9 -0
- data/lib/custom_startpage/engine.rb +10 -0
- data/lib/custom_startpage/infos.rb +12 -0
- data/lib/custom_startpage/patches.rb +17 -0
- data/lib/custom_startpage/patches/welcome_controller_patch.rb +40 -0
- data/lib/custom_startpage/redmine_plugin.rb +42 -0
- data/lib/custom_startpage/version.rb +3 -0
- data/lib/redmine-custom_startpage.rb +7 -0
- data/redmine-custom_startpage.gemspec +27 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4b957dcdcc8987f95fba2c171afd8f6d1e81909f
|
4
|
+
data.tar.gz: a5a23fa428b9830b7eb8c36b3ac25682166e4d07
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4459c970edd7ab2a03a13228e2bbdc1228697a30da2d15e2ec4fc2190bd3cf551af6ea5bd1b3941148f5b8dda169d2d37f467d7b70cb3c1ed630e239c4d6b45a
|
7
|
+
data.tar.gz: eda6b7c6970229d74dc265caa9029eedb6c3a3bafc68a267c5236f462cdc88d1c5722248eb267d7262ab0ed5179ffa7a4eac189144e902f91f782797f81812fb
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Jonas Thiel
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# redmine-custom_startpage
|
2
|
+
|
3
|
+
Allows the user to select almost any Redmine page as the initial start page after login.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Ensure you have a `Gemfile.local` file in your Redmine installation. Add to your `Gemfile.local`:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "redmine-custom_startpage"
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Restart the Redmine application
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
No further steps needed. You can configure the plugin using Redmine's native plugin
|
24
|
+
configuration page.
|
25
|
+
|
26
|
+
## Contributing
|
27
|
+
|
28
|
+
1. Fork it ( https://github.com/[my-github-username]/redmine-custom_startpage/fork )
|
29
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
30
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
31
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
32
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
<p>
|
2
|
+
<%= label_tag :settings_active, l(:custom_startpage_settings_active) %>
|
3
|
+
<%= check_box_tag "settings[active]", 1, @settings["active"] %>
|
4
|
+
<span class="hint"><%= l(:custom_startpage_settings_active_hint) %></span>
|
5
|
+
</p>
|
6
|
+
|
7
|
+
<p>
|
8
|
+
<%= label_tag :settings_controller, l(:custom_startpage_settings_controller) %>
|
9
|
+
<%= text_field_tag "settings[controller]", @settings["controller"] %>
|
10
|
+
<span class="hint"><%= l(:custom_startpage_settings_controller_hint) %></span>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<%= label_tag :settings_action, l(:custom_startpage_settings_action) %>
|
15
|
+
<%= text_field_tag "settings[action]", @settings["action"] %>
|
16
|
+
<span class="hint"><%= l(:custom_startpage_settings_action_hint) %></span>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<p>
|
20
|
+
<%= label_tag :settings_id, l(:custom_startpage_settings_id) %>
|
21
|
+
<%= text_field_tag "settings[id]", @settings["id"] %>
|
22
|
+
<span class="hint"><%= l(:custom_startpage_settings_id_hint) %></span>
|
23
|
+
</p>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
en:
|
2
|
+
custom_startpage_settings_active: "Active?"
|
3
|
+
custom_startpage_settings_active_hint: "Enable to use a custom start page"
|
4
|
+
custom_startpage_settings_controller: "Controller"
|
5
|
+
custom_startpage_settings_controller_hint: "to use for redirection"
|
6
|
+
custom_startpage_settings_action: "Action"
|
7
|
+
custom_startpage_settings_action_hint: "to use for redirection"
|
8
|
+
custom_startpage_settings_id: "ID"
|
9
|
+
custom_startpage_settings_id_hint: "to use for redirection"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module CustomStartpage
|
2
|
+
module Infos
|
3
|
+
NAME = "redmine-custom_startpage"
|
4
|
+
DESCRIPTION = "Allows the user to select almost any Redmine page as" \
|
5
|
+
" the initial start page after login"
|
6
|
+
LICENSE = "MIT"
|
7
|
+
URL = "https://github.com/neopoly/redmine-custom_startpage"
|
8
|
+
AUTHORS = {
|
9
|
+
"Jonas Thiel" => "jt@neopoly.de"
|
10
|
+
}.freeze
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "custom_startpage/patches/welcome_controller_patch"
|
2
|
+
|
3
|
+
module CustomStartpage
|
4
|
+
# This module holds all patches of a default Redmine application
|
5
|
+
module Patches
|
6
|
+
# Apply all patches
|
7
|
+
def self.apply!
|
8
|
+
apply_to(::WelcomeController, WelcomeControllerPatch)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def self.apply_to(target, mod)
|
14
|
+
target.send(:include, mod)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module CustomStartpage
|
2
|
+
module Patches
|
3
|
+
module WelcomeControllerPatch
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
before_filter :redirect_to_startpage, only: :index
|
8
|
+
end
|
9
|
+
|
10
|
+
def redirect_to_startpage
|
11
|
+
return unless startpage_active?
|
12
|
+
|
13
|
+
redirect_to(redirection_options)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def startpage_active?
|
19
|
+
from_settings("active") && from_settings("controller")
|
20
|
+
end
|
21
|
+
|
22
|
+
def redirection_options
|
23
|
+
{
|
24
|
+
controller: from_settings("controller"),
|
25
|
+
action: from_settings("action"),
|
26
|
+
id: from_settings("id")
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def from_settings(key)
|
31
|
+
return unless settings[key].present?
|
32
|
+
settings[key]
|
33
|
+
end
|
34
|
+
|
35
|
+
def settings
|
36
|
+
Setting.plugin_custom_startpage
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "custom_startpage/patches"
|
2
|
+
|
3
|
+
module CustomStartpage
|
4
|
+
# Registers this gems a Redmine plugin and applies the needed patches
|
5
|
+
class RedminePlugin
|
6
|
+
include CustomStartpage::Infos
|
7
|
+
|
8
|
+
DEFAULT_SETTINGS = {
|
9
|
+
"active" => false,
|
10
|
+
"controller" => "",
|
11
|
+
"action" => "",
|
12
|
+
"id" => ""
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
SETTING_PARTIAL = "settings/custom_startpage_settings"
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
register!
|
19
|
+
boot!
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def register!
|
25
|
+
Redmine::Plugin.register :custom_startpage do
|
26
|
+
name NAME
|
27
|
+
author AUTHORS.keys.join(", ")
|
28
|
+
description DESCRIPTION
|
29
|
+
version VERSION
|
30
|
+
url URL
|
31
|
+
author_url URL
|
32
|
+
directory Engine.root
|
33
|
+
|
34
|
+
settings default: DEFAULT_SETTINGS, partial: SETTING_PARTIAL
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def boot!
|
39
|
+
Patches.apply!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "custom_startpage/version"
|
5
|
+
require "custom_startpage/infos"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "redmine-custom_startpage"
|
9
|
+
spec.version = CustomStartpage::VERSION
|
10
|
+
spec.authors = CustomStartpage::Infos::AUTHORS.keys
|
11
|
+
spec.email = CustomStartpage::Infos::AUTHORS.values
|
12
|
+
spec.summary = CustomStartpage::Infos::DESCRIPTION
|
13
|
+
spec.description = CustomStartpage::Infos::DESCRIPTION
|
14
|
+
spec.homepage = CustomStartpage::Infos::URL
|
15
|
+
spec.license = CustomStartpage::Infos::LICENSE
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
18
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "rails", "~> 4.2.0"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rubocop"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redmine-custom_startpage
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonas Thiel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Allows the user to select almost any Redmine page as the initial start
|
70
|
+
page after login
|
71
|
+
email:
|
72
|
+
- jt@neopoly.de
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rubocop.yml"
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- app/views/settings/_custom_startpage_settings.html.erb
|
84
|
+
- config/locales/en.yml
|
85
|
+
- lib/custom_startpage/engine.rb
|
86
|
+
- lib/custom_startpage/infos.rb
|
87
|
+
- lib/custom_startpage/patches.rb
|
88
|
+
- lib/custom_startpage/patches/welcome_controller_patch.rb
|
89
|
+
- lib/custom_startpage/redmine_plugin.rb
|
90
|
+
- lib/custom_startpage/version.rb
|
91
|
+
- lib/redmine-custom_startpage.rb
|
92
|
+
- redmine-custom_startpage.gemspec
|
93
|
+
homepage: https://github.com/neopoly/redmine-custom_startpage
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.4.6
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Allows the user to select almost any Redmine page as the initial start page
|
117
|
+
after login
|
118
|
+
test_files: []
|
119
|
+
has_rdoc:
|