odania_timeline 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/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +25 -0
- data/app/assets/javascripts/odania_timeline/application.js +13 -0
- data/app/assets/javascripts/odania_timeline/controllers/timelines/edit_timeline_controller.js +56 -0
- data/app/assets/javascripts/odania_timeline/controllers/timelines/timeline_controller.js +11 -0
- data/app/assets/javascripts/odania_timeline/controllers/timelines/timelines_controller.js +18 -0
- data/app/assets/javascripts/odania_timeline/resoures/timeline_resource.js +11 -0
- data/app/assets/stylesheets/odania_timeline/application.css +15 -0
- data/app/controllers/odania_timeline/application_controller.rb +4 -0
- data/app/controllers/odania_timeline/timelines_controller.rb +10 -0
- data/app/controllers/protected/api/odania_timeline/timelines_controller.rb +51 -0
- data/app/helpers/odania_timeline/application_helper.rb +4 -0
- data/app/models/odania_timeline/timeline.rb +17 -0
- data/app/models/odania_timeline/timeline_content.rb +7 -0
- data/app/views/layouts/odania_timeline/application.html.erb +14 -0
- data/app/views/odania_timeline/timelines/_show.html.erb +17 -0
- data/app/views/odania_timeline/timelines/index.html.erb +7 -0
- data/app/views/odania_timeline/timelines/show.html.erb +1 -0
- data/app/views/protected/api/odania_timeline/timeline_contents/_show.json.jbuilder +4 -0
- data/app/views/protected/api/odania_timeline/timelines/_show.json.jbuilder +6 -0
- data/app/views/protected/api/odania_timeline/timelines/index.json.jbuilder +1 -0
- data/app/views/protected/api/odania_timeline/timelines/show.json.jbuilder +3 -0
- data/app/views/protected/template/templates/odania_timeline/timelines/_edit.html.erb +70 -0
- data/app/views/protected/template/templates/odania_timeline/timelines/_index.html.erb +31 -0
- data/app/views/protected/template/templates/odania_timeline/timelines/_show.html.erb +17 -0
- data/config/locales/de.yml +8 -0
- data/config/locales/en.yml +8 -0
- data/config/routes.rb +16 -0
- data/db/migrate/20150327172503_create_odania_timeline_timelines.rb +15 -0
- data/db/migrate/20150327172813_create_odania_timeline_timeline_contents.rb +12 -0
- data/lib/odania_timeline/engine.rb +23 -0
- data/lib/odania_timeline/version.rb +3 -0
- data/lib/odania_timeline.rb +7 -0
- data/lib/tasks/odania_timeline_tasks.rake +4 -0
- metadata +107 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c6ac91253dca5ea3b7e4880b5b87bd3f0c54f694
|
4
|
+
data.tar.gz: 57bbf7527b5fb957d51ebb2e9a7205b6f8b5fc10
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 478798914c2f5a8b26ded4633d28c89a1fb120c1f59eb78e297f9674981935eb222a903955716ba04c97f60a4b2b02d7fd62dbc0ae8e234084ada17a7e833fc0
|
7
|
+
data.tar.gz: 150696117bd471c74ddb058948b259b2b9d86b744ab9fcfbcae4430414d6ce5125a787b29d121a590e4e2c23d1356975957e0298c379e921b874d1c68507f202
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2015 Mike Petersen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'OdaniaTimeline'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
Bundler::GemHelper.install_tasks
|
25
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,56 @@
|
|
1
|
+
app.controller('OdaniaTimelineEditTimelineController', ['$location', '$scope', '$rootScope', 'OdaniaTimelineTimelineResource', '$routeParams', 'eventTypeProvider', function ($location, $scope, $rootScope, OdaniaTimelineTimelineResource, $routeParams, eventTypeProvider) {
|
2
|
+
console.log("controller :: OdaniaTimelineEditTimelineController");
|
3
|
+
var timelineId = null;
|
4
|
+
|
5
|
+
function loadTimeline(id) {
|
6
|
+
OdaniaTimelineTimelineResource.get({id: id}).$promise.then(function (data) {
|
7
|
+
$scope.timeline = data.timeline;
|
8
|
+
|
9
|
+
var contents;
|
10
|
+
for (var i=0 ; i<$scope.timeline.timeline_contents.length ; i++) {
|
11
|
+
contents = $scope.timeline.timeline_contents[i];
|
12
|
+
contents.timeline_date = new Date(parseInt(contents.timeline_date));
|
13
|
+
}
|
14
|
+
});
|
15
|
+
}
|
16
|
+
|
17
|
+
function onSaveSuccess() {
|
18
|
+
$location.path('/odania_timeline/timelines');
|
19
|
+
}
|
20
|
+
|
21
|
+
function onSaveError(data) {
|
22
|
+
console.log("errors", data);
|
23
|
+
$scope.errors = data.data.errors;
|
24
|
+
}
|
25
|
+
|
26
|
+
$scope.saveTimeline = function () {
|
27
|
+
var data = {
|
28
|
+
'title': $scope.timeline.title,
|
29
|
+
'is_public': $scope.timeline.is_public,
|
30
|
+
'timeline_contents_attributes': $scope.timeline.timeline_contents
|
31
|
+
};
|
32
|
+
|
33
|
+
if (timelineId) {
|
34
|
+
OdaniaTimelineTimelineResource.update({
|
35
|
+
id: timelineId,
|
36
|
+
timeline: data
|
37
|
+
}).$promise.then(onSaveSuccess, onSaveError);
|
38
|
+
} else {
|
39
|
+
OdaniaTimelineTimelineResource.save({timeline: data}).$promise.then(onSaveSuccess, onSaveError);
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
$scope.addEntryToTimeline = function () {
|
44
|
+
$scope.timeline.timeline_contents.push({});
|
45
|
+
};
|
46
|
+
|
47
|
+
$scope.timeline = {
|
48
|
+
'title': '',
|
49
|
+
'timeline_contents': []
|
50
|
+
};
|
51
|
+
|
52
|
+
if ($routeParams.id) {
|
53
|
+
timelineId = $routeParams.id;
|
54
|
+
loadTimeline(timelineId);
|
55
|
+
}
|
56
|
+
}]);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
app.controller('OdaniaTimelineTimelineController', ['$scope', 'OdaniaTimelineTimelineResource', '$routeParams', function ($scope, OdaniaTimelineTimelineResource, $routeParams) {
|
2
|
+
console.log("controller :: OdaniaTimelineTimelineController");
|
3
|
+
|
4
|
+
function loadTimeline(id) {
|
5
|
+
OdaniaTimelineTimelineResource.get({id: id}).$promise.then(function (data) {
|
6
|
+
$scope.timeline = data.timeline;
|
7
|
+
});
|
8
|
+
}
|
9
|
+
|
10
|
+
loadTimeline($routeParams.id);
|
11
|
+
}]);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
app.controller('OdaniaTimelineTimelinesController', ['$rootScope', '$scope', 'OdaniaTimelineTimelineResource', 'eventTypeProvider', '$location', function ($rootScope, $scope, OdaniaTimelineTimelineResource, eventTypeProvider, $location) {
|
2
|
+
console.log("controller :: OdaniaTimelineTimelinesController");
|
3
|
+
|
4
|
+
function loadTimelines() {
|
5
|
+
OdaniaTimelineTimelineResource.get().$promise.then(function (data) {
|
6
|
+
$scope.timelines = data.timelines;
|
7
|
+
});
|
8
|
+
}
|
9
|
+
|
10
|
+
$scope.deleteTimeline = function (id) {
|
11
|
+
OdaniaTimelineTimelineResource.delete({id: id}).$promise.then(function () {
|
12
|
+
loadTimelines();
|
13
|
+
});
|
14
|
+
};
|
15
|
+
$scope.timelines = [];
|
16
|
+
|
17
|
+
loadTimelines();
|
18
|
+
}]);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class OdaniaTimeline::TimelinesController < ApplicationController
|
2
|
+
def index
|
3
|
+
@timelines = OdaniaTimeline::Timeline.where(is_public: true).order('updated_at DESC')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show
|
7
|
+
@timeline = OdaniaTimeline::Timeline.where(is_public: true, id: params[:id].to_i).first
|
8
|
+
redirect_to odania_timeline_timelines_path if @timeline.nil?
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class Protected::Api::OdaniaTimeline::TimelinesController < Protected::ApiController
|
2
|
+
before_action :verify_timeline, except: [:index, :create]
|
3
|
+
|
4
|
+
def index
|
5
|
+
@timelines = OdaniaTimeline::Timeline.where(user_id: current_user.id).order('created_at DESC')
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
end
|
10
|
+
|
11
|
+
def create
|
12
|
+
@timeline = OdaniaTimeline::Timeline.new(timeline_params)
|
13
|
+
@timeline.user_id = current_user.id
|
14
|
+
@timeline.site_id = current_site.id
|
15
|
+
@timeline.language_id = current_site.default_language_id
|
16
|
+
|
17
|
+
if @timeline.save
|
18
|
+
flash[:notice] = t('created')
|
19
|
+
render action: :show
|
20
|
+
else
|
21
|
+
render json: {errors: @timeline.errors}, status: :bad_request
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def update
|
26
|
+
if @timeline.update(timeline_params)
|
27
|
+
flash[:notice] = t('updated')
|
28
|
+
render action: :show
|
29
|
+
else
|
30
|
+
render json: {errors: @timeline.errors}, status: :bad_request
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def destroy
|
35
|
+
@timeline.destroy
|
36
|
+
|
37
|
+
flash[:notice] = t('deleted')
|
38
|
+
render json: {message: 'deleted'}
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def verify_timeline
|
44
|
+
@timeline = OdaniaTimeline::Timeline.where(user_id: current_user.id, id: params[:id]).first
|
45
|
+
bad_api_request('resource_not_found') if @timeline.nil?
|
46
|
+
end
|
47
|
+
|
48
|
+
def timeline_params
|
49
|
+
params.require(:timeline).permit(:title, :is_public, timeline_contents_attributes: [:id, :title, :body, :timeline_date])
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class OdaniaTimeline::Timeline < ActiveRecord::Base
|
2
|
+
has_many :timeline_contents, class_name: 'OdaniaTimeline::TimelineContent'
|
3
|
+
|
4
|
+
accepts_nested_attributes_for :timeline_contents, allow_destroy: true, reject_if: proc { |attributes| attributes['title'].blank? }
|
5
|
+
|
6
|
+
validates_length_of :title, minimum: 2
|
7
|
+
|
8
|
+
def to_param
|
9
|
+
"#{self.id}-#{self.title.parameterize}"
|
10
|
+
end
|
11
|
+
|
12
|
+
before_create do
|
13
|
+
self.is_public = true if self.is_public.nil?
|
14
|
+
|
15
|
+
true
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>OdaniaTimeline</title>
|
5
|
+
<%= stylesheet_link_tag "odania_timeline/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "odania_timeline/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h2 class="right-line"><%= timeline.title %></h2>
|
2
|
+
|
3
|
+
<ul class="timeline-2">
|
4
|
+
<% timeline.timeline_contents.each do |timeline_content| %>
|
5
|
+
<li class="wow fadeInRight">
|
6
|
+
<time class="timeline-time" datetime=""><%= timeline_content.timeline_date %></time>
|
7
|
+
<i class="timeline-2-point"></i>
|
8
|
+
|
9
|
+
<div class="panel panel-default">
|
10
|
+
<div class="panel-heading"><%= timeline_content.title %></div>
|
11
|
+
<div class="panel-body">
|
12
|
+
<%=raw timeline_content.body %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render partial: 'odania_timeline/timelines/show', locals: {timeline: @timeline} %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.timelines @timelines, partial: 'protected/api/odania_timeline/timelines/show', as: :timeline
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<form class="form-horizontal" role="form">
|
2
|
+
<div class="row-fluid">
|
3
|
+
<div class="col-md-9">
|
4
|
+
<h1>Editing Timeline</h1>
|
5
|
+
|
6
|
+
<div class="form-group">
|
7
|
+
<label class="col-sm-2 control-label" for="site_name">Title</label>
|
8
|
+
|
9
|
+
<div class="col-sm-10">
|
10
|
+
<input type="text" id="site_name" data-ng-model="timeline.title" placeholder="Title" class="form-control"/>
|
11
|
+
<span data-ng-if="errors.title" style="color: red;">{{ printErrors(errors.title) }}</span>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div data-ng-repeat="timelineContent in timeline.timeline_contents">
|
16
|
+
<fieldset>
|
17
|
+
<legend>Timeline Content {{ $index + 1 }}</legend>
|
18
|
+
|
19
|
+
<div class="form-group">
|
20
|
+
<label class="col-sm-2 control-label">Date</label>
|
21
|
+
|
22
|
+
<div class="col-sm-10">
|
23
|
+
<input type="date" data-ng-model="timeline.timeline_contents[$index].timeline_date" placeholder="Release date" class="form-control"/>
|
24
|
+
<span data-ng-if="errors.timeline_contents[$index].timeline_date" style="color: red;">{{ printErrors(errors.timeline_contents[$index].timeline_date) }}</span>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="form-group">
|
29
|
+
<label class="col-sm-2 control-label" for="site_name">Title</label>
|
30
|
+
|
31
|
+
<div class="col-sm-10">
|
32
|
+
<input type="text" id="site_name" data-ng-model="timeline.timeline_contents[$index].title" placeholder="Title" class="form-control"/>
|
33
|
+
<span data-ng-if="errors.timeline_contents[$index].title" style="color: red;">{{ printErrors(errors.timeline_contents[$index].title) }}</span>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div class="form-group">
|
38
|
+
<label class="col-sm-2 control-label">Body</label>
|
39
|
+
|
40
|
+
<div class="col-sm-10">
|
41
|
+
<div data-text-angular data-ng-model="timeline.timeline_contents[$index].body" data-placeholder="<%= t('odania_timeline.model.body.placeholder') %>"></div>
|
42
|
+
<span data-ng-if="errors.timeline_contents[$index].body" style="color: red;">{{ printErrors(errors.timeline_contents[$index].body) }}</span>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</fieldset>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
</div>
|
49
|
+
<div class="col-md-3">
|
50
|
+
<span data-ng-if="errors" style="color: red;"><%= t('general.Please correct the errors') %></span>
|
51
|
+
|
52
|
+
<div class="well">
|
53
|
+
<h3><%= t('odania_timeline.create.title') %></h3>
|
54
|
+
|
55
|
+
<button data-ng-click="saveTimeline()" class="btn btn-primary"><%= t('general.save') %></button>
|
56
|
+
|
57
|
+
<br/>
|
58
|
+
<button data-ng-click="addEntryToTimeline()" class="btn btn-primary"><%= t('odania_timeline.create.add_entry_to_timeline') %></button>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div class="form-group">
|
62
|
+
<label class="col-sm-2 control-label">Is Public</label>
|
63
|
+
|
64
|
+
<div class="col-sm-10">
|
65
|
+
<input type="checkbox" data-ng-model="timeline.is_public">
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</form>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<h1>Timelines</h1>
|
2
|
+
|
3
|
+
<table class="table">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>Title</th>
|
7
|
+
<th>Is Public</th>
|
8
|
+
<th>Entries</th>
|
9
|
+
<th>Language</th>
|
10
|
+
<th></th>
|
11
|
+
<th></th>
|
12
|
+
<th></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
|
16
|
+
<tbody>
|
17
|
+
<tr data-ng-repeat="timeline in timelines">
|
18
|
+
<td>{{ timeline.title }}</td>
|
19
|
+
<td>{{ timeline.is_public }}</td>
|
20
|
+
<td>{{ timeline.timeline_contents.length }}</td>
|
21
|
+
<td>{{ getLanguage(timeline.language_id).iso_639_1 }}</td>
|
22
|
+
<td><a data-ng-href="#/odania_timeline/timelines/{{ timeline.id }}">Show</a></td>
|
23
|
+
<td><a data-ng-href="#/odania_timeline/timelines/{{ timeline.id }}/edit">Edit</a></td>
|
24
|
+
<td><a data-ng-confirm-click="deleteTimeline(timeline.id)" data-ng-confirm-message="Are you sure?">Destroy</a></td>
|
25
|
+
</tr>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
|
29
|
+
<br/>
|
30
|
+
|
31
|
+
<a data-ng-href="#/odania_timeline/timelines/new">New Timeline</a>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<p>
|
2
|
+
<strong>Title:</strong>
|
3
|
+
{{ timeline.title }}
|
4
|
+
</p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong>Language:</strong>
|
8
|
+
{{ timeline.language_id }}
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<div data-ng-repeat="timelineContent in timeline.timeline_contents">
|
12
|
+
<hr/>
|
13
|
+
<strong>{{ timelineContent.timeline_date }}: {{ timelineContent.title }}</strong>
|
14
|
+
<div data-ng-html="{{ timelineContent.body }}"></div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<a data-ng-href="#/odania_timeline/timelines/{{ timeline.id }}/edit">Edit</a> | <a data-ng-href="#/odania_timeline/timelines">Back</a>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
namespace :protected do
|
3
|
+
namespace :api, defaults: {format: :json} do
|
4
|
+
namespace :odania_timeline do
|
5
|
+
resources :timelines, except: [:new, :edit]
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
scope '/:locale', constraints: {locale: /[a-z][a-z]/} do
|
11
|
+
namespace :odania_timeline do
|
12
|
+
get 'timelines' => 'timelines#index'
|
13
|
+
get 'timelines/:id' => 'timelines#show'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateOdaniaTimelineTimelines < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :odania_timeline_timelines do |t|
|
4
|
+
t.references :user, index: true
|
5
|
+
t.references :language, index: true
|
6
|
+
t.references :site, index: true
|
7
|
+
t.string :title
|
8
|
+
t.boolean :is_public
|
9
|
+
t.timestamps null: false
|
10
|
+
end
|
11
|
+
add_foreign_key :odania_timeline_timelines, :odania_sites, column: :site_id
|
12
|
+
add_foreign_key :odania_timeline_timelines, :odania_users, column: :user_id
|
13
|
+
add_foreign_key :odania_timeline_timelines, :odania_languages, column: :language_id
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateOdaniaTimelineTimelineContents < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :odania_timeline_timeline_contents do |t|
|
4
|
+
t.references :timeline, index: true
|
5
|
+
t.date :timeline_date
|
6
|
+
t.string :title
|
7
|
+
t.text :body
|
8
|
+
t.timestamps null: false
|
9
|
+
end
|
10
|
+
add_foreign_key :odania_timeline_timeline_contents, :odania_timeline_timelines, column: :timeline_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'odania_core'
|
2
|
+
require 'odania'
|
3
|
+
|
4
|
+
module OdaniaTimeline
|
5
|
+
PLUGIN_NAME = 'odania_timeline'
|
6
|
+
|
7
|
+
class Engine < ::Rails::Engine
|
8
|
+
config.generators do |g|
|
9
|
+
g.test_framework :rspec
|
10
|
+
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
|
11
|
+
end
|
12
|
+
|
13
|
+
Odania.protected.plugins << OdaniaTimeline::PLUGIN_NAME
|
14
|
+
Odania.protected.pages << {name: 'Timelines', in_menu: true, path: '/odania_timeline/timelines', controller: 'OdaniaTimelineTimelinesController',
|
15
|
+
template: 'odania_timeline/timelines/index', active: OdaniaTimeline::PLUGIN_NAME}
|
16
|
+
Odania.protected.pages << {name: 'New Timeline', in_menu: false, path: '/odania_timeline/timelines/new', controller: 'OdaniaTimelineEditTimelineController',
|
17
|
+
template: 'odania_timeline/timelines/edit', active: OdaniaTimeline::PLUGIN_NAME}
|
18
|
+
Odania.protected.pages << {name: 'Edit Timeline', in_menu: false, path: '/odania_timeline/timelines/:id', controller: 'OdaniaTimelineTimelineController',
|
19
|
+
template: 'odania_timeline/timelines/show', active: OdaniaTimeline::PLUGIN_NAME}
|
20
|
+
Odania.protected.pages << {name: 'Edit Timeline', in_menu: false, path: '/odania_timeline/timelines/:id/edit', controller: 'OdaniaTimelineEditTimelineController',
|
21
|
+
template: 'odania_timeline/timelines/edit', active: OdaniaTimeline::PLUGIN_NAME}
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: odania_timeline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mike Petersen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-28 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: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: odania_core
|
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
|
+
description: The Odania Portal is an open source portal system with strong focus on
|
42
|
+
the usage on different domains with different layout/setup.
|
43
|
+
email:
|
44
|
+
- mike@odania-it.de
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- MIT-LICENSE
|
50
|
+
- README.rdoc
|
51
|
+
- Rakefile
|
52
|
+
- app/assets/javascripts/odania_timeline/application.js
|
53
|
+
- app/assets/javascripts/odania_timeline/controllers/timelines/edit_timeline_controller.js
|
54
|
+
- app/assets/javascripts/odania_timeline/controllers/timelines/timeline_controller.js
|
55
|
+
- app/assets/javascripts/odania_timeline/controllers/timelines/timelines_controller.js
|
56
|
+
- app/assets/javascripts/odania_timeline/resoures/timeline_resource.js
|
57
|
+
- app/assets/stylesheets/odania_timeline/application.css
|
58
|
+
- app/controllers/odania_timeline/application_controller.rb
|
59
|
+
- app/controllers/odania_timeline/timelines_controller.rb
|
60
|
+
- app/controllers/protected/api/odania_timeline/timelines_controller.rb
|
61
|
+
- app/helpers/odania_timeline/application_helper.rb
|
62
|
+
- app/models/odania_timeline/timeline.rb
|
63
|
+
- app/models/odania_timeline/timeline_content.rb
|
64
|
+
- app/views/layouts/odania_timeline/application.html.erb
|
65
|
+
- app/views/odania_timeline/timelines/_show.html.erb
|
66
|
+
- app/views/odania_timeline/timelines/index.html.erb
|
67
|
+
- app/views/odania_timeline/timelines/show.html.erb
|
68
|
+
- app/views/protected/api/odania_timeline/timeline_contents/_show.json.jbuilder
|
69
|
+
- app/views/protected/api/odania_timeline/timelines/_show.json.jbuilder
|
70
|
+
- app/views/protected/api/odania_timeline/timelines/index.json.jbuilder
|
71
|
+
- app/views/protected/api/odania_timeline/timelines/show.json.jbuilder
|
72
|
+
- app/views/protected/template/templates/odania_timeline/timelines/_edit.html.erb
|
73
|
+
- app/views/protected/template/templates/odania_timeline/timelines/_index.html.erb
|
74
|
+
- app/views/protected/template/templates/odania_timeline/timelines/_show.html.erb
|
75
|
+
- config/locales/de.yml
|
76
|
+
- config/locales/en.yml
|
77
|
+
- config/routes.rb
|
78
|
+
- db/migrate/20150327172503_create_odania_timeline_timelines.rb
|
79
|
+
- db/migrate/20150327172813_create_odania_timeline_timeline_contents.rb
|
80
|
+
- lib/odania_timeline.rb
|
81
|
+
- lib/odania_timeline/engine.rb
|
82
|
+
- lib/odania_timeline/version.rb
|
83
|
+
- lib/tasks/odania_timeline_tasks.rake
|
84
|
+
homepage: http://www.odania.de
|
85
|
+
licenses: []
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.4.5
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: 'Odania Portal Plugin: Timeline'
|
107
|
+
test_files: []
|