ilog 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ilog.gemspec +29 -0
- data/lib/ilog/assets/favicon.ico +0 -0
- data/lib/ilog/assets/images/.gitkeep +0 -0
- data/lib/ilog/assets/javascripts/.gitkeep +0 -0
- data/lib/ilog/assets/javascripts/index.js +60723 -0
- data/lib/ilog/assets/javascripts/vue-config.js +92 -0
- data/lib/ilog/assets/javascripts/vue-index.js +60725 -0
- data/lib/ilog/assets/stylesheets/.gitkeep +0 -0
- data/lib/ilog/assets/stylesheets/log-style.css +3858 -0
- data/lib/ilog/assets/stylesheets/style.css +3858 -0
- data/lib/ilog/config/routes.rb +13 -0
- data/lib/ilog/configuration.rb +8 -0
- data/lib/ilog/controllers/.gitkeep +0 -0
- data/lib/ilog/controllers/digital/show.rb +23 -0
- data/lib/ilog/controllers/digital/tags.rb +15 -0
- data/lib/ilog/controllers/index/.DS_Store +0 -0
- data/lib/ilog/controllers/index/digital.rb +27 -0
- data/lib/ilog/controllers/index/index.rb +95 -0
- data/lib/ilog/controllers/platform/platform.rb +12 -0
- data/lib/ilog/controllers/post/post.rb +12 -0
- data/lib/ilog/models/item.rb +5 -0
- data/lib/ilog/models/post.rb +9 -0
- data/lib/ilog/models/stuff.rb +8 -0
- data/lib/ilog/templates/application.html.erb +11 -0
- data/lib/ilog/templates/digital/show.html.erb +0 -0
- data/lib/ilog/templates/digital/tags.html.erb +0 -0
- data/lib/ilog/templates/index/digital.html.erb +40 -0
- data/lib/ilog/templates/index/index.html.haml +10 -0
- data/lib/ilog/templates/index/vue.html.erb +0 -0
- data/lib/ilog/templates/platform/platform.html.erb +0 -0
- data/lib/ilog/templates/post/post.html.erb +0 -0
- data/lib/ilog/version.rb +3 -0
- data/lib/ilog/views/application_layout.rb +7 -0
- data/lib/ilog/views/digital/show.rb +9 -0
- data/lib/ilog/views/digital/tags.rb +9 -0
- data/lib/ilog/views/index/.DS_Store +0 -0
- data/lib/ilog/views/index/digital.rb +10 -0
- data/lib/ilog/views/index/index.rb +10 -0
- data/lib/ilog/views/platform/platform.rb +9 -0
- data/lib/ilog/views/post/post.rb +9 -0
- data/lib/ilog.rb +331 -0
- data/mix-manifest.json +5 -0
- data/package.json +40 -0
- data/src/js/vue-config.js +7 -0
- data/src/sass/.DS_Store +0 -0
- data/src/sass/_variables.scss +3 -0
- data/src/sass/components/.DS_Store +0 -0
- data/src/sass/components/article-text.scss +223 -0
- data/src/sass/components/card.scss +33 -0
- data/src/sass/components/post.scss +5 -0
- data/src/sass/components/selectize.scss +324 -0
- data/src/sass/components/single.scss +80 -0
- data/src/sass/components/tag.scss +46 -0
- data/src/sass/fonts/headings.scss +105 -0
- data/src/sass/fonts/pure.scss +29 -0
- data/src/sass/libs/selectize.scss +8 -0
- data/src/sass/log/.DS_Store +0 -0
- data/src/sass/log/base.scss +132 -0
- data/src/sass/log/grid.scss +82 -0
- data/src/sass/log/instagram-header.scss +123 -0
- data/src/sass/log/list.scss +242 -0
- data/src/sass/log/style.scss +3 -0
- data/src/sass/log/treestyle-addons.scss +102 -0
- data/src/sass/log/treestyle.scss +163 -0
- data/src/sass/style.scss +28 -0
- data/src/vue/Log.vue +257 -0
- data/src/vue/components/.DS_Store +0 -0
- data/src/vue/components/Item.vue +46 -0
- data/src/vue/components/Modal.vue +27 -0
- data/src/vue/components/Post.vue +125 -0
- data/src/vue/components/PostBody.vue +86 -0
- data/src/vue/components/Stuff.vue +63 -0
- data/src/vue/configs/app.js +5 -0
- data/src/vue/configs/axios.js +14 -0
- data/src/vue/elements/People.vue +75 -0
- data/src/vue/elements/Profile.vue +63 -0
- data/src/vue/elements/Tunekit.vue +82 -0
- data/src/vue/index.js +30 -0
- data/src/vue/router.js +50 -0
- data/src/vue/views/.DS_Store +0 -0
- data/src/vue/views/Introduction.vue +88 -0
- data/src/vue/views/List.vue +46 -0
- data/src/vue/views/Post.vue +163 -0
- data/webpack.mix.js +6 -0
- metadata +141 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
# Configure your routes here
|
2
|
+
# See: https://guides.hanamirb.org/routing/overview
|
3
|
+
#
|
4
|
+
# Example:
|
5
|
+
# get '/hello', to: ->(env) { [200, {}, ['Hello from Hanami!']] }
|
6
|
+
|
7
|
+
get '/:domain/index', to: 'index#index'
|
8
|
+
get '/:domain/(:id)', to: 'index#digital'
|
9
|
+
|
10
|
+
get '/:domain/post', to: 'post#show'
|
11
|
+
get '/:domain/index/vue', to: 'index#vue'
|
12
|
+
get '/:domain/modules/tags', to: 'digital#tags'
|
13
|
+
# get '/:id', to: 'digital#show'
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Ilog
|
2
|
+
module Controllers
|
3
|
+
module Digital
|
4
|
+
class Show
|
5
|
+
include Ilog::Action
|
6
|
+
def call(params)
|
7
|
+
@database = Ilog.configuration.namespaces[params[:domain]]
|
8
|
+
self.set_database @database
|
9
|
+
req = request.env['HTTP_ACCEPT']
|
10
|
+
if req.include? 'application/json'
|
11
|
+
post = ::Post.find(params[:id])
|
12
|
+
Post.namespace = params[:domain]
|
13
|
+
self.format = :json
|
14
|
+
self.body = post.to_json(:include => ::Post.dimensions + ::Post.groupings, :methods => [:content])
|
15
|
+
else
|
16
|
+
index = Index::Digital.new
|
17
|
+
index.call params
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
Binary file
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Ilog
|
2
|
+
module Controllers
|
3
|
+
module Index
|
4
|
+
class Digital
|
5
|
+
include Ilog::Action
|
6
|
+
expose :namespace
|
7
|
+
def set_database database
|
8
|
+
tmp_config = ActiveRecord::Base.connection_config
|
9
|
+
tmp_config[:database] = database
|
10
|
+
ActiveRecord::Base.establish_connection tmp_config
|
11
|
+
end
|
12
|
+
def call(params)
|
13
|
+
@database = Ilog.configuration.namespaces[params[:domain]]
|
14
|
+
self.set_database @database
|
15
|
+
@namespace = params[:domain]
|
16
|
+
req = request.env['HTTP_ACCEPT']
|
17
|
+
if req.include? 'application/json'
|
18
|
+
post = ::Post.find(params[:id])
|
19
|
+
post.namespace = @namespace
|
20
|
+
self.format = :json
|
21
|
+
self.body = post.to_json(:include => ::Post.dimensions + ::Post.groupings, :methods => [:content])
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module Ilog
|
2
|
+
module Controllers
|
3
|
+
module Index
|
4
|
+
class Index
|
5
|
+
include Ilog::Action
|
6
|
+
|
7
|
+
expose :books, :database
|
8
|
+
|
9
|
+
GN = 7 # Golden Number
|
10
|
+
@count = {}
|
11
|
+
|
12
|
+
@posts
|
13
|
+
@stuffs
|
14
|
+
|
15
|
+
def perform function, params, input = nil
|
16
|
+
# @posts = ::Post.send(function, input)
|
17
|
+
# @stuffs = ::Stuff.send(function, input)
|
18
|
+
@posts = ::Post.with_all
|
19
|
+
@stuffs = ::Stuff.with_all
|
20
|
+
|
21
|
+
@posts.merge @stuffs
|
22
|
+
|
23
|
+
@items = @posts.order('timestamps.publish')
|
24
|
+
@items = self.paginate(@items, params)
|
25
|
+
|
26
|
+
@count = {
|
27
|
+
'posts' => @posts.count,
|
28
|
+
'stuffs' => @stuffs.count
|
29
|
+
}
|
30
|
+
|
31
|
+
self.format = :json
|
32
|
+
self.body = {:items => @items, :count => @count}.to_json
|
33
|
+
end
|
34
|
+
|
35
|
+
def set_database database
|
36
|
+
tmp_config = ActiveRecord::Base.connection_config
|
37
|
+
tmp_config[:database] = database
|
38
|
+
ActiveRecord::Base.establish_connection tmp_config
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize
|
42
|
+
puts 'here we go' + Ilog.configuration.namespaces.class.to_s
|
43
|
+
|
44
|
+
@posts = ::Post.all
|
45
|
+
p 'getting posts = ' + @posts.to_s
|
46
|
+
@stuffs = ::Stuff.all
|
47
|
+
end
|
48
|
+
|
49
|
+
def paginate items, params
|
50
|
+
unless params[:page].nil?
|
51
|
+
@page = params[:page]
|
52
|
+
else
|
53
|
+
@page = 0
|
54
|
+
end
|
55
|
+
@items_selected = items.slice( GN * @page.to_i, GN )
|
56
|
+
@last_page = [(items.count / GN).ceil, 1].max
|
57
|
+
def next_page_url
|
58
|
+
if ( @last_page > @page.to_i)
|
59
|
+
return '/index?page=' + (@page.to_i + 1).to_s
|
60
|
+
end
|
61
|
+
end
|
62
|
+
def prev_page_url
|
63
|
+
if (@page != 0)
|
64
|
+
return '/index?page=' + [(@page.to_i - 1), 0].max.to_s
|
65
|
+
else
|
66
|
+
return nil
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
return {
|
71
|
+
'current_page' => @page,
|
72
|
+
'data' => JSON.parse(@items_selected.to_json(:include => ::Post.dimensions + ::Post.groupings, :methods => [:kind, :uniq])),
|
73
|
+
'first_page_url' => '', # $this->url(1),
|
74
|
+
'from' => '', # $this->firstItem(),
|
75
|
+
'last_page' => @last_page, #$this->lastPage(),
|
76
|
+
'last_page_url' => '', #$this->url($this->lastPage()),
|
77
|
+
'next_page_url' => next_page_url,
|
78
|
+
'path' => '', # $this->path(),
|
79
|
+
'per_page' => GN, #$this->perPage(),
|
80
|
+
'prev_page_url' => prev_page_url, #$this->previousPageUrl(),
|
81
|
+
'to' => '', #$this->lastItem(),
|
82
|
+
'total' => items.count,
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
def call(params)
|
88
|
+
@database = Ilog.configuration.namespaces[params[:domain]]
|
89
|
+
self.set_database @database
|
90
|
+
self.perform(:retrive_all, params)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title></title>
|
7
|
+
<meta name="description" content="@stack('description')">
|
8
|
+
<%= stylesheet 'log-style' %>
|
9
|
+
<link href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700&subset=latin-ext" rel="stylesheet">
|
10
|
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
|
11
|
+
<script>
|
12
|
+
Window.Config = {
|
13
|
+
"host": "http://localhost:2300",
|
14
|
+
"title": "My Blog",
|
15
|
+
"profile": { "avatar": "", "author": "", "status": "", "website": "", "email": "", "location": "" },
|
16
|
+
"digital": { "uri": "<%= namespace %>" },
|
17
|
+
"analog": { "uri": "weblog" }
|
18
|
+
};
|
19
|
+
</script>
|
20
|
+
</head>
|
21
|
+
|
22
|
+
<body>
|
23
|
+
<noscript>
|
24
|
+
<!--
|
25
|
+
<header>
|
26
|
+
<h1>
|
27
|
+
<a href="{{ url(config('bp-log.digital.uri'), '') }}">{{ config('bp-log.title')}}</a>
|
28
|
+
<span><a class="inlink" style="font-size: .8rem;" href="{{ url(config('bp-log.analog.uri'), '') }}">static version</a></span>
|
29
|
+
</h1>
|
30
|
+
</header>
|
31
|
+
-->
|
32
|
+
</noscript>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
<div id="bp-log">
|
37
|
+
</div>
|
38
|
+
<%= javascript 'vue-index' %>
|
39
|
+
</body>
|
40
|
+
</html>
|
File without changes
|
File without changes
|
File without changes
|
data/lib/ilog/version.rb
ADDED
Binary file
|