odania_timeline 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/app/assets/javascripts/odania_timeline/controllers/timelines/edit_timeline_controller.js +2 -1
- data/app/controllers/odania_timeline/timelines_controller.rb +2 -0
- data/app/controllers/protected/api/odania_timeline/timelines_controller.rb +1 -1
- data/app/models/odania_timeline/timeline_content.rb +1 -1
- data/app/views/odania_timeline/timelines/_show.html.erb +7 -2
- data/app/views/protected/api/odania_timeline/timeline_contents/_show.json.jbuilder +2 -1
- data/app/views/protected/api/odania_timeline/timelines/_show.json.jbuilder +1 -1
- data/app/views/protected/odania_timeline/timelines/_choose_timeline.html.erb +1 -1
- data/app/views/protected/template/templates/odania_timeline/timelines/_edit.html.erb +12 -3
- data/app/views/protected/template/templates/odania_timeline/timelines/_show.html.erb +1 -1
- data/db/migrate/20150401192045_add_date_column.rb +6 -0
- data/lib/odania_timeline/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26a3e0ab5ab497daa61bcbf8dc6a9fe8e04321fc
|
4
|
+
data.tar.gz: 2bfb6cc81ef122eb570d90379a25319eab536589
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 052d59f66ac165244ab2d519d4d334fec16b701c1f6e369ccc85f5687ae8e688bb11b19534e55ad94fa1e0131331bd3b3b2db94071db5e83928c113298ac22b7
|
7
|
+
data.tar.gz: eb1dc3a9d40774d3a64977ba19a069f31b8b5cff0e10a1017299bf8d6905c2cd2bb5590284bd5d523f5e980fbea70402736323a2f147c02afd448063294378db
|
data/README.rdoc
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
|
3
3
|
Odania Timeline is aplugin for the Odania Portal. It gives you the possibility to define and display timelines.
|
4
4
|
|
5
|
-
Active the plugin "odania_timeline" in the admin tool for a site. Afterwords
|
5
|
+
Active the plugin "odania_timeline" in the admin tool for a site. Afterwords users can define the data in the protected area.
|
6
6
|
|
7
7
|
This project rocks and uses MIT-LICENSE.
|
data/app/assets/javascripts/odania_timeline/controllers/timelines/edit_timeline_controller.js
CHANGED
@@ -9,7 +9,8 @@ app.controller('OdaniaTimelineEditTimelineController', ['$location', '$scope', '
|
|
9
9
|
var contents;
|
10
10
|
for (var i=0 ; i<$scope.timeline.timeline_contents.length ; i++) {
|
11
11
|
contents = $scope.timeline.timeline_contents[i];
|
12
|
-
contents.
|
12
|
+
contents.from_date = new Date(parseInt(contents.from_date));
|
13
|
+
contents.to_date = new Date(parseInt(contents.to_date));
|
13
14
|
}
|
14
15
|
});
|
15
16
|
}
|
@@ -46,6 +46,6 @@ class Protected::Api::OdaniaTimeline::TimelinesController < Protected::ApiContro
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def timeline_params
|
49
|
-
params.require(:timeline).permit(:title, :is_public, timeline_contents_attributes: [:id, :title, :body, :
|
49
|
+
params.require(:timeline).permit(:title, :is_public, timeline_contents_attributes: [:id, :title, :body, :from_date, :to_date])
|
50
50
|
end
|
51
51
|
end
|
@@ -1,9 +1,14 @@
|
|
1
1
|
<h2 class="right-line"><%= timeline.title %></h2>
|
2
2
|
|
3
3
|
<ul class="timeline-2">
|
4
|
-
<% timeline.timeline_contents.each do |timeline_content| %>
|
4
|
+
<% timeline.timeline_contents.order('from_date DESC').each do |timeline_content| %>
|
5
5
|
<li class="wow fadeInRight">
|
6
|
-
<time class="timeline-time" datetime=""
|
6
|
+
<time class="timeline-time" datetime="">
|
7
|
+
<%=l timeline_content.from_date %>
|
8
|
+
<% unless timeline_content.to_date.nil? %>
|
9
|
+
- <%=l timeline_content.to_date %>
|
10
|
+
<% end %>
|
11
|
+
</time>
|
7
12
|
<i class="timeline-2-point"></i>
|
8
13
|
|
9
14
|
<div class="panel panel-default">
|
@@ -1,4 +1,5 @@
|
|
1
1
|
json.id timeline_content.id
|
2
|
-
json.
|
2
|
+
json.from_date date_to_time_since_epoch(timeline_content.from_date)
|
3
|
+
json.to_date date_to_time_since_epoch(timeline_content.to_date)
|
3
4
|
json.title timeline_content.title
|
4
5
|
json.body timeline_content.body
|
@@ -3,4 +3,4 @@ json.title timeline.title
|
|
3
3
|
json.language_id timeline.language_id
|
4
4
|
json.is_public timeline.is_public
|
5
5
|
|
6
|
-
json.timeline_contents timeline.timeline_contents, partial: 'protected/api/odania_timeline/timeline_contents/show', as: :timeline_content
|
6
|
+
json.timeline_contents timeline.timeline_contents.order('from_date DESC'), partial: 'protected/api/odania_timeline/timeline_contents/show', as: :timeline_content
|
@@ -17,11 +17,20 @@
|
|
17
17
|
<legend>Timeline Content {{ $index + 1 }}</legend>
|
18
18
|
|
19
19
|
<div class="form-group">
|
20
|
-
<label class="col-sm-2 control-label">Date</label>
|
20
|
+
<label class="col-sm-2 control-label">Start Date</label>
|
21
21
|
|
22
22
|
<div class="col-sm-10">
|
23
|
-
<input type="date" data-ng-model="timeline.timeline_contents[$index].
|
24
|
-
<span data-ng-if="errors.timeline_contents[$index].
|
23
|
+
<input type="date" data-ng-model="timeline.timeline_contents[$index].from_date" placeholder="Start date" class="form-control"/>
|
24
|
+
<span data-ng-if="errors.timeline_contents[$index].from_date" style="color: red;">{{ printErrors(errors.timeline_contents[$index].from_date) }}</span>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="form-group">
|
29
|
+
<label class="col-sm-2 control-label">End Date</label>
|
30
|
+
|
31
|
+
<div class="col-sm-10">
|
32
|
+
<input type="date" data-ng-model="timeline.timeline_contents[$index].to_date" placeholder="Start date" class="form-control"/>
|
33
|
+
<span data-ng-if="errors.timeline_contents[$index].to_date" style="color: red;">{{ printErrors(errors.timeline_contents[$index].to_date) }}</span>
|
25
34
|
</div>
|
26
35
|
</div>
|
27
36
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<div data-ng-repeat="timelineContent in timeline.timeline_contents">
|
12
12
|
<hr/>
|
13
|
-
<strong>{{ timelineContent.
|
13
|
+
<strong>{{ timelineContent.from_date }} - {{ timelineContent.to_date }}: {{ timelineContent.title }}</strong>
|
14
14
|
<div data-ng-html="{{ timelineContent.body }}"></div>
|
15
15
|
</div>
|
16
16
|
|
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.3
|
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-
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- config/routes.rb
|
81
81
|
- db/migrate/20150327172503_create_odania_timeline_timelines.rb
|
82
82
|
- db/migrate/20150327172813_create_odania_timeline_timeline_contents.rb
|
83
|
+
- db/migrate/20150401192045_add_date_column.rb
|
83
84
|
- lib/odania_timeline.rb
|
84
85
|
- lib/odania_timeline/engine.rb
|
85
86
|
- lib/odania_timeline/engine_target_type.rb
|