odania_timeline 0.0.1 → 0.0.2
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 +4 -4
- data/README.rdoc +6 -2
- data/app/models/odania_timeline/timeline.rb +4 -1
- data/app/views/protected/api/odania_timeline/timelines/_inital_data.json.jbuilder +1 -0
- data/app/views/protected/odania_timeline/timelines/_choose_timeline.html.erb +5 -0
- data/app/views/protected/odania_timeline/timelines/_choose_timelines.html.erb +0 -0
- data/lib/odania_timeline.rb +2 -0
- data/lib/odania_timeline/engine.rb +10 -0
- data/lib/odania_timeline/engine_target_type.rb +22 -0
- data/lib/odania_timeline/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0c966af669fc708871744d7416c17dee99ff81b
|
4
|
+
data.tar.gz: 8855e8dd7d3b8397077c869db45e0a5d3c2e3394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43597605c638e300a39ad7d69be39e62a1c6119de06db748d03bc924c32cebfb09db3f3df282885a71ae82788dc5982b1372f8cf57d8078ae31f602464f44702
|
7
|
+
data.tar.gz: 9afba8aae677dc897a3dfdeb98a740a94a88a8d8ac20ba09ee666ad2c8a13a68c526989f8a0ee3105ff79b95468d84af561c196f29dee537a03376b543abd8fb
|
data/README.rdoc
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
-
=
|
1
|
+
= Odania Timeline
|
2
2
|
|
3
|
-
|
3
|
+
Odania Timeline is aplugin for the Odania Portal. It gives you the possibility to define and display timelines.
|
4
|
+
|
5
|
+
Active the plugin "odania_timeline" in the admin tool for a site. Afterwords you can define the data in the protected area.
|
6
|
+
|
7
|
+
This project rocks and uses MIT-LICENSE.
|
@@ -1,5 +1,8 @@
|
|
1
1
|
class OdaniaTimeline::Timeline < ActiveRecord::Base
|
2
|
-
|
2
|
+
belongs_to :site, :class_name => 'Odania::Site'
|
3
|
+
belongs_to :language, :class_name => 'Odania::Language'
|
4
|
+
belongs_to :user, :class_name => 'Odania::User'
|
5
|
+
has_many :timeline_contents, class_name: 'OdaniaTimeline::TimelineContent', dependent: :delete_all
|
3
6
|
|
4
7
|
accepts_nested_attributes_for :timeline_contents, allow_destroy: true, reject_if: proc { |attributes| attributes['title'].blank? }
|
5
8
|
|
@@ -0,0 +1 @@
|
|
1
|
+
json.timelines OdaniaTimeline::Timeline.where(is_public: true), partial: 'protected/api/odania_timeline/timelines/show', as: :timeline
|
File without changes
|
data/lib/odania_timeline.rb
CHANGED
@@ -19,5 +19,15 @@ module OdaniaTimeline
|
|
19
19
|
template: 'odania_timeline/timelines/show', active: OdaniaTimeline::PLUGIN_NAME}
|
20
20
|
Odania.protected.pages << {name: 'Edit Timeline', in_menu: false, path: '/odania_timeline/timelines/:id/edit', controller: 'OdaniaTimelineEditTimelineController',
|
21
21
|
template: 'odania_timeline/timelines/edit', active: OdaniaTimeline::PLUGIN_NAME}
|
22
|
+
|
23
|
+
# Add content types
|
24
|
+
Odania::TargetType.targets['TIMELINES'] = {type: 'TIMELINES',
|
25
|
+
module: 'OdaniaTimeline::EngineTargetType', validator_func: 'validate_timelines',
|
26
|
+
render_func: '', selector: 'protected/odania_timeline/timelines/choose_timelines',
|
27
|
+
initial_data: 'admin/api/menu_items/empty_inital_data'}
|
28
|
+
Odania::TargetType.targets['TIMELINE'] = {type: 'TIMELINE',
|
29
|
+
module: 'OdaniaTimeline::EngineTargetType', validator_func: 'validate_timeline',
|
30
|
+
render_func: '', selector: 'protected/odania_timeline/timelines/choose_timeline',
|
31
|
+
initial_data: 'protected/api/odania_timeline/timelines/inital_data'}
|
22
32
|
end
|
23
33
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module OdaniaTimeline
|
2
|
+
module EngineTargetType
|
3
|
+
class << self
|
4
|
+
def validate_timelines(menu_item, target_data)
|
5
|
+
menu_item.full_path = 'odania_timeline/timelines'
|
6
|
+
|
7
|
+
nil
|
8
|
+
end
|
9
|
+
|
10
|
+
def validate_timeline(menu_item, target_data)
|
11
|
+
return 'invalid timeline id' if target_data['id'].nil?
|
12
|
+
|
13
|
+
timeline = OdaniaTimeline::Timeline.where(id: target_data['id']).first
|
14
|
+
return 'invalid timeline id' if timeline.nil?
|
15
|
+
|
16
|
+
menu_item.full_path = "odania_timeline/timelines/#{timeline.to_param}"
|
17
|
+
|
18
|
+
return nil
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odania_timeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Petersen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,9 +66,12 @@ files:
|
|
66
66
|
- app/views/odania_timeline/timelines/index.html.erb
|
67
67
|
- app/views/odania_timeline/timelines/show.html.erb
|
68
68
|
- app/views/protected/api/odania_timeline/timeline_contents/_show.json.jbuilder
|
69
|
+
- app/views/protected/api/odania_timeline/timelines/_inital_data.json.jbuilder
|
69
70
|
- app/views/protected/api/odania_timeline/timelines/_show.json.jbuilder
|
70
71
|
- app/views/protected/api/odania_timeline/timelines/index.json.jbuilder
|
71
72
|
- app/views/protected/api/odania_timeline/timelines/show.json.jbuilder
|
73
|
+
- app/views/protected/odania_timeline/timelines/_choose_timeline.html.erb
|
74
|
+
- app/views/protected/odania_timeline/timelines/_choose_timelines.html.erb
|
72
75
|
- app/views/protected/template/templates/odania_timeline/timelines/_edit.html.erb
|
73
76
|
- app/views/protected/template/templates/odania_timeline/timelines/_index.html.erb
|
74
77
|
- app/views/protected/template/templates/odania_timeline/timelines/_show.html.erb
|
@@ -79,6 +82,7 @@ files:
|
|
79
82
|
- db/migrate/20150327172813_create_odania_timeline_timeline_contents.rb
|
80
83
|
- lib/odania_timeline.rb
|
81
84
|
- lib/odania_timeline/engine.rb
|
85
|
+
- lib/odania_timeline/engine_target_type.rb
|
82
86
|
- lib/odania_timeline/version.rb
|
83
87
|
- lib/tasks/odania_timeline_tasks.rake
|
84
88
|
homepage: http://www.odania.de
|
@@ -100,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
104
|
version: '0'
|
101
105
|
requirements: []
|
102
106
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.4.
|
107
|
+
rubygems_version: 2.4.6
|
104
108
|
signing_key:
|
105
109
|
specification_version: 4
|
106
110
|
summary: 'Odania Portal Plugin: Timeline'
|