redmine-personal_wiki_page 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +31 -0
- data/Rakefile +8 -0
- data/app/views/settings/_personal_wiki_page_settings.html.erb +11 -0
- data/assets/stylesheets/personal_wiki_page.css +4 -0
- data/config/locales/en.yml +6 -0
- data/lib/personal_wiki_page/engine.rb +10 -0
- data/lib/personal_wiki_page/hooks.rb +56 -0
- data/lib/personal_wiki_page/infos.rb +11 -0
- data/lib/personal_wiki_page/redmine_plugin.rb +43 -0
- data/lib/personal_wiki_page/version.rb +3 -0
- data/lib/redmine-personal_wiki_page.rb +7 -0
- data/redmine-personal_wiki_page.gemspec +28 -0
- metadata +130 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7be42b4ece5f85ddbba8c257010b44ad43eb77fc
|
4
|
+
data.tar.gz: d4092eccf00380ab7a7a39e4d937cce998ce5be4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 50ff7e458b64afe8a7898c38d92b2addf848988822da7c6dcb4b21150c869493133ad39a5b9b65fef6dcb66b21f68639419f17d26ad3d1be88711dee7e1b5998
|
7
|
+
data.tar.gz: 49494e565b5fce7a8dcdab71defd4e041abc9fc7af760406b6cf3f906f940d48009c6e936d8dc8f2e067265810c0236a7d49a3fa3664a58a1d2442ef75688ea1
|
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,31 @@
|
|
1
|
+
# redmine-personal_wiki_page
|
2
|
+
|
3
|
+
Adds a link to a personal wiki page to Redmine's header
|
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-personal_wiki_page"
|
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
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/redmine-personal_wiki_page/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
<p>
|
2
|
+
<%= label_tag :settings_project, l(:personal_wiki_page_project) %>
|
3
|
+
<%= text_field_tag "settings[project]", @settings["project"] %>
|
4
|
+
<span class="hint"><%= l(:personal_wiki_page_project_hint) %></span>
|
5
|
+
</p>
|
6
|
+
|
7
|
+
<p>
|
8
|
+
<%= label_tag :settings_prefix, l(:personal_wiki_page_prefix) %>
|
9
|
+
<%= text_field_tag "settings[prefix]", @settings["prefix"] %>
|
10
|
+
<span class="hint"><%= l(:personal_wiki_page_prefix_hint) %></span>
|
11
|
+
</p>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
en:
|
2
|
+
personal_wiki_page_project: "Project"
|
3
|
+
personal_wiki_page_project_hint: "The identifer of the project which will contain the personal wiki pages"
|
4
|
+
personal_wiki_page_prefix: "Prefix of page names"
|
5
|
+
personal_wiki_page_prefix_hint: "e.g. PersonalWiki_"
|
6
|
+
personal_wiki_page_link: "Wiki"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Add a new view hook into Redmine's template
|
2
|
+
MoreViewHooks.add(
|
3
|
+
:layout_base_logged_as_before,
|
4
|
+
virtual_path: "layouts/base",
|
5
|
+
insert_before: "#top-menu erb[loud]:contains('if User.current.logged?')" \
|
6
|
+
":contains('content_tag')"
|
7
|
+
)
|
8
|
+
|
9
|
+
module PersonalWikiPage
|
10
|
+
class Hooks < Redmine::Hook::ViewListener
|
11
|
+
def view_layouts_base_html_head(_context)
|
12
|
+
stylesheet_link_tag "personal_wiki_page", plugin: "personal_wiki_page"
|
13
|
+
end
|
14
|
+
|
15
|
+
def layout_base_logged_as_before(context)
|
16
|
+
return "" if user.anonymous?
|
17
|
+
view_context = context[:controller].view_context
|
18
|
+
|
19
|
+
view_context.content_tag :ul, class: "personal-wiki-page" do
|
20
|
+
view_context.content_tag :li do
|
21
|
+
link_to_wiki_page
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def link_to_wiki_page
|
29
|
+
link_to l(:personal_wiki_page_link), personal_wiki_path
|
30
|
+
end
|
31
|
+
|
32
|
+
def personal_wiki_path
|
33
|
+
project_wiki_page_path(project_id: project, id: page)
|
34
|
+
end
|
35
|
+
|
36
|
+
def settings
|
37
|
+
Setting.plugin_personal_wiki_page
|
38
|
+
end
|
39
|
+
|
40
|
+
def project
|
41
|
+
settings["project"]
|
42
|
+
end
|
43
|
+
|
44
|
+
def prefix
|
45
|
+
settings["prefix"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def user
|
49
|
+
User.current
|
50
|
+
end
|
51
|
+
|
52
|
+
def page
|
53
|
+
"#{prefix}#{user.login}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module PersonalWikiPage
|
2
|
+
module Infos
|
3
|
+
NAME = "redmine-personal_wiki_page"
|
4
|
+
DESCRIPTION = "Adds a link to a personal wiki page to Redmine's header"
|
5
|
+
LICENSE = "MIT"
|
6
|
+
URL = "https://github.com/neopoly/redmine-personal_wiki_page"
|
7
|
+
AUTHORS = {
|
8
|
+
"Jonas Thiel" => "jt@neopoly.de"
|
9
|
+
}.freeze
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module PersonalWikiPage
|
2
|
+
# Registers this gems a Redmine plugin and applies the needed patches
|
3
|
+
class RedminePlugin
|
4
|
+
include PersonalWikiPage::Infos
|
5
|
+
|
6
|
+
DEFAULT_SETTINGS = {
|
7
|
+
"project" => "orga",
|
8
|
+
"prefix" => "PersonalWiki_"
|
9
|
+
}.freeze
|
10
|
+
|
11
|
+
SETTING_PARTIAL = "settings/personal_wiki_page_settings"
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
register!
|
15
|
+
boot!
|
16
|
+
mirror_assets!
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def register!
|
22
|
+
@plugin = Redmine::Plugin.register :personal_wiki_page do
|
23
|
+
name NAME
|
24
|
+
author AUTHORS.keys.join(", ")
|
25
|
+
description DESCRIPTION
|
26
|
+
version VERSION
|
27
|
+
url URL
|
28
|
+
author_url URL
|
29
|
+
directory Engine.root
|
30
|
+
|
31
|
+
settings default: DEFAULT_SETTINGS, partial: SETTING_PARTIAL
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def boot!
|
36
|
+
require "personal_wiki_page/hooks"
|
37
|
+
end
|
38
|
+
|
39
|
+
def mirror_assets!
|
40
|
+
@plugin.mirror_assets
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "personal_wiki_page/version"
|
5
|
+
require "personal_wiki_page/infos"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "redmine-personal_wiki_page"
|
9
|
+
spec.version = PersonalWikiPage::VERSION
|
10
|
+
spec.authors = PersonalWikiPage::Infos::AUTHORS.keys
|
11
|
+
spec.email = PersonalWikiPage::Infos::AUTHORS.values
|
12
|
+
spec.summary = PersonalWikiPage::Infos::DESCRIPTION
|
13
|
+
spec.description = PersonalWikiPage::Infos::DESCRIPTION
|
14
|
+
spec.homepage = PersonalWikiPage::Infos::URL
|
15
|
+
spec.license = PersonalWikiPage::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
|
+
spec.add_dependency "redmine-more_view_hooks"
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "rubocop"
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redmine-personal_wiki_page
|
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: redmine-more_view_hooks
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Adds a link to a personal wiki page to Redmine's header
|
84
|
+
email:
|
85
|
+
- jt@neopoly.de
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rubocop.yml"
|
92
|
+
- Gemfile
|
93
|
+
- LICENSE.txt
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- app/views/settings/_personal_wiki_page_settings.html.erb
|
97
|
+
- assets/stylesheets/personal_wiki_page.css
|
98
|
+
- config/locales/en.yml
|
99
|
+
- lib/personal_wiki_page/engine.rb
|
100
|
+
- lib/personal_wiki_page/hooks.rb
|
101
|
+
- lib/personal_wiki_page/infos.rb
|
102
|
+
- lib/personal_wiki_page/redmine_plugin.rb
|
103
|
+
- lib/personal_wiki_page/version.rb
|
104
|
+
- lib/redmine-personal_wiki_page.rb
|
105
|
+
- redmine-personal_wiki_page.gemspec
|
106
|
+
homepage: https://github.com/neopoly/redmine-personal_wiki_page
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.2.2
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Adds a link to a personal wiki page to Redmine's header
|
130
|
+
test_files: []
|