jinda 0.7.5.0 → 0.7.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/images/gears.png +0 -0
- data/lib/generators/jinda/config_generator.rb +2 -1
- data/lib/generators/jinda/install_generator.rb +52 -55
- data/lib/generators/jinda/installer/gemfiles-org/custom_gems.rb +8 -0
- data/lib/generators/jinda/installer/gemfiles-org/dev_gems.rb +20 -0
- data/lib/generators/jinda/installer/gemfiles-org/runtime_gems.rb +30 -0
- data/lib/generators/jinda/installer/gemfiles-org/todo.md +3 -0
- data/lib/generators/jinda/installer/gems_install.rb +132 -0
- data/lib/generators/jinda/installer/test.rb +6 -0
- data/lib/generators/jinda/templates/README.md +2 -2
- data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +3 -1
- data/lib/generators/jinda/templates/app/controllers/jinda_org/users_controller.rb +1 -0
- data/lib/generators/jinda/templates/app/views/articles/_report.haml +8 -0
- data/lib/generators/jinda/templates/app/views/articles/show.html.haml +20 -9
- data/lib/generators/jinda/templates/app/views/users/user/enter_user.html.erb +2 -0
- data/lib/jinda/themes.rb +10 -3
- data/lib/jinda/version.rb +1 -1
- data/lib/tasks/jinda.rake +14 -5
- metadata +24 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2dab3c1ee5e525bfce90630e720c8e45cd79da38196853f29df66db25d50526
|
4
|
+
data.tar.gz: af80a165a501ceffb2e150dbf3b1ecdb2647d14ebef721ef3392364deb1bfdaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e01c9a5848758ba074e0e78b0cfdf3b917a47aeacca3b64e31338cc6a48eff49b10f36dbe9cce21a12caffcddb0429d00dad2b7b0e328459acd44b0581d809dd
|
7
|
+
data.tar.gz: f5e7603baf72c5f85f413daf9ce47ec66e14d465ac0444e9006153d6e76626262bbefdfee06526dbe8619a317b722e3e4e60f7dbf59e77e31b57bbb30fad06f4
|
Binary file
|
@@ -8,7 +8,7 @@ module Jinda
|
|
8
8
|
def backup_files
|
9
9
|
st=" "
|
10
10
|
# inside("config/initializers") {(File.file? "omniauth.rb") ? (FileUtils.mv "omniauth.rb", "omniauth.rb.bak") : (puts "new omniauth.rb created")}
|
11
|
-
inside("config") {(File.file? "mongoid.
|
11
|
+
# inside("config/initializers") {(File.file? "mongoid.rb") ? (FileUtils.mv "mongoid.rb", "omniauth.rb.bak") : (puts "new mongoid.rb created")}
|
12
12
|
(File.file? ".env") ? (FileUtils.mv ".env", ".env-bak") : (puts "backup .env")
|
13
13
|
end
|
14
14
|
desc "gen_image_store"
|
@@ -49,6 +49,7 @@ module Jinda
|
|
49
49
|
inject_into_file 'config/mongoid.yml', :after => ' # raise_not_found_error: true' do
|
50
50
|
"\n raise_not_found_error: false"
|
51
51
|
end
|
52
|
+
|
52
53
|
inject_into_file 'config/mongoid.yml', :after => ' # belongs_to_required_by_default: true' do
|
53
54
|
"\n belongs_to_required_by_default: false"
|
54
55
|
end
|
@@ -5,10 +5,9 @@ module Jinda
|
|
5
5
|
def self.source_root
|
6
6
|
File.dirname(__FILE__) + "/templates"
|
7
7
|
end
|
8
|
-
|
9
8
|
def setup_gems
|
10
|
-
#
|
11
|
-
|
9
|
+
# define required gems: jinda_gem, jinda_dev_gem
|
10
|
+
jinda_gem =
|
12
11
|
[
|
13
12
|
["bson", "4.4.2"],
|
14
13
|
["maruku", "~> 0.7.3"],
|
@@ -36,17 +35,16 @@ module Jinda
|
|
36
35
|
["cloudinary", "1.13.2"],
|
37
36
|
["kaminari", "1.2.0"],
|
38
37
|
["jquery-rails", "4.3.5"]
|
39
|
-
|
40
|
-
|
38
|
+
]
|
39
|
+
|
41
40
|
jinda_custom =
|
42
41
|
[
|
43
42
|
["mongoid-paperclip", require: "mongoid_paperclip"],
|
44
43
|
["kaminari-mongoid", "1.0.1"],
|
45
44
|
["nokogiri", "~> 1.11.0"],
|
46
|
-
["mongoid", git: "git@github.com:kul1/mongoid
|
47
|
-
# ["mongoid", "~> 7.1.0"]
|
45
|
+
["mongoid", git: "git@github.com:kul1/mongoid.git"]
|
48
46
|
]
|
49
|
-
|
47
|
+
|
50
48
|
jinda_dev_gem =
|
51
49
|
[
|
52
50
|
["shoulda"],
|
@@ -67,28 +65,28 @@ module Jinda
|
|
67
65
|
["faker"]
|
68
66
|
]
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
68
|
+
# Check each jinda_gem and create new array if found one otherwise just create.
|
69
|
+
# Open Gemfile add gem if not exist
|
70
|
+
jinda_gem.each do |g|
|
71
|
+
unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
|
72
|
+
if g.count == 2
|
73
|
+
gem g[0], g[1]
|
74
|
+
else
|
75
|
+
gem g[0]
|
76
|
+
end
|
77
|
+
else
|
78
|
+
if g.count == 2
|
79
|
+
xgem_0 = %x(gem list -e #{g[0]})
|
80
|
+
unless xgem_0.include?(("#{g[1]}").gsub(/[~> ]/, ''))
|
81
|
+
say " Found existing #{xgem_0} in Gemfile or System, Please edit Gemfile", :red
|
82
|
+
gem g[0], g[1]
|
83
|
+
else
|
84
|
+
say " Checking #{g[0]} found Ver. #{g[1]} already exist in Gemfile", :green
|
85
|
+
end
|
86
|
+
end
|
87
|
+
say " SKIP adding #{g[0]} in Gemfile", :yellow
|
88
|
+
end
|
89
|
+
end
|
92
90
|
|
93
91
|
# create list of gem in sub-group dev and test
|
94
92
|
jinda_dev_new = Array.new
|
@@ -111,28 +109,27 @@ module Jinda
|
|
111
109
|
end
|
112
110
|
end
|
113
111
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
112
|
+
# create list of custom gem
|
113
|
+
jinda_custom_new = Array.new
|
114
|
+
jinda_custom.each do |g|
|
115
|
+
unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
|
116
|
+
jinda_custom_new << g
|
117
|
+
else
|
118
|
+
say " #{g[0]} already exist in Gemfile", :yellow
|
119
|
+
end
|
120
|
+
end
|
121
|
+
unless jinda_custom_new.count == 0
|
122
|
+
jinda_custom_new.each do |c|
|
123
|
+
say " Checking if #{c[0]} already exist in Gemfile", :yellow
|
124
|
+
if c.count == 1
|
125
|
+
gem c[0]
|
126
|
+
else
|
127
|
+
gem c[0], c[1]
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
134
132
|
end
|
135
|
-
|
136
133
|
def setup_app
|
137
134
|
# inside("public") { run "FileUtils.mv index.html index.html.bak" }
|
138
135
|
inside("db") {(File.file? "seeds.rb") ? (FileUtils.mv "seeds.rb", "seeds.rb.bak") : ( say "no seeds.rb", :green)}
|
@@ -223,8 +220,8 @@ IMAGE_LOCATION = "upload"
|
|
223
220
|
end
|
224
221
|
# Move mongoid.rb to jinda:config
|
225
222
|
# To avoid repeate install jinda:install crash
|
226
|
-
|
227
|
-
|
223
|
+
initializer "mongoid.rb" do
|
224
|
+
%q{# encoding: utf-8
|
228
225
|
#
|
229
226
|
# Mongoid 6 follows the new pattern of AR5 requiring a belongs_to relation to always require its parent
|
230
227
|
# belongs_to` will now trigger a validation error by default if the association is not present.
|
@@ -233,8 +230,8 @@ IMAGE_LOCATION = "upload"
|
|
233
230
|
# `config.active_record.belongs_to_required_by_default = true` in initializer.)
|
234
231
|
#
|
235
232
|
Mongoid::Config.belongs_to_required_by_default = false
|
236
|
-
|
237
|
-
|
233
|
+
}
|
234
|
+
end
|
238
235
|
|
239
236
|
inject_into_file 'config/environment.rb', :after => "initialize!" do
|
240
237
|
"\n\n# hack to fix cloudinary error https://github.com/archiloque/rest-client/issues/141" +
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@dev_gems = Array.new
|
2
|
+
@dev_gems =
|
3
|
+
[
|
4
|
+
["shoulda"],
|
5
|
+
["rspec"],
|
6
|
+
["rspec-rails"],
|
7
|
+
["better_errors"],
|
8
|
+
["binding_of_caller"],
|
9
|
+
["pry-byebug"],
|
10
|
+
["factory_bot_rails"],
|
11
|
+
["database_cleaner"],
|
12
|
+
["guard"],
|
13
|
+
["guard-rspec"],
|
14
|
+
["guard-minitest"],
|
15
|
+
["capybara"],
|
16
|
+
["selenium-webdriver"],
|
17
|
+
["rb-fsevent"],
|
18
|
+
["valid_attribute"],
|
19
|
+
["faker"]
|
20
|
+
]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# @runtime_gems = Array.new
|
2
|
+
@@runtime_gems =
|
3
|
+
[
|
4
|
+
["bson", "4.4.2"],
|
5
|
+
["maruku", "~> 0.7.3"],
|
6
|
+
["bcrypt"],
|
7
|
+
["rouge"],
|
8
|
+
["normalize-rails"],
|
9
|
+
["font-awesome-rails"],
|
10
|
+
["font-awesome-sass", "~> 5.12.0"],
|
11
|
+
["meta-tags"],
|
12
|
+
["jquery-turbolinks", "2.1.0"],
|
13
|
+
["mongo", "2.11.3"],
|
14
|
+
["turbolinks_render"],
|
15
|
+
["haml-rails", "~> 2.0.1"],
|
16
|
+
["haml", "~> 5.1", ">= 5.1.2"],
|
17
|
+
["mail"],
|
18
|
+
["prawn"],
|
19
|
+
["redcarpet"],
|
20
|
+
["oauth2", "1.4.4"],
|
21
|
+
["omniauth", "1.9.1"],
|
22
|
+
["omniauth-oauth2", "1.6.0"],
|
23
|
+
["omniauth-identity", "~> 1.1.1"],
|
24
|
+
["omniauth-facebook", "6.0.0"],
|
25
|
+
["omniauth-google-oauth2", "0.8.0"],
|
26
|
+
["dotenv-rails"],
|
27
|
+
["cloudinary", "1.13.2"],
|
28
|
+
["kaminari", "1.2.0"],
|
29
|
+
["jquery-rails", "4.3.5"]
|
30
|
+
]
|
@@ -0,0 +1,132 @@
|
|
1
|
+
def setup_gems
|
2
|
+
# # define required gems: jinda_gem, jinda_dev_gem
|
3
|
+
jinda_gem =
|
4
|
+
[
|
5
|
+
["bson", "4.4.2"],
|
6
|
+
["maruku", "~> 0.7.3"],
|
7
|
+
["bcrypt"],
|
8
|
+
["rouge"],
|
9
|
+
["normalize-rails"],
|
10
|
+
["font-awesome-rails"],
|
11
|
+
["font-awesome-sass", "~> 5.12.0"],
|
12
|
+
["meta-tags"],
|
13
|
+
["jquery-turbolinks", "2.1.0"],
|
14
|
+
["mongo", "2.11.3"],
|
15
|
+
["turbolinks_render"],
|
16
|
+
["haml-rails", "~> 2.0.1"],
|
17
|
+
["haml", "~> 5.1", ">= 5.1.2"],
|
18
|
+
["mail"],
|
19
|
+
["prawn"],
|
20
|
+
["redcarpet"],
|
21
|
+
["oauth2", "1.4.4"],
|
22
|
+
["omniauth", "1.9.1"],
|
23
|
+
["omniauth-oauth2", "1.6.0"],
|
24
|
+
["omniauth-identity", "~> 1.1.1"],
|
25
|
+
["omniauth-facebook", "6.0.0"],
|
26
|
+
["omniauth-google-oauth2", "0.8.0"],
|
27
|
+
["dotenv-rails"],
|
28
|
+
["cloudinary", "1.13.2"],
|
29
|
+
["kaminari", "1.2.0"],
|
30
|
+
["jquery-rails", "4.3.5"]
|
31
|
+
]
|
32
|
+
#
|
33
|
+
jinda_custom_gem =
|
34
|
+
[
|
35
|
+
["mongoid-paperclip", require: "mongoid_paperclip"],
|
36
|
+
["kaminari-mongoid", "1.0.1"],
|
37
|
+
["nokogiri", "~> 1.11.0"],
|
38
|
+
["mongoid", git: "git@github.com:kul1/mongoid-jinda.git"]
|
39
|
+
# ["mongoid", "~> 7.1.0"]
|
40
|
+
]
|
41
|
+
#
|
42
|
+
jinda_dev_gem =
|
43
|
+
[
|
44
|
+
["shoulda"],
|
45
|
+
["rspec"],
|
46
|
+
["rspec-rails"],
|
47
|
+
["better_errors"],
|
48
|
+
["binding_of_caller"],
|
49
|
+
["pry-byebug"],
|
50
|
+
["factory_bot_rails"],
|
51
|
+
["database_cleaner"],
|
52
|
+
["guard"],
|
53
|
+
["guard-rspec"],
|
54
|
+
["guard-minitest"],
|
55
|
+
["capybara"],
|
56
|
+
["selenium-webdriver"],
|
57
|
+
["rb-fsevent"],
|
58
|
+
["valid_attribute"],
|
59
|
+
["faker"]
|
60
|
+
]
|
61
|
+
|
62
|
+
# Check each jinda_gem and create new array if found one otherwise just create.
|
63
|
+
# Open Gemfile add gem if not exist
|
64
|
+
jinda_gem.each do |g|
|
65
|
+
unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
|
66
|
+
if g.count == 2
|
67
|
+
gem g[0], g[1]
|
68
|
+
else
|
69
|
+
gem g[0]
|
70
|
+
end
|
71
|
+
else
|
72
|
+
if g.count == 2
|
73
|
+
xgem_0 = %x(gem list -e #{g[0]})
|
74
|
+
unless xgem_0.include?(("#{g[1]}").gsub(/[~> ]/, ''))
|
75
|
+
# puts " Found existing #{xgem_0} in Gemfile or System, Please edit Gemfile", :red
|
76
|
+
puts " Found existing #{xgem_0} in Gemfile or System, Please edit Gemfile"
|
77
|
+
gem g[0], g[1]
|
78
|
+
else
|
79
|
+
# puts " Checking #{g[0]} found Ver. #{g[1]} already exist in Gemfile", :green
|
80
|
+
puts " Checking #{g[0]} found Ver. #{g[1]} already exist in Gemfile"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
# puts " SKIP adding #{g[0]} in Gemfile", :yellow
|
84
|
+
puts " SKIP adding #{g[0]} in Gemfile"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# create list of gem in sub-group dev and test
|
89
|
+
jinda_dev_new = Array.new
|
90
|
+
jinda_dev_gem.each do |g|
|
91
|
+
unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
|
92
|
+
jinda_dev_new << g
|
93
|
+
else
|
94
|
+
# puts " #{g[0]} already exist in Gemfile", :yellow
|
95
|
+
puts " #{g[0]} already exist in Gemfile"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
unless jinda_dev_new.count == 0
|
99
|
+
gem_group :development, :test do
|
100
|
+
jinda_dev_new.each do |n|
|
101
|
+
if n.count == 1
|
102
|
+
gem n[0]
|
103
|
+
else
|
104
|
+
gem n[0], n[1]
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# create list of custom gem
|
111
|
+
jinda_custom_new = Array.new
|
112
|
+
jinda_custom_gem.each do |g|
|
113
|
+
# unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
|
114
|
+
unless File.read("Gemfile").include?("#{g[0]}, #{g[1]}")
|
115
|
+
jinda_custom_new << g
|
116
|
+
else
|
117
|
+
puts " #{g[0]} already exist in Gemfile", :yellow
|
118
|
+
puts " #{g[0]} already exist in Gemfile", :yellow
|
119
|
+
end
|
120
|
+
end
|
121
|
+
unless jinda_custom_new.count == 0
|
122
|
+
jinda_custom_new.each do |c|
|
123
|
+
# puts " Checking if #{c[0]} already exist in Gemfile", :yellow
|
124
|
+
puts " Checking if #{c[0]} already exist in Gemfile"
|
125
|
+
if c.count == 1
|
126
|
+
gem c[0]
|
127
|
+
else
|
128
|
+
gem c[0], c[1]
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -16,7 +16,7 @@ Rails Application Generator using Freemind
|
|
16
16
|
These versions works for sure but others may do.
|
17
17
|
|
18
18
|
* Ruby 2.7.0
|
19
|
-
* Rails 6.0.
|
19
|
+
* Rails 6.0.3
|
20
20
|
* MongoDB 6
|
21
21
|
* Freemind 1.0.1
|
22
22
|
|
@@ -36,7 +36,7 @@ app without ActiveRecord
|
|
36
36
|
|
37
37
|
## Add jinda to your Gemfile:
|
38
38
|
|
39
|
-
gem 'jinda'
|
39
|
+
gem 'jinda'
|
40
40
|
|
41
41
|
For Development (most updated)
|
42
42
|
|
@@ -15,7 +15,9 @@ class ArticlesController < ApplicationController
|
|
15
15
|
@article = Article.find(article_params)
|
16
16
|
@commentable = @article
|
17
17
|
@comments = @commentable.comments.desc(:created_at).page(params[:page]).per(10)
|
18
|
-
|
18
|
+
@user = User.find(@article.user_id)
|
19
|
+
@show = Hash.new
|
20
|
+
@show = {:article => @article, :comments => @comments, :user => @user}
|
19
21
|
prepare_meta_tags(title: @article.title,
|
20
22
|
description: @article.text,
|
21
23
|
keywords: @article.keywords)
|
@@ -9,6 +9,7 @@ class UsersController < ApplicationController
|
|
9
9
|
def update_user
|
10
10
|
# can't use session, current_ma_user inside jinda methods
|
11
11
|
$user.update_attribute :email, $xvars["enter_user"]["user"]["email"]
|
12
|
+
$user.update_attribute :image, $xvars["enter_user"]["user"]["image"]
|
12
13
|
end
|
13
14
|
def change_password
|
14
15
|
# check if old password correct
|
@@ -11,6 +11,9 @@
|
|
11
11
|
%table.table.no-margin
|
12
12
|
%thead
|
13
13
|
%tr
|
14
|
+
- unless current_ma_user.nil?
|
15
|
+
- if current_ma_user.role.include?"A"
|
16
|
+
%th Author
|
14
17
|
%th Title
|
15
18
|
%th Description
|
16
19
|
%th Created
|
@@ -18,7 +21,12 @@
|
|
18
21
|
%th Delete
|
19
22
|
%th Edit
|
20
23
|
- report.each do |article|
|
24
|
+
- user = User.find(article.user_id)
|
21
25
|
%tr
|
26
|
+
-# if current_ma_user.role.include?"A"
|
27
|
+
- unless current_ma_user.nil?
|
28
|
+
- if current_ma_user.role.include?"A"
|
29
|
+
%td= user.code
|
22
30
|
%td= link_to article.title, :controller=>"articles", :action=>"show", :article_id => article.id
|
23
31
|
%td= article.text.html_safe
|
24
32
|
%td= article.created_at.strftime('%m/%d/%Y')
|
@@ -1,23 +1,34 @@
|
|
1
|
-
- title @article
|
2
|
-
- description @article
|
3
|
-
- keywords @article
|
1
|
+
- title @show[:article][:title]
|
2
|
+
- description @show[:article][:text]
|
3
|
+
- keywords @show[:article][:keywords]
|
4
4
|
.container
|
5
5
|
%div.row::before
|
6
6
|
%div.col-md-12
|
7
7
|
.row-description
|
8
8
|
%h2.display-3.mt-5.pt-5
|
9
|
-
= @article
|
9
|
+
= @show[:article][:title]
|
10
10
|
= link_to image_tag('pencil.png', style:'border:none; float:right;', id: 'article_pen'), {controller: "articles", action: "edit", article_id: @article.id}, data: { confirm: "Please Confirm" }
|
11
|
+
%div.font-weight-light
|
12
|
+
by
|
13
|
+
%img.img-circle{:alt => "User Image", src: @show[:user][:image] }/
|
14
|
+
%div.font-weight-light
|
15
|
+
= @show[:user][:code]
|
16
|
+
%div.font-weight-light
|
17
|
+
= @show[:article][:created_at]
|
11
18
|
%hr
|
12
|
-
= @article
|
19
|
+
= @show[:article][:text]
|
13
20
|
%h4.row-body
|
14
|
-
= @article
|
21
|
+
= @show[:article][:body].html_safe
|
15
22
|
%hr
|
16
|
-
- @comments.each do |comment|
|
23
|
+
- @show[:comments].each do |comment|
|
17
24
|
%div#article-comment.ui-corner-all
|
18
25
|
.col-md-12
|
19
26
|
%div.small-box.bg-white.text-info
|
20
27
|
%div.inner
|
28
|
+
%div.font-weight-light
|
29
|
+
- user_image = get_user_image(comment.user_id)
|
30
|
+
%img.comment-user-image{:alt => "User Image", src: user_image}/
|
31
|
+
|
21
32
|
%div.font-weight-light
|
22
33
|
Author:
|
23
34
|
%b= comment.name if comment.name
|
@@ -30,9 +41,9 @@
|
|
30
41
|
%hr
|
31
42
|
%h4.col-md-12
|
32
43
|
Add a comment:
|
33
|
-
= form_with(model: [@article, Comment.new], local: true) do |f|
|
44
|
+
= form_with(model: [@show[:article], Comment.new], local: true) do |f|
|
34
45
|
.form-group
|
35
|
-
= f.hidden_field :article_id, :value => @article
|
46
|
+
= f.hidden_field :article_id, :value => @show[:article][:id]
|
36
47
|
.form-group
|
37
48
|
= f.label :body, "Comment"
|
38
49
|
.form-group
|
data/lib/jinda/themes.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# ##########################################################################
|
7
7
|
def get_login_user_info
|
8
8
|
if current_ma_user.present?
|
9
|
-
$user_image = current_ma_user.image
|
9
|
+
$user_image = ((current_ma_user.image != "") ? current_ma_user.image : asset_url("user.png", :width => "48"))
|
10
10
|
$user_name = current_ma_user.code
|
11
11
|
$user_email = current_ma_user.email
|
12
12
|
$user_id = current_ma_user.try(:id)
|
@@ -18,6 +18,13 @@ def get_login_user_info
|
|
18
18
|
end
|
19
19
|
return $user_image, $user_name, $user_email,$user_id
|
20
20
|
end
|
21
|
+
# search image from User in Article/View/Show
|
22
|
+
def get_user_image(user_id)
|
23
|
+
user_image = User.find(user_id).image
|
24
|
+
user_image = ((user_image != "") ? user_image : asset_url("user.png", :width => "48"))
|
25
|
+
return user_image
|
26
|
+
end
|
27
|
+
|
21
28
|
|
22
29
|
def name2code(s)
|
23
30
|
# rather not ignore # symbol cause it could be comment
|
@@ -91,8 +98,8 @@ def markdown(text)
|
|
91
98
|
flash[:notice] = "This ruby version not support #{error}"
|
92
99
|
return
|
93
100
|
end
|
94
|
-
|
95
|
-
|
101
|
+
red = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
|
102
|
+
red.render(erbified).html_safe
|
96
103
|
end
|
97
104
|
def align_text(s, pixel=3)
|
98
105
|
"<span style='position:relative; top:-#{pixel}px;'>#{s}</span>".html_safe
|
data/lib/jinda/version.rb
CHANGED
data/lib/tasks/jinda.rake
CHANGED
@@ -16,11 +16,20 @@ namespace :jinda do
|
|
16
16
|
|
17
17
|
desc "generate admin user"
|
18
18
|
task :seed=> :environment do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
usamples = [
|
20
|
+
{ code: 'admin', password: 'secret', email: 'admin@test.com', role: 'M,A,D', image: 'https://user-images.githubusercontent.com/3953832/110025024-7911b480-7cf4-11eb-83ee-8dbe6e8fc96f.png'},
|
21
|
+
{ code: 'tester', password: 'password', email: 'tester@test.com', role: 'M', image: 'https://www.manateeschools.net/cms/lib/FL02202357/Centricity/domain/2439/staff_photos/fflinststone.jpg'}
|
22
|
+
]
|
23
|
+
usamples.each do |h|
|
24
|
+
code = h[:code].to_s
|
25
|
+
email = h[:email].to_s
|
26
|
+
password = h[:password].to_s
|
27
|
+
role = h[:role].to_s
|
28
|
+
image = h[:image]
|
29
|
+
unless Identity.where(code: code).exists?
|
30
|
+
identity= Identity.create :code => code, :email => email, :password => password , :password_confirmation => password
|
31
|
+
User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,:email => identity.email, :role => role, :image => image
|
32
|
+
end
|
24
33
|
end
|
25
34
|
end
|
26
35
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jinda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.5.
|
4
|
+
version: 0.7.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prateep Kul
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -45,6 +45,20 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 4.1.11
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: mongoid
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 7.1.0
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 7.1.0
|
48
62
|
description: 'Generate Rails workflow from mind map: Freemind'
|
49
63
|
email:
|
50
64
|
- 1.0@kul.asia
|
@@ -147,6 +161,7 @@ files:
|
|
147
161
|
- app/assets/stylesheets/images/button_black.png
|
148
162
|
- app/assets/stylesheets/images/button_blue.png
|
149
163
|
- app/assets/stylesheets/images/button_red.png
|
164
|
+
- app/assets/stylesheets/images/gears.png
|
150
165
|
- app/assets/stylesheets/images/icons-18-black.png
|
151
166
|
- app/assets/stylesheets/images/icons-18-white.png
|
152
167
|
- app/assets/stylesheets/images/icons-36-black.png
|
@@ -198,6 +213,12 @@ files:
|
|
198
213
|
- lib/generators/jinda/USAGE
|
199
214
|
- lib/generators/jinda/config_generator.rb
|
200
215
|
- lib/generators/jinda/install_generator.rb
|
216
|
+
- lib/generators/jinda/installer/gemfiles-org/custom_gems.rb
|
217
|
+
- lib/generators/jinda/installer/gemfiles-org/dev_gems.rb
|
218
|
+
- lib/generators/jinda/installer/gemfiles-org/runtime_gems.rb
|
219
|
+
- lib/generators/jinda/installer/gemfiles-org/todo.md
|
220
|
+
- lib/generators/jinda/installer/gems_install.rb
|
221
|
+
- lib/generators/jinda/installer/test.rb
|
201
222
|
- lib/generators/jinda/minitest_generator.rb
|
202
223
|
- lib/generators/jinda/rspec_generator.rb
|
203
224
|
- lib/generators/jinda/templates/Dockerfile
|
@@ -452,7 +473,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
452
473
|
- !ruby/object:Gem::Version
|
453
474
|
version: '0'
|
454
475
|
requirements: []
|
455
|
-
rubygems_version: 3.
|
476
|
+
rubygems_version: 3.2.3
|
456
477
|
signing_key:
|
457
478
|
specification_version: 4
|
458
479
|
summary: 'Rails workflow from mind map: Freemind'
|