ilog 0.2.0

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.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +6 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +7 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +44 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/ilog.gemspec +29 -0
  13. data/lib/ilog/assets/favicon.ico +0 -0
  14. data/lib/ilog/assets/images/.gitkeep +0 -0
  15. data/lib/ilog/assets/javascripts/.gitkeep +0 -0
  16. data/lib/ilog/assets/javascripts/index.js +60723 -0
  17. data/lib/ilog/assets/javascripts/vue-config.js +92 -0
  18. data/lib/ilog/assets/javascripts/vue-index.js +60725 -0
  19. data/lib/ilog/assets/stylesheets/.gitkeep +0 -0
  20. data/lib/ilog/assets/stylesheets/log-style.css +3858 -0
  21. data/lib/ilog/assets/stylesheets/style.css +3858 -0
  22. data/lib/ilog/config/routes.rb +13 -0
  23. data/lib/ilog/configuration.rb +8 -0
  24. data/lib/ilog/controllers/.gitkeep +0 -0
  25. data/lib/ilog/controllers/digital/show.rb +23 -0
  26. data/lib/ilog/controllers/digital/tags.rb +15 -0
  27. data/lib/ilog/controllers/index/.DS_Store +0 -0
  28. data/lib/ilog/controllers/index/digital.rb +27 -0
  29. data/lib/ilog/controllers/index/index.rb +95 -0
  30. data/lib/ilog/controllers/platform/platform.rb +12 -0
  31. data/lib/ilog/controllers/post/post.rb +12 -0
  32. data/lib/ilog/models/item.rb +5 -0
  33. data/lib/ilog/models/post.rb +9 -0
  34. data/lib/ilog/models/stuff.rb +8 -0
  35. data/lib/ilog/templates/application.html.erb +11 -0
  36. data/lib/ilog/templates/digital/show.html.erb +0 -0
  37. data/lib/ilog/templates/digital/tags.html.erb +0 -0
  38. data/lib/ilog/templates/index/digital.html.erb +40 -0
  39. data/lib/ilog/templates/index/index.html.haml +10 -0
  40. data/lib/ilog/templates/index/vue.html.erb +0 -0
  41. data/lib/ilog/templates/platform/platform.html.erb +0 -0
  42. data/lib/ilog/templates/post/post.html.erb +0 -0
  43. data/lib/ilog/version.rb +3 -0
  44. data/lib/ilog/views/application_layout.rb +7 -0
  45. data/lib/ilog/views/digital/show.rb +9 -0
  46. data/lib/ilog/views/digital/tags.rb +9 -0
  47. data/lib/ilog/views/index/.DS_Store +0 -0
  48. data/lib/ilog/views/index/digital.rb +10 -0
  49. data/lib/ilog/views/index/index.rb +10 -0
  50. data/lib/ilog/views/platform/platform.rb +9 -0
  51. data/lib/ilog/views/post/post.rb +9 -0
  52. data/lib/ilog.rb +331 -0
  53. data/mix-manifest.json +5 -0
  54. data/package.json +40 -0
  55. data/src/js/vue-config.js +7 -0
  56. data/src/sass/.DS_Store +0 -0
  57. data/src/sass/_variables.scss +3 -0
  58. data/src/sass/components/.DS_Store +0 -0
  59. data/src/sass/components/article-text.scss +223 -0
  60. data/src/sass/components/card.scss +33 -0
  61. data/src/sass/components/post.scss +5 -0
  62. data/src/sass/components/selectize.scss +324 -0
  63. data/src/sass/components/single.scss +80 -0
  64. data/src/sass/components/tag.scss +46 -0
  65. data/src/sass/fonts/headings.scss +105 -0
  66. data/src/sass/fonts/pure.scss +29 -0
  67. data/src/sass/libs/selectize.scss +8 -0
  68. data/src/sass/log/.DS_Store +0 -0
  69. data/src/sass/log/base.scss +132 -0
  70. data/src/sass/log/grid.scss +82 -0
  71. data/src/sass/log/instagram-header.scss +123 -0
  72. data/src/sass/log/list.scss +242 -0
  73. data/src/sass/log/style.scss +3 -0
  74. data/src/sass/log/treestyle-addons.scss +102 -0
  75. data/src/sass/log/treestyle.scss +163 -0
  76. data/src/sass/style.scss +28 -0
  77. data/src/vue/Log.vue +257 -0
  78. data/src/vue/components/.DS_Store +0 -0
  79. data/src/vue/components/Item.vue +46 -0
  80. data/src/vue/components/Modal.vue +27 -0
  81. data/src/vue/components/Post.vue +125 -0
  82. data/src/vue/components/PostBody.vue +86 -0
  83. data/src/vue/components/Stuff.vue +63 -0
  84. data/src/vue/configs/app.js +5 -0
  85. data/src/vue/configs/axios.js +14 -0
  86. data/src/vue/elements/People.vue +75 -0
  87. data/src/vue/elements/Profile.vue +63 -0
  88. data/src/vue/elements/Tunekit.vue +82 -0
  89. data/src/vue/index.js +30 -0
  90. data/src/vue/router.js +50 -0
  91. data/src/vue/views/.DS_Store +0 -0
  92. data/src/vue/views/Introduction.vue +88 -0
  93. data/src/vue/views/List.vue +46 -0
  94. data/src/vue/views/Post.vue +163 -0
  95. data/webpack.mix.js +6 -0
  96. 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'
@@ -0,0 +1,8 @@
1
+ module Ilog
2
+ class Configuration
3
+ attr_accessor :namespaces
4
+ def initialize
5
+ @namespaces = {}
6
+ end
7
+ end
8
+ end
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
@@ -0,0 +1,15 @@
1
+ module Ilog
2
+ module Controllers
3
+ module Digital
4
+ class Tags
5
+ include Ilog::Action
6
+
7
+ def call(params)
8
+ keywords = ::Keyword.all
9
+ self.format = :json
10
+ self.body = keywords.to_json
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -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
@@ -0,0 +1,12 @@
1
+ module Ilog
2
+ module Controllers
3
+ module Platform
4
+ class Platform
5
+ include Ilog::Action
6
+
7
+ def call(params)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module Ilog
2
+ module Controllers
3
+ module Post
4
+ class Post
5
+ include Ilog::Action
6
+
7
+ def call(params)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Item
2
+ def self.retrive_all
3
+ return self::with_all.all
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'iatelier/models/book'
2
+ require_relative 'Item'
3
+
4
+ class Post < Book
5
+ include Item
6
+ @@dimensions = ['title', 'slug', 'timestamp']
7
+ @@groupings = ['peoples', 'keywords']
8
+ @@roles = ['mention']
9
+ end
@@ -0,0 +1,8 @@
1
+ require 'iatelier/models/book'
2
+
3
+ class Stuff < Book
4
+ include Item
5
+ @@dimensions = ['title', 'slug', 'timestamp']
6
+ @@groupings = ['peoples', 'keywords']
7
+ @@roles = ['mention', 'author']
8
+ end
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Ilog</title>
5
+ <%= favicon %>
6
+ </head>
7
+ <body>
8
+ <h1>Helloe</h1>
9
+ <%= yield %>
10
+ </body>
11
+ </html>
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&amp;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>
@@ -0,0 +1,10 @@
1
+ %table
2
+ %tr
3
+ %th ID
4
+ %th Title
5
+ %th Slug
6
+ - books.each do |book|
7
+ %tr
8
+ %td= book.id
9
+ %td= book.title.value
10
+ %td= book.slug.try(:value)
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ module Ilog
2
+ VERSION = "0.2.0"
3
+ end
@@ -0,0 +1,7 @@
1
+ module Ilog
2
+ module Views
3
+ class ApplicationLayout
4
+ include Ilog::Layout
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ module Ilog
2
+ module Views
3
+ module Digital
4
+ class Show
5
+ include Ilog::View
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Ilog
2
+ module Views
3
+ module Digital
4
+ class Tags
5
+ include Ilog::View
6
+ end
7
+ end
8
+ end
9
+ end
Binary file
@@ -0,0 +1,10 @@
1
+ module Ilog
2
+ module Views
3
+ module Index
4
+ class Digital
5
+ include Ilog::View
6
+ layout false
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Ilog
2
+ module Views
3
+ module Index
4
+ class Index
5
+ include Ilog::View
6
+
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Ilog
2
+ module Views
3
+ module Platform
4
+ class Platform
5
+ include Ilog::View
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Ilog
2
+ module Views
3
+ module Post
4
+ class Post
5
+ include Ilog::View
6
+ end
7
+ end
8
+ end
9
+ end