jinda 0.7.0.2 → 0.7.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 208dd497ab7ce9c92f2c9a5f2bb026f54910a3c50fc03524d293786612bf6adb
4
- data.tar.gz: 99ff66052567c2ee43f7958b37397898c468b853f74aa875f581728eec03fce7
3
+ metadata.gz: 2ed59d0a776091a540cfb3dc8529d9ddb11c0ca4f94cdf40b277957432d300a1
4
+ data.tar.gz: 7e5d9f3308145ee6241c0aca617325e62068571111c22de905119043acaf61ac
5
5
  SHA512:
6
- metadata.gz: cb56e25fc2e5b5a9bad7965cc1770f99d916c0d268c41fc62f4199f56524f79f2ef3a676401f276baa45b4269d57fe34d3663f7196a6985abcbf6edbe94229f9
7
- data.tar.gz: 182db553efc2c9c5a214b954e64c139eef9eec6ec2c6f53b46c742e1d36414beace3042c29037eed9045e879caa86acfca4681e7c3f41e067834bdbc3f88d5c6
6
+ metadata.gz: 7265365e8f612ee25707ae76c080b61790b458023d9953179ae43e91e5e779d67baedaa91c37694c34da4d74b159e5f25849ede86d3ec9e2fa4f54961cd97762
7
+ data.tar.gz: 6bb86d8ef01fd4346214acab6de8395293d1c8d18771495db4378ba97cbdecd22ba36e4dbe0de9c9ca05adf497ed56fb3a55a23c1ccefec1d647fe45e214e1fa
data/README.md CHANGED
@@ -15,7 +15,7 @@ Rails Application Generator using Freemind
15
15
  These versions works for sure but others may do.
16
16
 
17
17
  * Ruby 2.7.1
18
- * Rails 6.0.3
18
+ * Rails 6.1.0
19
19
  * MongoDB 6
20
20
  * Freemind 1.0.1
21
21
 
@@ -1,3 +1,4 @@
1
+ // jinda.scss from jinda/app engine
1
2
  #tooltip{
2
3
  position:absolute;
3
4
  border:1px solid #333;
@@ -56,17 +57,129 @@
56
57
  padding: 15px;
57
58
  margin: auto;
58
59
  display: block;
59
-
60
+
60
61
  }
61
62
 
62
63
  #logreg-forms{
63
- width:412px;
64
- margin:10vh auto;
65
- background-color:#f3f3f3;
66
- box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
64
+ width:412px;
65
+ margin:10vh auto;
66
+ background-color:#f3f3f3;
67
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
67
68
  transition: all 0.3s cubic-bezier(.25,.8,.25,1);
68
69
  }
69
70
 
70
71
  .module-table{
71
72
  display: grid;
72
73
  }
74
+
75
+ body {
76
+ background: #dfe7e9;
77
+ font-family: 'Roboto', sans-serif;
78
+ }
79
+ .form-control {
80
+ font-size: 16px;
81
+ transition: all 0.4s;
82
+ box-shadow: none;
83
+ }
84
+ .form-control:focus {
85
+ border-color: #5cb85c;
86
+ }
87
+ .form-control, .btn {
88
+ border-radius: 50px;
89
+ outline: none !important;
90
+ }
91
+ .form-group input {
92
+ border-width: 0px;
93
+ }
94
+ .signup-form {
95
+ width: 480px;
96
+ margin: 0 auto;
97
+ padding: 30px 0;
98
+ }
99
+ .signup-form form {
100
+ border-radius: 5px;
101
+ margin-bottom: 20px;
102
+ background: #fff;
103
+ box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
104
+ padding: 40px;
105
+ }
106
+ .signup-form a {
107
+ color: #5cb85c;
108
+ }
109
+ .signup-form h2 {
110
+ text-align: center;
111
+ font-size: 34px;
112
+ margin: 10px 0 15px;
113
+ }
114
+ .signup-form .hint-text {
115
+ color: #999;
116
+ text-align: center;
117
+ margin-bottom: 20px;
118
+ }
119
+ .signup-form .form-group {
120
+ margin-bottom: 20px;
121
+ }
122
+ .signup-form .btn {
123
+ font-size: 18px;
124
+ line-height: 26px;
125
+ font-weight: bold;
126
+ text-align: center;
127
+ }
128
+ .signup-btn {
129
+ text-align: center;
130
+ border-color: #5cb85c;
131
+ transition: all 0.4s;
132
+ }
133
+ .signup-btn:hover {
134
+ background: #5cb85c;
135
+ opacity: 0.8;
136
+ }
137
+ .or-seperator {
138
+ margin: 50px 0 15px;
139
+ text-align: center;
140
+ border-top: 1px solid #e0e0e0;
141
+ }
142
+ .or-seperator b {
143
+ padding: 0 10px;
144
+ width: 40px;
145
+ height: 40px;
146
+ font-size: 16px;
147
+ text-align: center;
148
+ line-height: 40px;
149
+ background: #fff;
150
+ display: inline-block;
151
+ border: 1px solid #e0e0e0;
152
+ border-radius: 50%;
153
+ position: relative;
154
+ top: -22px;
155
+ z-index: 1;
156
+ }
157
+ .social-btn .btn {
158
+ color: #fff;
159
+ margin: 10px 0 0 15px;
160
+ font-size: 15px;
161
+ border-radius: 50px;
162
+ font-weight: normal;
163
+ border: none;
164
+ transition: all 0.4s;
165
+ }
166
+ .social-btn .btn:first-child {
167
+ margin-left: 0;
168
+ }
169
+ .social-btn .btn:hover {
170
+ opacity: 0.8;
171
+ }
172
+ .social-btn .btn-primary {
173
+ background: #507cc0;
174
+ }
175
+ .social-btn .btn-info {
176
+ background: #64ccf1;
177
+ }
178
+ .social-btn .btn-danger {
179
+ background: #df4930;
180
+ }
181
+ .social-btn .btn i {
182
+ float: left;
183
+ margin: 3px 10px;
184
+ font-size: 20px;
185
+ }
@@ -18,9 +18,12 @@ module JindaRunConcern
18
18
  # Check if help file available for this form
19
19
  ###############################################################################################
20
20
  @help = File.read(fhelp) if File.exists?(fhelp)
21
- f= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
22
- if File.file?(f)
23
- @ui= File.read(f)
21
+ f1= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
22
+ f2= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.haml"
23
+ if File.file?(f1)
24
+ @ui= File.read(f1)
25
+ elsif File.file?(f2)
26
+ @ui= File.read(f2)
24
27
  else
25
28
  # flash[:notice]= "Error: Can not find the view file for this controller"
26
29
  ma_log "Error: Can not find the view file for this controller"
@@ -6,7 +6,7 @@
6
6
  Dashboard
7
7
  .content
8
8
  %div.row::before
9
- %div.col-lg-3.col-xs-6
9
+ %div.col-lg-4.col-md-4.col-xs-12
10
10
  %div.small-box.bg-aqua
11
11
  %div.inner
12
12
  %b Current gems version found:
@@ -14,31 +14,31 @@
14
14
  %li Ruby Version #{RUBY_VERSION }
15
15
  %li Rails Version #{Rails.version }
16
16
  %li gem jinda #{Gem.loaded_specs['jinda'].version}
17
- %div.col-lg-3.col-xs-6
17
+ %div.col-lg-4.col-md-4.col-xs-12
18
18
  %div.small-box.bg-green
19
19
  %div.inner
20
20
  %b Recently tested with:
21
21
  %ul
22
22
  %li Rubygems 2.7.1
23
- %li Rails 6.0.3
24
- %div.col-lg-3.col-xs-6
23
+ %li Rails 6.1.0
24
+ %div.col-lg-4.col-md-4.col-xs-12
25
25
  %div.small-box.bg-yellow
26
26
  %div.inner
27
27
  %b Create New Rails:
28
28
  %ul
29
29
  %li rails new YOURAPP --skip-test-unit --skip-bundle --skip-active-record --skip-javascript --skip-turbolinks
30
30
  %li (rails new YOURAPP -BOTJ)
31
- %div.col-lg-3.col-xs-6
31
+ %div.col-lg-6.col-md-12.col-xs-12
32
32
  %div.small-box.bg-red
33
33
  %div.inner
34
34
  %b Installation
35
35
  %ul
36
- %li add gem 'jinda', '0.7.0.2' to Gemfile then $ bundle
36
+ %li add gem 'jinda' # to Gemfile then $ bundle
37
37
  %li rails generate jinda:install, then bundle
38
38
  %li rails generate jinda:config
39
39
  %li rails jinda:seed, will create initial user:password admin:secret
40
40
  %li when update app/jinda/index.mm, run rake jinda:update
41
- %div.col-lg-3.col-xs-6
41
+ %div.col-lg-6.col-md-12.col-xs-12
42
42
  %div.small-box.bg-blue
43
43
  %div.inner
44
44
  %b Option: Themes available: Jinda_adminbsb, Jinda_adminlte
@@ -17,7 +17,7 @@ module Jinda
17
17
  gem 'jquery-turbolinks', '2.1.0'
18
18
  gem 'mongo', '2.11.3'
19
19
  gem 'bson', '4.4.2'
20
- gem 'mongoid', '7.1.0.rc0'
20
+ gem 'mongoid', git: 'git@github.com:kul1/mongoid.git'
21
21
  gem 'turbolinks_render'
22
22
  gem 'nokogiri', '~> 1.11.0'
23
23
  gem 'haml', '~> 5.1', '>= 5.1.2'
@@ -32,7 +32,7 @@ module Jinda
32
32
  gem 'omniauth-identity', '~> 1.1.1'
33
33
  gem 'omniauth-facebook', '6.0.0'
34
34
  gem 'omniauth-google-oauth2', '0.8.0'
35
- gem 'dotenv-rails', '2.7.5'
35
+ gem 'dotenv-rails'
36
36
  gem 'cloudinary', '1.13.2'
37
37
  gem 'kaminari', '1.2.0'
38
38
  gem 'kaminari-mongoid', '1.0.1'
@@ -0,0 +1,31 @@
1
+ class CommentsController < ApplicationController
2
+ before_action :comment_params, only: [:create]
3
+ before_action :load_commmentable
4
+
5
+ def index
6
+ @comments = @commentable.comments
7
+ end
8
+
9
+ def create
10
+ @comment = @commentable.comments.new comment_params
11
+ @comment.save!
12
+ redirect_to [@commentable], notice: "Comment created"
13
+ end
14
+
15
+ private
16
+
17
+ # def article_params
18
+ # params.require(:comment).permit(:article_id)
19
+ # end
20
+
21
+ def comment_params
22
+ resource = request.path.split('/')[1]
23
+ commentable_id = "#{resource.singularize.to_sym}_id" #:article_id
24
+ params.require(:comment).permit(:body, :user_id,:name, :image, commentable_id.to_sym)
25
+ end
26
+
27
+ def load_commmentable
28
+ resource, id = request.path.split('/')[1,2]
29
+ @commentable = resource.singularize.classify.constantize.find(id)
30
+ end
31
+ end
@@ -1,11 +1,17 @@
1
+
2
+ <%- @title= 'Template for Document' %>
1
3
  <%
2
4
  doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
- %>
4
- <%= fields_for doc do |f| %>
5
- <%= f.label :category, "Category" %>
6
- <%= f.select :category, [["Book", "book"], ["Letter", "letter"], ["Brochure", "brochure"]] %>
7
- <!--div>
8
- </div-->
5
+ %>
6
+
7
+ <h1>
8
+ <%= @title %>
9
+ </h1>
10
+
11
+ <div class = "module-table">
12
+ <%= fields_for doc do |f| %>
13
+ <%= f.label :category, "Category" %>
14
+ <%= f.select :category, [["Book", "book"], ["Letter", "letter"], ["Brochure", "brochure"]] %>
9
15
  <%= f.label :issue_on, "Dated" %>
10
16
  <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
11
17
 
@@ -13,14 +19,16 @@
13
19
  <%= f.file_field :dscan %>
14
20
  <% end %>
15
21
  <div>
16
- <%= label_tag :description, "Description" %>
17
- <%= text_field_tag :description %>
22
+ <%= label_tag :description, "Description" %>
23
+ <%= text_field_tag :description %>
18
24
  </div>
19
25
  <div>
20
26
  <%= label_tag :ma_display, "Display", :class=>"ui-input-text" %>
21
27
  <%= select_tag :ma_display, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
22
28
  </div>
23
29
  <div>
24
- <%= label_tag :keywords, "Search Keywords" %>
25
- <%= text_field_tag :keywords %>
30
+ <%= label_tag :keywords, "Search Keywords" %>
31
+ <%= text_field_tag :keywords %>
26
32
  </div>
33
+ </div>
34
+
@@ -4,9 +4,10 @@ class Comment
4
4
  # jinda begin
5
5
  include Mongoid::Timestamps
6
6
  field :body, :type => String
7
+ field :name, :type => String
8
+ field :image, :type => String
7
9
  belongs_to :article, :class_name => "Article"
8
10
  belongs_to :user, :class_name => "User"
9
- belongs_to :job, :class_name => "Job"
10
11
  belongs_to :commentable, polymorphic: true
11
12
  index({ commentable_id: 1, commentable_type: 1})
12
13
  # jinda end
@@ -1,10 +1,5 @@
1
1
  .box.box-info
2
2
  .box-header.with-border
3
-
4
- %h3.box-title
5
- = @page_title
6
- .label-warning
7
- = flash[:notice]
8
3
  .box-tools.pull-right
9
4
  %button.btn.btn-box-tool{"data-widget" => "collapse", :type => "button"}
10
5
  %i.fa.fa-minus
@@ -4,39 +4,44 @@
4
4
  .container
5
5
  %div.row::before
6
6
  %div.col-md-12
7
- %h2.display-3.mt-5.pt-5
8
- = @article.title
9
- = 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" }
10
- %hr
11
- = @article.text
12
- %h4.display-5
13
- = @article.body.html_safe
14
- - @comments.each do |comment|
15
- %div#article-comment.ui-corner-all
16
- .col-md-10.col-sm-12
17
- %div.small-box.bg-gray
18
- %div.inner
19
- %div.font-weight-light
20
- Author:
21
- %b= comment.user.code if comment.user
22
- %div#comment-body
23
- %i= comment.body
24
- %hr
25
-
26
- .container
27
- .card
7
+ .row-description
8
+ %h2.display-3.mt-5.pt-5
9
+ = @article.title
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
+ %hr
12
+ = @article.text
13
+ %h4.row-body
14
+ = @article.body.html_safe
15
+ %hr
16
+ - @comments.each do |comment|
17
+ %div#article-comment.ui-corner-all
18
+ .col-md-12
19
+ %div.small-box.bg-white.text-info
20
+ %div.inner
21
+ %div.font-weight-light
22
+ Author:
23
+ %b= comment.name if comment.name
24
+ %div.right-date
25
+ 12/12/2021
26
+ %div#comment-body
27
+ %i= comment.body
28
28
 
29
29
  - if login?
30
- %h4.display-5
31
- Add a comment:
32
- = form_with(model: [@article, Comment.new], local: true) do |f|
33
- .form-group
34
- = f.hidden_field :article_id, :value => @article.id
35
- .form-group
36
- = f.label :body, "Comment"
37
- .form-group
38
- = f.text_area :body, rows: 5, class: "form-control"
39
- .form-group
40
- = f.hidden_field :user_id, :value => current_ma_user
41
- .form-group
42
- = f.submit "Submit", class: "btn btn-default btn-success"
30
+ %hr
31
+ %h4.col-md-12
32
+ Add a comment:
33
+ = form_with(model: [@article, Comment.new], local: true) do |f|
34
+ .form-group
35
+ = f.hidden_field :article_id, :value => @article.id
36
+ .form-group
37
+ = f.label :body, "Comment"
38
+ .form-group
39
+ = f.text_area :body, rows: 5, class: "form-control"
40
+ .form-group
41
+ = f.hidden_field :user_id, :value => current_ma_user.id
42
+ .form-group
43
+ = f.hidden_field :name, :value => current_ma_user.code
44
+ .form-group
45
+ = f.hidden_field :image, :value => current_ma_user.image
46
+ .form-group
47
+ = f.submit "Submit", class: "btn btn-default btn-success"
@@ -0,0 +1,32 @@
1
+ .container
2
+ .signup-form
3
+ - @title= 'Sign Up'
4
+ = form_tag "/auth/identity/register", {'data-ajax'=>'false'} do
5
+ %h1.h3.mb-3.font-weight-normal{:style => "text-align: center"} Sign Up
6
+ .sign_in
7
+ .label-warning
8
+ = flash[:alert]
9
+ - if @identity && @identity.errors.any?
10
+ .error_messages
11
+ %h3
12
+ = pluralize(@identity.errors.count, "error")
13
+ prohibited this account from being saved:
14
+ %ul
15
+ - @identity.errors.full_messages.each do |msg|
16
+ %li= msg
17
+ .form-group.form-control
18
+ = label_tag :code, 'Username'
19
+ = text_field_tag :code, @identity.try(:code)
20
+ .form-group.form-control
21
+ = label_tag :email
22
+ = text_field_tag :email, @identity.try(:email)
23
+ .form-group.form-control
24
+ = label_tag :password, 'Password'
25
+ = password_field_tag :password
26
+ .form-group.form-control
27
+ = label_tag :password_confirmation, 'Confirm password'
28
+ = password_field_tag :password_confirmation
29
+ %button.btn.btn-success.btn-block.actions{:type => "submit"}
30
+ %i.fas.fa-sign-up-alt
31
+ Sign Up
32
+
@@ -0,0 +1,11 @@
1
+ .container
2
+ .signup-form
3
+ .sign_in
4
+ = form_tag password_resets_path, :method => :post do
5
+ .form-group.form-control
6
+ = label_tag :email
7
+ = text_field_tag :email, params[:email]
8
+ %button.btn.btn-success.btn-block.actions{:type => "submit"}
9
+ %i.fas.fa-sign-in-alt
10
+ Reset Password
11
+
@@ -0,0 +1,22 @@
1
+ .container
2
+ .signup-form
3
+ = form_tag "/auth/identity/callback", {'data-ajax'=>'false'} do
4
+ %h1.h3.mb-3.font-weight-normal{:style => "text-align: center"} Sign in
5
+ .sign_in
6
+ .label-warning
7
+ = flash[:alert]
8
+ .form-group.form-control
9
+ = label_tag :auth_key, "User name"
10
+ = text_field_tag :auth_key
11
+ .form-group.form-control
12
+ = label_tag :password, "Password"
13
+ = password_field_tag :password
14
+ .form-group
15
+ = label_tag :remember_me
16
+ = check_box_tag :remember_me, 1, params.permit[:remember_me]
17
+ %button.btn.btn-success.btn-block.actions{:type => "submit"}
18
+ %i.fas.fa-sign-in-alt
19
+ Sign in
20
+ = link_to 'Forgotten password?', new_password_reset_path, data: {icon: 'info', mini: 'true', role: 'button'}
21
+ %hr/
22
+
@@ -1,163 +1,168 @@
1
1
 
2
- # ############################### Themes ###################################
3
- #
4
- # Check login user information from User model: name(code), image for Themes
5
- #
6
- # ##########################################################################
7
- def get_login_user_info
8
- if current_ma_user.present?
9
- $user_image = current_ma_user.image
10
- $user_name = current_ma_user.code
11
- $user_email = current_ma_user.email
12
- $user_id = current_ma_user.try(:id)
13
- else
14
- $user_image = asset_url("user.png", :width => "48")
15
- $user_name = 'Guest User'
16
- $user_email = 'guest@sample.com'
17
- $user_id = ''
18
- end
19
- return $user_image, $user_name, $user_email,$user_id
20
- end
2
+ # ############################### Themes ###################################
3
+ #
4
+ # Check login user information from User model: name(code), image for Themes
5
+ #
6
+ # ##########################################################################
7
+ def get_login_user_info
8
+ if current_ma_user.present?
9
+ $user_image = current_ma_user.image
10
+ $user_name = current_ma_user.code
11
+ $user_email = current_ma_user.email
12
+ $user_id = current_ma_user.try(:id)
13
+ else
14
+ $user_image = asset_url("user.png", :width => "48")
15
+ $user_name = 'Guest User'
16
+ $user_email = 'guest@sample.com'
17
+ $user_id = ''
18
+ end
19
+ return $user_image, $user_name, $user_email,$user_id
20
+ end
21
21
 
22
- def name2code(s)
23
- # rather not ignore # symbol cause it could be comment
24
- code, name = s.split(':')
25
- code.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'')
26
- end
27
- def name2camel(s)
28
- s.gsub(' ','_').camelcase
29
- end
30
- def true_action?(s)
31
- %w(call ws redirect invoke email).include? s
32
- end
33
- def set_global
34
- $xmain= @xmain ; $runseq = @runseq ; $user = current_ma_user ; $xvars= @xmain.xvars; $ip = request.env["REMOTE_ADDR"]
35
- end
36
- def authorize? # use in pending tasks
37
- @runseq= @xmain.runseqs.find @xmain.current_runseq
38
- return false unless @runseq
39
- @user = current_ma_user
40
- set_global
41
- return false unless eval(@runseq.rule) if @runseq.rule
42
- return true if true_action?(@runseq.action)
43
- # return false if check_wait
44
- return true if @runseq.role.blank?
45
- unless @runseq.role.empty?
46
- return false unless @user.role
47
- return @user.role.upcase.split(',').include?(@runseq.role.upcase)
48
- end
49
- return true
50
- end
51
- def authorize_init? # use when initialize new transaction
52
- # check module role
53
- mrole = @service.module.role
54
- return false if mrole && !current_ma_user
55
- return false if mrole && !current_ma_user.has_role(mrole)
22
+ def name2code(s)
23
+ # rather not ignore # symbol cause it could be comment
24
+ code, name = s.split(':')
25
+ code.downcase.strip.gsub(' ','_').gsub(/[^#_\/a-zA-Z0-9]/,'')
26
+ end
27
+ def name2camel(s)
28
+ s.gsub(' ','_').camelcase
29
+ end
30
+ def true_action?(s)
31
+ %w(call ws redirect invoke email).include? s
32
+ end
33
+ def set_global
34
+ $xmain= @xmain ; $runseq = @runseq ; $user = current_ma_user ; $xvars= @xmain.xvars; $ip = request.env["REMOTE_ADDR"]
35
+ end
36
+ def authorize? # use in pending tasks
37
+ @runseq= @xmain.runseqs.find @xmain.current_runseq
38
+ return false unless @runseq
39
+ @user = current_ma_user
40
+ set_global
41
+ return false unless eval(@runseq.rule) if @runseq.rule
42
+ return true if true_action?(@runseq.action)
43
+ # return false if check_wait
44
+ return true if @runseq.role.blank?
45
+ unless @runseq.role.empty?
46
+ return false unless @user.role
47
+ return @user.role.upcase.split(',').include?(@runseq.role.upcase)
48
+ end
49
+ return true
50
+ end
51
+ def authorize_init? # use when initialize new transaction
52
+ # check module role
53
+ mrole = @service.module.role
54
+ return false if mrole && !current_ma_user
55
+ return false if mrole && !current_ma_user.has_role(mrole)
56
56
 
57
- # check step 1 role
58
- xml= @service.xml
59
- step1 = REXML::Document.new(xml).root.elements['node']
60
- role= get_option_xml("role", step1) || ""
61
- # rule= get_option_xml("rule", step1) || true
62
- rule= get_option_xml("rule", step1) || true
63
- return true if role==""
64
- unless current_ma_user
65
- return role.blank?
66
- else
67
- return false unless current_ma_user.role
68
- return current_ma_user.has_role(role)
69
- end
57
+ # check step 1 role
58
+ xml= @service.xml
59
+ step1 = REXML::Document.new(xml).root.elements['node']
60
+ role= get_option_xml("role", step1) || ""
61
+ # rule= get_option_xml("rule", step1) || true
62
+ rule= get_option_xml("rule", step1) || true
63
+ return true if role==""
64
+ unless current_ma_user
65
+ return role.blank?
66
+ else
67
+ return false unless current_ma_user.role
68
+ return current_ma_user.has_role(role)
69
+ end
70
70
 
71
- end
72
- def ma_log(message)
73
- # Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
74
- # :unread=> true, :ip=> ($ip || request.env["REMOTE_ADDR"])
75
- if session[:user_id]
76
- Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
77
- :user_id => $user.id, :unread=> true, :ip=>request.env["REMOTE_ADDR"]
78
- else
79
- Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
80
- :unread=> true, :ip=>request.env["REMOTE_ADDR"]
81
- end
82
- end
71
+ end
72
+ def ma_log(message)
73
+ # Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
74
+ # :unread=> true, :ip=> ($ip || request.env["REMOTE_ADDR"])
75
+ if session[:user_id]
76
+ Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
77
+ :user_id => $user.id, :unread=> true, :ip=>request.env["REMOTE_ADDR"]
78
+ else
79
+ Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
80
+ :unread=> true, :ip=>request.env["REMOTE_ADDR"]
81
+ end
82
+ end
83
83
 
84
- alias :ma_notice :ma_log
84
+ alias :ma_notice :ma_log
85
85
 
86
- # methods from application_helper
87
- def markdown(text)
88
- erbified = ERB.new(text.html_safe).result(binding)
89
- red = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
90
- red.render(erbified).html_safe
91
- end
92
- def align_text(s, pixel=3)
93
- "<span style='position:relative; top:-#{pixel}px;'>#{s}</span>".html_safe
94
- end
95
- def status_icon(status)
96
- case status
97
- when 'R'
98
- image_tag 'user.png'
99
- when 'F'
100
- image_tag 'tick.png'
101
- when 'I'
102
- image_tag 'control_play.png'
103
- when 'E'
104
- image_tag 'logout.png'
105
- when 'X'
106
- image_tag 'cross.png'
107
- else
108
- image_tag 'cancel.png'
109
- end
110
- end
111
- def role_name(code)
112
- role= Jinda::Role.where(code:code).first
113
- return role ? role.name : ""
114
- end
115
- def uncomment(s)
116
- s.sub(/^#\s/,'')
117
- end
118
- def code_div(s)
119
- "<pre style='background-color: #efffef;'><code class='ruby' lang='ruby'> #{s}</code></pre>".html_safe
120
- end
121
- def ajax?(s)
122
- return s.match('file_field') ? false : true
123
- end
124
- def step(s, total) # square text
125
- s = (s==0)? 1: s.to_i
126
- total = total.to_i
127
- out ="<div class='step'>"
128
- (s-1).times {|ss| out += "<span class='steps_done'>#{(ss+1)}</span>" }
129
- out += %Q@<span class='step_now' >@
130
- out += s.to_s
131
- out += "</span>"
132
- out += %Q@@
133
- for i in s+1..total
134
- out += "<span class='steps_more'>#{i}</span>"
135
- end
136
- out += "</div>"
137
- out.html_safe
138
- end
86
+ # methods from application_helper
87
+ def markdown(text)
88
+ begin
89
+ erbified = ERB.new(text.html_safe).result(binding)
90
+ rescue => error
91
+ flash[:notice] = "This ruby version not support #{error}"
92
+ return
93
+ end
94
+ red = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
95
+ red.render(erbified).html_safe
96
+ end
97
+ def align_text(s, pixel=3)
98
+ "<span style='position:relative; top:-#{pixel}px;'>#{s}</span>".html_safe
99
+ end
100
+ def status_icon(status)
101
+ case status
102
+ when 'R'
103
+ image_tag 'user.png'
104
+ when 'F'
105
+ image_tag 'tick.png'
106
+ when 'I'
107
+ image_tag 'control_play.png'
108
+ when 'E'
109
+ image_tag 'logout.png'
110
+ when 'X'
111
+ image_tag 'cross.png'
112
+ else
113
+ image_tag 'cancel.png'
114
+ end
115
+ end
116
+ def role_name(code)
117
+ role= Jinda::Role.where(code:code).first
118
+ return role ? role.name : ""
119
+ end
120
+ def uncomment(s)
121
+ s.sub(/^#\s/,'')
122
+ end
123
+ def code_div(s)
124
+ "<pre style='background-color: #efffef;'><code class='ruby' lang='ruby'> #{s}</code></pre>".html_safe
125
+ end
126
+ def ajax?(s)
127
+ return s.match('file_field') ? false : true
128
+ end
129
+ def step(s, total) # square text
130
+ s = (s==0)? 1: s.to_i
131
+ total = total.to_i
132
+ out ="<div class='step'>"
133
+ (s-1).times {|ss| out += "<span class='steps_done'>#{(ss+1)}</span>" }
134
+ out += %Q@<span class='step_now' >@
135
+ out += s.to_s
136
+ out += "</span>"
137
+ out += %Q@@
138
+ for i in s+1..total
139
+ out += "<span class='steps_more'>#{i}</span>"
140
+ end
141
+ out += "</div>"
142
+ out.html_safe
143
+ end
139
144
 
140
- def current_ma_user
141
- # if session[:user_id]
142
- # return @user ||= User.find(session[:user_id]['$oid'])
143
- # else
144
- # return nil
145
- # end
146
- #@user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token]
147
- @user ||= User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
148
- return @user
149
- end
145
+ def current_ma_user
146
+ # if session[:user_id]
147
+ # return @user ||= User.find(session[:user_id]['$oid'])
148
+ # else
149
+ # return nil
150
+ # end
151
+ #@user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token]
152
+ @user ||= User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
153
+ return @user
154
+ end
150
155
 
151
- def ui_action?(s)
152
- %w(form output mail pdf).include? s
153
- end
154
- # def handle_ma_notice
155
- # if Jinda::Notice.recent.count>0
156
- # notice= Jinda::Notice.recent.last
157
- # notice.update_attribute :unread, false
158
- # "<script>notice('#{notice.message}');</script>"
159
- # else
160
- # ""
161
- # end
162
- # end
156
+ def ui_action?(s)
157
+ %w(form output mail pdf).include? s
158
+ end
159
+ # def handle_ma_notice
160
+ # if Jinda::Notice.recent.count>0
161
+ # notice= Jinda::Notice.recent.last
162
+ # notice.update_attribute :unread, false
163
+ # "<script>notice('#{notice.message}');</script>"
164
+ # else
165
+ # ""
166
+ # end
167
+ # end
163
168
 
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.7.0.2"
2
+ VERSION = "0.7.3"
3
3
  end
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.0.2
4
+ version: 0.7.3
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-01-08 00:00:00.000000000 Z
12
+ date: 2021-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -59,20 +59,6 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 7.1.0
62
- - !ruby/object:Gem::Dependency
63
- name: rails
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "<"
67
- - !ruby/object:Gem::Version
68
- version: '6.1'
69
- type: :runtime
70
- prerelease: false
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "<"
74
- - !ruby/object:Gem::Version
75
- version: '6.1'
76
62
  description: 'Generate Rails workflow from mind map: Freemind'
77
63
  email:
78
64
  - 1.0@kul.asia
@@ -236,6 +222,7 @@ files:
236
222
  - lib/generators/jinda/templates/app/channels/application_cable/channel.rb
237
223
  - lib/generators/jinda/templates/app/channels/application_cable/connection.rb
238
224
  - lib/generators/jinda/templates/app/controllers/api/v1/notes_controller.rb
225
+ - lib/generators/jinda/templates/app/controllers/comments_controller.rb
239
226
  - lib/generators/jinda/templates/app/controllers/jinda_org/admins_controller.rb
240
227
  - lib/generators/jinda/templates/app/controllers/jinda_org/application_controller.rb
241
228
  - lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb
@@ -306,7 +293,7 @@ files:
306
293
  - lib/generators/jinda/templates/app/views/docs/edit/select_note.html.erb
307
294
  - lib/generators/jinda/templates/app/views/docs/index.haml
308
295
  - lib/generators/jinda/templates/app/views/docs/my.haml
309
- - lib/generators/jinda/templates/app/views/identities/new.html.erb
296
+ - lib/generators/jinda/templates/app/views/identities/new.html.haml
310
297
  - lib/generators/jinda/templates/app/views/jinda_mailer/gmail.html.erb
311
298
  - lib/generators/jinda/templates/app/views/layouts/_head.html.erb
312
299
  - lib/generators/jinda/templates/app/views/layouts/_meta_tag.html.erb
@@ -344,8 +331,8 @@ files:
344
331
  - lib/generators/jinda/templates/app/views/notes/show.haml
345
332
  - lib/generators/jinda/templates/app/views/notes/xedit/edit_note.html.erb
346
333
  - lib/generators/jinda/templates/app/views/password_resets/edit.html.erb
347
- - lib/generators/jinda/templates/app/views/password_resets/new.html.erb
348
- - lib/generators/jinda/templates/app/views/sessions/new.html.erb
334
+ - lib/generators/jinda/templates/app/views/password_resets/new.html.haml
335
+ - lib/generators/jinda/templates/app/views/sessions/new.html.haml
349
336
  - lib/generators/jinda/templates/app/views/sitemap/index.xml.haml
350
337
  - lib/generators/jinda/templates/app/views/user_mailer/password_reset.html.haml
351
338
  - lib/generators/jinda/templates/app/views/user_mailer/password_reset.text.erb
@@ -479,7 +466,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
479
466
  - !ruby/object:Gem::Version
480
467
  version: '0'
481
468
  requirements: []
482
- rubygems_version: 3.2.3
469
+ rubygems_version: 3.1.2
483
470
  signing_key:
484
471
  specification_version: 4
485
472
  summary: 'Rails workflow from mind map: Freemind'
@@ -1,37 +0,0 @@
1
- <div class="container">
2
- <div id="logreg-forms">
3
- <div class="sign_in">
4
- <%- @title= 'Sign Up' %>
5
- <%= form_tag "/auth/identity/register", {'data-ajax'=>'false'} do %>
6
- <h1 class="h3 mb-3 font-weight-normal" style="text-align: center"> Sign Up</h1>
7
- <% if @identity && @identity.errors.any? %>
8
- <div class="error_messages">
9
- <h2><%= pluralize(@identity.errors.count, "error") %> prohibited this account from being saved:</h2>
10
- <ul>
11
- <% @identity.errors.full_messages.each do |msg| %>
12
- <li><%= msg %></li>
13
- <% end %>
14
- </ul>
15
- </div>
16
- <% end %>
17
- <div class="field form-control" data-role="fieldcontain">
18
- <%= label_tag :code, 'Username' %>
19
- <%= text_field_tag :code, @identity.try(:code) %>
20
- </div>
21
- <div class="field form-control" data-role="fieldcontain">
22
- <%= label_tag :email %>
23
- <%= text_field_tag :email, @identity.try(:email) %>
24
- </div>
25
- <div class="field form-control" data-role="fieldcontain">
26
- <%= label_tag :password, 'Password' %>
27
- <%= password_field_tag :password %>
28
- </div>
29
- <div class="field form-control" data-role="fieldcontain">
30
- <%= label_tag :password_confirmation, 'Confirm password' %>
31
- <%= password_field_tag :password_confirmation %>
32
- </div>
33
- <button class="btn btn-warning btn-block actions" type="submit"><i class="fas fa-sign-up-alt"></i> Sign Up</button>
34
- <% end %>
35
- </div>
36
- </div>
37
- </div>
@@ -1,13 +0,0 @@
1
- <div class="container">
2
- <div id="logreg-forms">
3
- <div class="sign_in">
4
- <%= form_tag password_resets_path, :method => :post do %>
5
- <div class="field">
6
- <%= label_tag :email %>
7
- <%= text_field_tag :email, params[:email] %>
8
- </div>
9
- <button class="btn btn-success btn-block actions" type="submit"><i class="fas fa-sign-in-alt"></i> Reset Password</button>
10
- <% end %>
11
- </div>
12
- </div>
13
- </div>
@@ -1,29 +0,0 @@
1
- <div class="container">
2
- <div id="logreg-forms">
3
- <div class="sign_in">
4
-
5
- <%= form_tag "/auth/identity/callback", {'data-ajax'=>'false'} do %>
6
- <h1 class="h3 mb-3 font-weight-normal" style="text-align: center"> Sign in</h1>
7
- <div class="label-warning">
8
- <%= flash[:alert] %>
9
- </div>
10
- <div class="form-control" data-role="fieldcontain">
11
- <%= label_tag :auth_key, "User name" %>
12
- <%= text_field_tag :auth_key %>
13
- </div>
14
- <div class="form-control" data-role="fieldcontain">
15
- <%= label_tag :password, "Password" %>
16
- <%= password_field_tag :password %>
17
- </div>
18
- <div class="field" data-role="fieldcontain" data-icon="info">
19
- <%= label_tag :remember_me %>
20
- <%= check_box_tag :remember_me, 1, params.permit[:remember_me] %>
21
- </div>
22
-
23
- <button class="btn btn-success btn-block actions" type="submit"><i class="fas fa-sign-in-alt"></i> Sign in</button>
24
- <%= link_to 'Forgotten password?', new_password_reset_path, data: {icon: 'info', mini: 'true', role: 'button'} %>
25
- <hr>
26
- <% end %>
27
- </div>
28
- </div>
29
- </div>