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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6ac91253dca5ea3b7e4880b5b87bd3f0c54f694
4
- data.tar.gz: 57bbf7527b5fb957d51ebb2e9a7205b6f8b5fc10
3
+ metadata.gz: a0c966af669fc708871744d7416c17dee99ff81b
4
+ data.tar.gz: 8855e8dd7d3b8397077c869db45e0a5d3c2e3394
5
5
  SHA512:
6
- metadata.gz: 478798914c2f5a8b26ded4633d28c89a1fb120c1f59eb78e297f9674981935eb222a903955716ba04c97f60a4b2b02d7fd62dbc0ae8e234084ada17a7e833fc0
7
- data.tar.gz: 150696117bd471c74ddb058948b259b2b9d86b744ab9fcfbcae4430414d6ce5125a787b29d121a590e4e2c23d1356975957e0298c379e921b874d1c68507f202
6
+ metadata.gz: 43597605c638e300a39ad7d69be39e62a1c6119de06db748d03bc924c32cebfb09db3f3df282885a71ae82788dc5982b1372f8cf57d8078ae31f602464f44702
7
+ data.tar.gz: 9afba8aae677dc897a3dfdeb98a740a94a88a8d8ac20ba09ee666ad2c8a13a68c526989f8a0ee3105ff79b95468d84af561c196f29dee537a03376b543abd8fb
data/README.rdoc CHANGED
@@ -1,3 +1,7 @@
1
- = OdaniaTimeline
1
+ = Odania Timeline
2
2
 
3
- This project rocks and uses MIT-LICENSE.
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
- has_many :timeline_contents, class_name: 'OdaniaTimeline::TimelineContent'
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
@@ -0,0 +1,5 @@
1
+ <div class="field">
2
+ <label>Contact List</label>
3
+ <select data-ng-model="targetData.id" data-ng-options="timeline.id as timeline.title for timeline in data.timelines"></select>
4
+ <br/>
5
+ </div>
@@ -1,6 +1,8 @@
1
1
  require 'odania_timeline/engine'
2
2
 
3
3
  module OdaniaTimeline
4
+ autoload :EngineTargetType, 'odania_timeline/engine_target_type'
5
+
4
6
  def self.table_name_prefix
5
7
  'odania_timeline_'
6
8
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OdaniaTimeline
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  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.1
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-28 00:00:00.000000000 Z
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.5
107
+ rubygems_version: 2.4.6
104
108
  signing_key:
105
109
  specification_version: 4
106
110
  summary: 'Odania Portal Plugin: Timeline'