jinda 0.4.9 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 042bb6fc61b659ff7b4a49552b2b12235d78f5330d87f45d41c372a4babd13da
4
- data.tar.gz: a7e2f7d48ff8586ae259d58f182e0508c18c16f2f00ea36ad333e8ed6a85c16e
3
+ metadata.gz: ecac4f20399ba16041c265028b66ed5121fc564fcd1d03232bc63c49bae06d59
4
+ data.tar.gz: 040c63dd43667737d2388b89eb4c682ae77c27b859308730f957b4505cc0cf1d
5
5
  SHA512:
6
- metadata.gz: 2463085a390a255b882fc7e0f3fe4107a079d13bbbc65988ee3148a4934dbf636e4a1d11dea8ae2c224c40144fec6fce585965e5b2c339b0b684e0e60207ef95
7
- data.tar.gz: 58406a110bf6c497f6355e0673bc73b26da51bc12d39909c868cdee4b73fb4d3b5717abc5cdfb3ad63bb89ca16490bc2f403bb0517a4f34b758d7a67aa141235
6
+ metadata.gz: ca4d56c87c21ee29adea2d9068ff6bbd7f272dc3da85dfef033e05895ea9d905e7fdeeda28acb4184c4271aca81028240e7e6cd48f078539d86484f6c6532a6e
7
+ data.tar.gz: a30945796a4c41f85fbc859260e54867a0db663247c5ef5318da374d4d0ec6c5cdc386371f62f895076eccd8de2420b77156d8ec27fcbd31545895f89577b45c
@@ -92,9 +92,9 @@ module Jinda
92
92
  inside("app/controllers") {(File.file? "sitemap_controller.rb") ? ( say "Please merge existing jinda_org/sitemap_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/sitemap_controller.rb', 'sitemap_controller.rb')}
93
93
  inside("app/controllers") {(File.file? "notes_controller.rb") ? ( say "Please merge existing jinda_org/notes_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/notes_controller.rb', 'notes_controller.rb')}
94
94
  end
95
- # routes created each line as reversed order button up in routes
95
+ # routes created each line as reversed order in routes
96
96
  def setup_routes
97
- route "end"
97
+ # route "end"
98
98
  route " end"
99
99
  route " namespace :v1 do resources :notes, :only => [:index] end"
100
100
  route " namespace :api do"
@@ -119,14 +119,16 @@ module Jinda
119
119
  route "get '/auth/:provider/callback' => 'sessions#create'"
120
120
  route "post '/auth/:provider/callback' => 'sessions#create'"
121
121
  route "\# end jinda method routes"
122
+ route "post '/jinda/end_output' => 'jinda#end_output'"
122
123
  route "post '/jinda/end_form' => 'jinda#end_form'"
123
124
  route "post '/jinda/pending' => 'jinda#index'"
124
125
  route "post '/jinda/init' => 'jinda#init'"
125
126
  route "jinda_methods.each do \|aktion\| get \"/jinda/\#\{aktion\}\" => \"jinda#\#\{aktion\}\" end"
126
- route "jinda_methods += ['init','run','run_mail','document','run_do','run_form','end_form','error_logs', 'notice_logs', 'cancel']"
127
- route "jinda_methods = ['pending','status','search','doc','logs','ajax_notice']"
127
+ route "jinda_methods += ['error_logs', 'notice_logs', 'cancel', 'run_output', 'end_output']"
128
+ route "jinda_methods += ['init', 'run', 'run_mail', 'document', 'run_do', 'run_form', 'end_form']"
129
+ route "jinda_methods = ['pending', 'status', 'search', 'doc', 'doc_print', 'logs', 'ajax_notice']"
128
130
  route "\# start jiinda method routes"
129
- end
131
+ end
130
132
 
131
133
  def setup_env
132
134
  FileUtils.mv "README.md", "README.md.bak"
@@ -15,8 +15,8 @@ Rails Application Generator using Freemind
15
15
 
16
16
  These versions works for sure but others may do.
17
17
 
18
- * Ruby 2.5.5
19
- * Rails 5.2.3
18
+ * Ruby 2.7.0
19
+ * Rails 6.0.2
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', '~> 0.3.9'
39
+ gem 'jinda', '~> 0.5.0'
40
40
 
41
41
  For Development (most updated)
42
42
 
@@ -0,0 +1,84 @@
1
+
2
+ .module-title {
3
+ font-size: 14pt;
4
+ font-weight: bold;
5
+ text-align: center;
6
+ background: #d2f0ff;
7
+ font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
8
+ color:#333;
9
+
10
+ }
11
+ .module-text {
12
+ font-size: 14pt;
13
+ font-weight: bold;
14
+ text-align:left;
15
+ border:1px solid #c1c1c1;
16
+ background:#f7f7f7;
17
+ padding:2px 5px;
18
+ color:#333;
19
+ }
20
+ .module-comment {
21
+ font-size: 8pt;
22
+ text-align:left;
23
+ border:1px solid #c1c1c1;
24
+ background:#f7f7f7;
25
+ padding:2px 5px;
26
+ color:#333;
27
+ }
28
+
29
+ .comment-body {
30
+ font-size: 10pt;
31
+ font-weight: bold;
32
+ text-align:left;
33
+ color:#333;
34
+ }
35
+ .module-table {
36
+ width:100%;
37
+ font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
38
+
39
+ }
40
+
41
+ .module-table th {
42
+ background-color: #bcecff;
43
+ color:#333;
44
+ ;
45
+ width:100%;
46
+ }
47
+
48
+ .module-table td {
49
+ border: 1px;
50
+ padding: 8px;
51
+ witdth:100%;
52
+ }
53
+
54
+
55
+ .ui-btn-inner { padding: 2px 25px; }
56
+ .ui-btn-up-c,
57
+ .ui-btn-hover-c,
58
+ .ui-btn-down-c {
59
+ font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
60
+ /*font-size: 110%;*/
61
+ }
62
+ .ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: 7px 75px 7px 15px; display: block; }
63
+ .ui-link-inherit { font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;}
64
+ label.ui-input-text {
65
+ font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
66
+ /*font-size: 110%;*/
67
+ text-shadow: none;
68
+ }
69
+ label.ui-select {
70
+ font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
71
+ /*font-size: 110%;*/
72
+ text-shadow: none;
73
+ }
74
+ .ui-body-c {
75
+ font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
76
+ /*font-size: 1.4em;*/
77
+ text-shadow: none;
78
+ }
79
+ .ui-header .ui-title, .ui-footer .ui-title { font-family: 'TH SarabunPSK'; text-align: center; display: block; margin: .2em 90px .3em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; }
80
+
81
+
82
+
83
+
84
+
@@ -86,8 +86,8 @@ class JindaController < ApplicationController
86
86
  end
87
87
  ####################################################################################################]
88
88
  # run if, form, mail, output etc depend on icon in freemind
89
- # action from @runseq.action == do, form, if, output
90
- # Then will call def run_do, run_form, run_if, run_output
89
+ # action from @r.action == do, form, if, output
90
+ # Then will call def run_do, run_form, run_if, run_output
91
91
  ####################################################################################################]
92
92
  def run
93
93
  init_vars(params[:id])
@@ -111,6 +111,9 @@ class JindaController < ApplicationController
111
111
  if service
112
112
  @title= "Transaction ID #{@xmain.xid}: #{@xmain.name} / #{@runseq.name}"
113
113
  fhelp= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.md"
114
+ ###############################################################################################
115
+ # Check if help file available for this form
116
+ ###############################################################################################
114
117
  @help = File.read(fhelp) if File.exists?(fhelp)
115
118
  f= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
116
119
  if File.file?(f)
@@ -120,8 +123,8 @@ class JindaController < ApplicationController
120
123
  ma_log "Error: Can not find the view file for this controller"
121
124
  redirect_to_root
122
125
  end
123
-
124
126
  end
127
+ init_vars(params[:id])
125
128
  end
126
129
  else
127
130
  redirect_to_root
@@ -189,6 +192,7 @@ class JindaController < ApplicationController
189
192
  def run_output
190
193
  init_vars(params[:id])
191
194
  service= @xmain.service
195
+ # disp= get_option("ma_display")
192
196
  disp= get_option("ma_display")
193
197
  ma_display = (disp && !affirm(disp)) ? false : true
194
198
  if service
@@ -209,7 +213,8 @@ class JindaController < ApplicationController
209
213
  end
210
214
  @message = defined?(MSG_NEXT) ? MSG_NEXT : "Next &gt;"
211
215
  @message = "Finish" if @runseq.end
212
- eval "@xvars[@runseq.code] = url_for(:controller=>'Jinda', :action=>'document', :id=>@doc.id)"
216
+ ma_log("Todo defined?(NSG_NEXT : Next >>)")
217
+ eval "@xvars[@runseq.code] = url_for(:controller=>'jinda', :action=>'document', :id=>@doc.id)"
213
218
  else
214
219
  # flash[:notice]= "Error: Can not find the view file for this controller"
215
220
  ma_log "Error: Can not find the view file for this controller"
@@ -273,30 +278,37 @@ class JindaController < ApplicationController
273
278
 
274
279
 
275
280
  def end_form
276
- init_vars(params[:xmain_id])
277
- eval "@xvars[@runseq.code] = {} unless @xvars[@runseq.code]"
278
- # Search for uploaded file name if exist
279
- params.each { |k,v|
280
- if params[k].respond_to? :original_filename
281
- get_image(k, params[k])
282
- # check if params of array in form eg: edit_article
283
- elsif params[k].is_a?(ActionController::Parameters)
284
- params[k].each { |k1,v1|
285
- # eval "@xvars[@runseq.code][k1] = params.require(k1).permit(k1)"
286
- eval "@xvars[@runseq.code][k1] = v1"
287
- next unless v1.respond_to?(:original_filename)
288
- get_image1(k, k1, params[k][k1])
289
- }
281
+ # Check error using xmain_id to redirect_to_root and return
282
+ if params[:xmain_id]
283
+ init_vars(params[:xmain_id])
290
284
  else
291
- # bug in to_unsalfe_h rails 5.1.6 https://github.com/getsentry/raven-ruby/issues/799
292
- # Solution:
293
- # https://stackoverflow.com/questions/34949505/rails-5-unable-to-retrieve-hash-values-from-parameter
294
- # v = v.to_unsafe_h unless v.class == String
295
- # v = params.require[k] unless v.class == String
296
- v = v.to_s unless v.class == String
297
- eval "@xvars[@runseq.code][k] = v"
285
+ ma_log "Known Bug : repeated end_form "
286
+ redirect_to_root and return
298
287
  end
299
- }
288
+ eval "@xvars[@runseq.code] = {} unless @xvars[@runseq.code]"
289
+ # Search for uploaded file name if exist
290
+ params.each { |k,v|
291
+ if params[k].respond_to? :original_filename
292
+ get_image(k, params[k])
293
+ # check if params of array in form eg: edit_article
294
+ elsif params[k].is_a?(ActionController::Parameters)
295
+ params[k].each { |k1,v1|
296
+ # eval "@xvars[@runseq.code][k1] = params.require(k1).permit(k1)"
297
+ eval "@xvars[@runseq.code][k1] = v1"
298
+ next unless v1.respond_to?(:original_filename)
299
+ get_image1(k, k1, params[k][k1])
300
+ }
301
+ else
302
+ # https://stackoverflow.com/questions/34949505/rails-5-unable-to- retrieve-hash-values-from-parameter # bug in to_unsalfe_h rails 5.1.6 https://github.com/getsentry/raven-ruby/issues/799
303
+ # Solution:
304
+ # https://stackoverflow.com/questions/34949505/rails-5-unable-to-retrieve-hash-values-from-parameter
305
+ # v = v.to_unsafe_h unless v.class == String
306
+ # v = params.require[k] unless v.class == String
307
+ v = v.to_s unless v.class == String
308
+ # Create @xvars[@runseq.code]
309
+ eval "@xvars[@runseq.code][k] = v"
310
+ end
311
+ }
300
312
  end_action
301
313
  end
302
314
 
@@ -383,6 +395,7 @@ class JindaController < ApplicationController
383
395
  @intro = File.read('README.md')
384
396
  @print= "<div align='right'><img src='/assets/printer.png'/> <a href='/jinda/doc_print' target='_blank'/>Print</a></div>"
385
397
  doc= render_to_string 'doc.md', :layout => false
398
+
386
399
  html= Maruku.new(doc).to_html
387
400
  File.open('public/doc.html','w') {|f| f.puts html }
388
401
  respond_to do |format|
@@ -457,6 +470,9 @@ class JindaController < ApplicationController
457
470
  end
458
471
 
459
472
  private
473
+ ###############################################################################################
474
+ # Each Service at one moment will create one xmain
475
+ ###############################################################################################
460
476
  def create_xmain(service)
461
477
  c = name2camel(service.module.code)
462
478
  custom_controller= "#{c}Controller"
@@ -477,6 +493,9 @@ class JindaController < ApplicationController
477
493
  :referer=>request.env['HTTP_REFERER']
478
494
  }
479
495
  end
496
+ ###############################################################################################
497
+ # Each xmain will create many run_seq as many as steps and form_steps
498
+ ###############################################################################################
480
499
  def create_runseq(xmain)
481
500
  @xvars= xmain.xvars
482
501
  default_role= get_default_role
@@ -521,6 +540,7 @@ class JindaController < ApplicationController
521
540
  @xvars['total_steps']= i
522
541
  @xvars['total_form_steps']= j
523
542
  end
543
+
524
544
  def init_vars(xmain)
525
545
  @xmain= Jinda::Xmain.find xmain
526
546
  @xvars= @xmain.xvars
@@ -1,22 +1,31 @@
1
- # encoding: utf-8
1
+ # -*- encoding : utf-8 -*-
2
2
  class Jinda::Doc
3
3
  include Mongoid::Document
4
- # jinda begin
5
4
  include Mongoid::Timestamps
6
- field :a, :type => String
7
- field :b, :type => String
8
- field :c, :type => String
9
- field :d, :type => String
10
- field :x, :type => String
11
- field :y, :type => String
12
- field :z, :type => String
13
- field :s, :type => String
14
- field :t, :type => String
15
- field :u, :type => String
16
- field :w, :type => String
17
- field :yes, :type => Boolean
18
- field :dscan, :type => String
19
- field :process_at, :type => Date
20
- field :issue_on, :type => Date
21
- # jinda end
5
+ field :name, :type => String
6
+ field :filename, :type => String
7
+ field :content_type, :type => String
8
+ field :data_text, :type => String
9
+ field :url, :type => String
10
+ field :basename, :type => String
11
+ field :cloudinary, :type => Boolean
12
+ belongs_to :xmain, :class_name => "Jinda::Xmain"
13
+ belongs_to :runseq, :class_name => "Jinda::Runseq"
14
+ belongs_to :user
15
+ belongs_to :service, :class_name => "Jinda::Service"
16
+ field :ip, :type => String
17
+ field :ma_display, :type => Boolean
18
+ field :ma_secured, :type => Boolean
19
+
20
+ def self.search(q, page, per_page=PER_PAGE)
21
+ paginate :per_page=>per_page, :page => page, :conditions =>
22
+ ["content_type=? AND data_text LIKE ? AND (ma_secured=? OR ma_user_id=?)",
23
+ "output", "%#{q}%", false, session[:user_id] ],
24
+ :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id'
25
+ end
26
+ def self.search_ma_secured(q, page, per_page=PER_PAGE)
27
+ paginate :per_page=>per_page, :page => page, :conditions =>
28
+ ["content_type=? AND data_text LIKE ?", "output", "%#{q}%" ],
29
+ :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id'
30
+ end
22
31
  end
@@ -21,7 +21,7 @@
21
21
 
22
22
  %h2 Installation
23
23
  %ul
24
- %li add gem 'jinda', '0.4.9'
24
+ %li add gem 'jinda', '0.5.0'
25
25
  %li bundle
26
26
  %li rails generate jinda:install
27
27
  %li (run all with "sh install.sh" )
@@ -2,7 +2,7 @@
2
2
  %P
3
3
  - @page_title = 'My Notes'
4
4
  = paginate @notes
5
- %table{:id=>"note-table", :data-mode => "reflow", :data-role => "table"}
5
+ %table{:class=>"module-table", :data-mode => "reflow", :data-role => "table"}
6
6
  %tr
7
7
  %th Title
8
8
  %th Body
@@ -0,0 +1,308 @@
1
+ <map version="1.0.1">
2
+ <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
3
+ <node CREATED="1273819432637" ID="ID_1098419600" MODIFIED="1334737006485" TEXT="Jinda">
4
+ <node CREATED="1273819462973" ID="ID_282419531" MODIFIED="1583088810861" POSITION="right" TEXT="services">
5
+ <node CREATED="1275756501221" FOLDED="true" ID="ID_1720745721" MODIFIED="1583097151076" TEXT="users:User">
6
+ <node CREATED="1278491598711" ID="ID_1662699954" MODIFIED="1494393920347" TEXT="role:m"/>
7
+ <node CREATED="1279700865182" ID="ID_1266797279" MODIFIED="1357798847781" TEXT="link:info: /users"/>
8
+ <node CREATED="1319015338880" ID="ID_189841353" MODIFIED="1528215866339" TEXT="link:pending tasks: /jinda/pending"/>
9
+ <node CREATED="1275905802131" ID="ID_154000410" MODIFIED="1355422418892" TEXT="user:edit">
10
+ <node CREATED="1275756515843" ID="ID_1108188320" MODIFIED="1330477833918" TEXT="enter_user:edit">
11
+ <icon BUILTIN="attach"/>
12
+ <node CREATED="1282816887988" ID="ID_1767357871" MODIFIED="1282817769412" TEXT="rule:login? &amp;&amp; own_xmain?"/>
13
+ </node>
14
+ <node CREATED="1275756530989" ID="ID_1221806432" MODIFIED="1282822205361" TEXT="update_user">
15
+ <icon BUILTIN="bookmark"/>
16
+ </node>
17
+ </node>
18
+ <node CREATED="1275756504750" ID="ID_1382277695" MODIFIED="1355422424108" TEXT="pwd:change password">
19
+ <node CREATED="1275756515843" ID="ID_1559014937" MODIFIED="1330477842311" TEXT="enter: edit">
20
+ <icon BUILTIN="attach"/>
21
+ <node CREATED="1282816887988" ID="ID_2948144" MODIFIED="1282817769412" TEXT="rule:login? &amp;&amp; own_xmain?"/>
22
+ </node>
23
+ <node CREATED="1275756530989" ID="ID_1566171053" MODIFIED="1275756553762" TEXT="change_password">
24
+ <icon BUILTIN="bookmark"/>
25
+ </node>
26
+ </node>
27
+ </node>
28
+ <node CREATED="1275752678377" FOLDED="true" ID="ID_1348489452" MODIFIED="1583097147577" TEXT="admins:Admin">
29
+ <node CREATED="1275752688167" ID="ID_229996461" MODIFIED="1275752690948" TEXT="role:a"/>
30
+ <node CREATED="1282722836614" ID="ID_1213363124" MODIFIED="1330477902602" TEXT="edit_role:edit user role">
31
+ <node CREATED="1282722862918" ID="ID_1190117882" MODIFIED="1330477922159" TEXT="select_user:select user">
32
+ <icon BUILTIN="attach"/>
33
+ <node CREATED="1282722901932" ID="ID_1859523490" MODIFIED="1282722903469" TEXT="role:a"/>
34
+ </node>
35
+ <node CREATED="1282722868801" ID="ID_1325872490" MODIFIED="1330477926538" TEXT="edit_role:edit role">
36
+ <icon BUILTIN="attach"/>
37
+ <node CREATED="1282722901932" ID="ID_1992100954" MODIFIED="1282722903469" TEXT="role:a"/>
38
+ </node>
39
+ <node CREATED="1282722907306" ID="ID_1709875397" MODIFIED="1282722922669" TEXT="update_role">
40
+ <icon BUILTIN="bookmark"/>
41
+ </node>
42
+ </node>
43
+ <node CREATED="1273913393454" ID="ID_1088166839" MODIFIED="1511159690490" TEXT="link: pending tasks: /jinda/pending"/>
44
+ <node CREATED="1275790679363" ID="ID_829325467" MODIFIED="1511159696044" TEXT="link: logs: /jinda/logs"/>
45
+ <node CREATED="1507573166973" ID="ID_351025910" MODIFIED="1511159700908" TEXT="link: docs: /jinda/doc"/>
46
+ </node>
47
+ <node CREATED="1273706796854" FOLDED="true" ID="ID_1003882979" MODIFIED="1583097155227" TEXT="devs: Developer">
48
+ <node CREATED="1275373154914" ID="ID_340725299" MODIFIED="1275373158632" TEXT="role:d"/>
49
+ <node CREATED="1275788317299" ID="ID_716276608" MODIFIED="1511159716471" TEXT="link: error_logs: /jinda/error_logs"/>
50
+ </node>
51
+ <node CREATED="1493393619430" ID="ID_554831343" MODIFIED="1584996526651" TEXT="notes: Notes">
52
+ <node CREATED="1493489768542" ID="ID_737469676" MODIFIED="1581383331288" TEXT="link:My Notes: /notes/my">
53
+ <node CREATED="1493490295677" ID="ID_514416082" MODIFIED="1493490302239" TEXT="role:m"/>
54
+ </node>
55
+ <node CREATED="1493419257021" ID="ID_553734932" MODIFIED="1581180635669" TEXT="new: New Note">
56
+ <node CREATED="1493419299004" ID="ID_723334321" MODIFIED="1581351169990" TEXT="new_note: New ">
57
+ <icon BUILTIN="attach"/>
58
+ <node CREATED="1493479075294" ID="ID_1009521360" MODIFIED="1493479079687" TEXT="role:m"/>
59
+ </node>
60
+ <node CREATED="1493419491125" ID="ID_1125779183" MODIFIED="1581180747700" TEXT="create: Create">
61
+ <icon BUILTIN="bookmark"/>
62
+ </node>
63
+ </node>
64
+ <node CREATED="1493419562726" ID="ID_1241171950" MODIFIED="1581180788218" TEXT="edit: Edit">
65
+ <node CREATED="1493419577933" ID="ID_1790163920" MODIFIED="1581350888992" TEXT="select_note: Select">
66
+ <icon BUILTIN="attach"/>
67
+ <node CREATED="1493479602815" ID="ID_1289003986" MODIFIED="1493479606921" TEXT="role:m"/>
68
+ </node>
69
+ <node CREATED="1493419612720" ID="ID_938262436" MODIFIED="1581350996674" TEXT="edit_note: Edit">
70
+ <icon BUILTIN="attach"/>
71
+ <node CREATED="1493479557266" ID="ID_211108947" MODIFIED="1493479561055" TEXT="role:m"/>
72
+ </node>
73
+ <node CREATED="1493419735921" ID="ID_1581002301" MODIFIED="1581180869775" TEXT="update: Update">
74
+ <icon BUILTIN="bookmark"/>
75
+ </node>
76
+ </node>
77
+ <node CREATED="1495246388313" ID="ID_320521408" MODIFIED="1581340759604" STYLE="fork" TEXT="delete:Delete">
78
+ <edge COLOR="#808080" STYLE="bezier" WIDTH="thin"/>
79
+ <node CREATED="1493419577933" ID="ID_1631275659" MODIFIED="1581350942681" TEXT="select_note: Select">
80
+ <icon BUILTIN="attach"/>
81
+ <node CREATED="1493479602815" ID="ID_851238107" MODIFIED="1493479606921" TEXT="role:m"/>
82
+ </node>
83
+ <node CREATED="1495246466176" ID="ID_1347765598" MODIFIED="1581799929028" TEXT="delete: Delete">
84
+ <icon BUILTIN="bookmark"/>
85
+ </node>
86
+ </node>
87
+ <node CREATED="1581531446494" ID="ID_1325232876" MODIFIED="1581715693485" TEXT="mail: Mail">
88
+ <node CREATED="1493419577933" FOLDED="true" ID="ID_1817148049" MODIFIED="1581531563343" TEXT="select_note: Select">
89
+ <icon BUILTIN="attach"/>
90
+ <node CREATED="1493479602815" ID="ID_1650154281" MODIFIED="1493479606921" TEXT="role:m"/>
91
+ </node>
92
+ <node CREATED="1581531468872" ID="ID_379926448" MODIFIED="1581564690354" TEXT="display_mail: Dsiplay Mail">
93
+ <icon BUILTIN="attach"/>
94
+ </node>
95
+ <node CREATED="1581564346466" ID="ID_1981382192" MODIFIED="1581564388041" TEXT="mail: Mail">
96
+ <icon BUILTIN="bookmark"/>
97
+ </node>
98
+ </node>
99
+ <node CREATED="1495246388313" ID="ID_807216843" MODIFIED="1585001129104" TEXT="xedit: Future use">
100
+ <icon BUILTIN="button_cancel"/>
101
+ <node CREATED="1493419612720" ID="ID_6864095" MODIFIED="1584999031935" TEXT="edit_note: Edit">
102
+ <icon BUILTIN="attach"/>
103
+ <node CREATED="1493479557266" ID="ID_297597260" MODIFIED="1493479561055" TEXT="role:m"/>
104
+ </node>
105
+ <node CREATED="1581400438157" ID="ID_1206027492" MODIFIED="1581400464170" TEXT="update: Update">
106
+ <icon BUILTIN="bookmark"/>
107
+ </node>
108
+ </node>
109
+ </node>
110
+ <node CREATED="1493393619430" ID="ID_328863650" MODIFIED="1585001518753" TEXT="articles: Article">
111
+ <node CREATED="1493419096527" ID="ID_1521905276" MODIFIED="1493478060121" TEXT="link: All Articles: /articles"/>
112
+ <node CREATED="1493489768542" ID="ID_1376361427" MODIFIED="1493768994418" TEXT="link: My article: /articles/my">
113
+ <node CREATED="1493490295677" ID="ID_628476988" MODIFIED="1493490302239" TEXT="role:m"/>
114
+ </node>
115
+ <node CREATED="1493419257021" ID="ID_1355420049" MODIFIED="1493489729876" TEXT="new_article: New Article">
116
+ <node CREATED="1493419299004" ID="ID_1468250197" MODIFIED="1493419428686" TEXT="form_article: New Article">
117
+ <icon BUILTIN="attach"/>
118
+ <node CREATED="1493479075294" ID="ID_1145618514" MODIFIED="1493479079687" TEXT="role:m"/>
119
+ </node>
120
+ <node CREATED="1493419491125" ID="ID_1687683396" MODIFIED="1493483244848" TEXT="create: Create Article">
121
+ <icon BUILTIN="bookmark"/>
122
+ </node>
123
+ </node>
124
+ <node CREATED="1493419562726" ID="ID_922854639" MODIFIED="1493490306480" TEXT="edit_article: Edit Article">
125
+ <node CREATED="1493419577933" ID="ID_938626803" MODIFIED="1538329139586" TEXT="select_article: Select Article">
126
+ <icon BUILTIN="attach"/>
127
+ <node CREATED="1493479602815" ID="ID_753056881" MODIFIED="1493479606921" TEXT="role:m"/>
128
+ </node>
129
+ <node CREATED="1493419612720" ID="ID_661682947" MODIFIED="1493524438941" TEXT="edit_article: Edit Article">
130
+ <icon BUILTIN="attach"/>
131
+ <node CREATED="1493479557266" ID="ID_1681993437" MODIFIED="1493479561055" TEXT="role:m"/>
132
+ </node>
133
+ <node CREATED="1493419735921" ID="ID_1575963748" MODIFIED="1493489477505" TEXT="update: Update Article">
134
+ <icon BUILTIN="bookmark"/>
135
+ </node>
136
+ </node>
137
+ <node CREATED="1495246388313" ID="ID_1861034169" MODIFIED="1585001527103" TEXT="xedit_article: xEdit Article">
138
+ <icon BUILTIN="button_cancel"/>
139
+ <node CREATED="1495246432533" ID="ID_91386173" MODIFIED="1495267233398" TEXT="edit_article: Edit Article">
140
+ <icon BUILTIN="attach"/>
141
+ <node CREATED="1495246517185" ID="ID_1224073606" MODIFIED="1495246522964" TEXT="role:m"/>
142
+ </node>
143
+ <node CREATED="1495246466176" ID="ID_1635586443" MODIFIED="1495266959360" TEXT="update: Update Article">
144
+ <icon BUILTIN="bookmark"/>
145
+ </node>
146
+ </node>
147
+ </node>
148
+ <node CREATED="1493664700564" FOLDED="true" ID="ID_704959130" MODIFIED="1583091848193" TEXT="comments: Comment">
149
+ <node CREATED="1493665155709" ID="ID_1973520751" MODIFIED="1493665186791" TEXT="new_comment: New Comment">
150
+ <node CREATED="1493665192413" ID="ID_345629058" MODIFIED="1493665226422" TEXT="create">
151
+ <icon BUILTIN="bookmark"/>
152
+ <node CREATED="1493665231940" ID="ID_1645532530" MODIFIED="1493665237018" TEXT="role:m"/>
153
+ </node>
154
+ </node>
155
+ <node CREATED="1494393494180" ID="ID_1101205873" MODIFIED="1495275996686" TEXT="role:m"/>
156
+ </node>
157
+ <node CREATED="1489875563330" FOLDED="true" ID="ID_1495015891" MODIFIED="1507248509212" TEXT="ctrs: ctrs&amp; Menu">
158
+ <node CREATED="1489875583646" ID="ID_1796125628" MODIFIED="1494393464288" TEXT="role:a"/>
159
+ <node CREATED="1275905802131" ID="ID_1960607342" MODIFIED="1489938927874" TEXT="vfolder1:Sub Menu 1">
160
+ <node CREATED="1275756515843" ID="ID_328242903" MODIFIED="1489939229748" TEXT="viewfile1: Title 1">
161
+ <icon BUILTIN="attach"/>
162
+ <node CREATED="1282816887988" ID="ID_1479413309" MODIFIED="1282817769412" TEXT="rule:login? &amp;&amp; own_xmain?"/>
163
+ </node>
164
+ <node CREATED="1275756515843" ID="ID_1316819449" MODIFIED="1490683859703" TEXT="viewfile2: Title 2">
165
+ <icon BUILTIN="attach"/>
166
+ <node CREATED="1282816887988" ID="ID_1510989172" MODIFIED="1282817769412" TEXT="rule:login? &amp;&amp; own_xmain?"/>
167
+ </node>
168
+ <node CREATED="1275756530989" ID="ID_171099141" MODIFIED="1489939276491" TEXT="update_viewfile1">
169
+ <icon BUILTIN="bookmark"/>
170
+ </node>
171
+ </node>
172
+ <node CREATED="1275756504750" ID="ID_914236141" MODIFIED="1489939000929" TEXT="vfolder2:Title 2">
173
+ <node CREATED="1275756515843" ID="ID_1222970183" MODIFIED="1489939293714" TEXT="viewfile2: Title 2">
174
+ <icon BUILTIN="attach"/>
175
+ <node CREATED="1282816887988" ID="ID_1312913420" MODIFIED="1282817769412" TEXT="rule:login? &amp;&amp; own_xmain?"/>
176
+ </node>
177
+ </node>
178
+ </node>
179
+ <node CREATED="1494172726642" ID="ID_925257043" MODIFIED="1494172755433" TEXT="sitemap: Sitemap">
180
+ <node CREATED="1494172758253" ID="ID_961056168" MODIFIED="1494172797972" TEXT="sitemap: Sitemap"/>
181
+ <node CREATED="1494393494180" ID="ID_242460166" MODIFIED="1494393504971" TEXT="role:a"/>
182
+ </node>
183
+ <node CREATED="1493393619430" ID="ID_35210833" MODIFIED="1585089057213" TEXT="api/v1/notes: Notes API ">
184
+ <node CREATED="1493489768542" ID="ID_1053900670" MODIFIED="1582131857208" TEXT="link:My Notes: /api/v1/notes/my">
185
+ <node CREATED="1493490295677" ID="ID_1597553308" MODIFIED="1493490302239" TEXT="role:m"/>
186
+ </node>
187
+ <node CREATED="1493419257021" ID="ID_1182560700" MODIFIED="1581180635669" TEXT="new: New Note">
188
+ <node CREATED="1493419299004" ID="ID_840380967" MODIFIED="1581351169990" TEXT="new_note: New ">
189
+ <icon BUILTIN="attach"/>
190
+ <node CREATED="1493479075294" ID="ID_10690659" MODIFIED="1493479079687" TEXT="role:m"/>
191
+ </node>
192
+ <node CREATED="1493419491125" ID="ID_924027059" MODIFIED="1581180747700" TEXT="create: Create">
193
+ <icon BUILTIN="bookmark"/>
194
+ </node>
195
+ </node>
196
+ <node CREATED="1493419562726" ID="ID_963001770" MODIFIED="1581180788218" TEXT="edit: Edit">
197
+ <node CREATED="1493419577933" ID="ID_1640736660" MODIFIED="1581350888992" TEXT="select_note: Select">
198
+ <icon BUILTIN="attach"/>
199
+ <node CREATED="1493479602815" ID="ID_1623444138" MODIFIED="1493479606921" TEXT="role:m"/>
200
+ </node>
201
+ <node CREATED="1493419612720" ID="ID_1362613316" MODIFIED="1581350996674" TEXT="edit_note: Edit">
202
+ <icon BUILTIN="attach"/>
203
+ <node CREATED="1493479557266" ID="ID_1838104057" MODIFIED="1493479561055" TEXT="role:m"/>
204
+ </node>
205
+ <node CREATED="1493419735921" ID="ID_1445882396" MODIFIED="1581180869775" TEXT="update: Update">
206
+ <icon BUILTIN="bookmark"/>
207
+ </node>
208
+ </node>
209
+ <node CREATED="1495246388313" ID="ID_918406528" MODIFIED="1581340759604" STYLE="fork" TEXT="delete:Delete">
210
+ <edge COLOR="#808080" STYLE="bezier" WIDTH="thin"/>
211
+ <node CREATED="1493419577933" ID="ID_809771470" MODIFIED="1581350942681" TEXT="select_note: Select">
212
+ <icon BUILTIN="attach"/>
213
+ <node CREATED="1493479602815" ID="ID_1160875526" MODIFIED="1493479606921" TEXT="role:m"/>
214
+ </node>
215
+ <node CREATED="1495246466176" ID="ID_506410154" MODIFIED="1581799929028" TEXT="delete: Delete">
216
+ <icon BUILTIN="bookmark"/>
217
+ </node>
218
+ </node>
219
+ </node>
220
+ </node>
221
+ <node CREATED="1273819465949" FOLDED="true" ID="ID_855471610" MODIFIED="1583097143651" POSITION="right" TEXT="roles">
222
+ <node CREATED="1273819847470" ID="ID_1681080231" MODIFIED="1330477307826" TEXT="m: member"/>
223
+ <node CREATED="1273819855875" ID="ID_1429503284" MODIFIED="1330477311102" TEXT="a: admin"/>
224
+ <node CREATED="1273819859775" ID="ID_568365839" MODIFIED="1330477315009" TEXT="d: developer"/>
225
+ </node>
226
+ <node CREATED="1273819456867" ID="ID_1677010054" MODIFIED="1493418874718" POSITION="left" TEXT="models">
227
+ <node CREATED="1292122118499" FOLDED="true" ID="ID_1957754752" MODIFIED="1493705885123" TEXT="person">
228
+ <node CREATED="1292122135809" ID="ID_1617970069" MODIFIED="1332878659106" TEXT="fname"/>
229
+ <node CREATED="1292122150362" ID="ID_1200135538" MODIFIED="1332878662388" TEXT="lname"/>
230
+ <node CREATED="1332876694150" ID="ID_1770958985" MODIFIED="1332876730552" TEXT="sex: integer">
231
+ <node CREATED="1332878665790" ID="ID_793089342" MODIFIED="1332878668499" TEXT="1: male"/>
232
+ <node CREATED="1332878669085" ID="ID_1796007763" MODIFIED="1332878673144" TEXT="2: female"/>
233
+ </node>
234
+ <node CREATED="1292123322429" ID="ID_1509464300" MODIFIED="1332878620176" TEXT="belongs_to :address">
235
+ <icon BUILTIN="edit"/>
236
+ </node>
237
+ <node CREATED="1292122156430" ID="ID_604231613" MODIFIED="1292122161324" TEXT="dob: date"/>
238
+ <node CREATED="1286576968143" ID="ID_936807610" MODIFIED="1332878681362" TEXT="phone"/>
239
+ <node CREATED="1290823140269" ID="ID_1957301629" MODIFIED="1332878684453" TEXT="photo"/>
240
+ </node>
241
+ <node CREATED="1292122236285" FOLDED="true" ID="ID_959987887" MODIFIED="1493768919147" TEXT="address">
242
+ <node CREATED="1292122254622" ID="ID_430517150" MODIFIED="1355422372241" TEXT="address_street"/>
243
+ <node CREATED="1355422373525" ID="ID_1797865138" MODIFIED="1355422378352" TEXT="city"/>
244
+ <node CREATED="1355422378959" ID="ID_1964490487" MODIFIED="1355422380765" TEXT="state"/>
245
+ <node CREATED="1355422381231" ID="ID_1226075540" MODIFIED="1355422382748" TEXT="zip"/>
246
+ <node CREATED="1332876680122" ID="ID_65427990" MODIFIED="1332876682148" TEXT="phone"/>
247
+ <node CREATED="1292243471343" ID="ID_1859608350" MODIFIED="1310195256623" TEXT="lat: float"/>
248
+ <node CREATED="1292243477436" ID="ID_48497260" MODIFIED="1310195262534" TEXT="lng: float"/>
249
+ </node>
250
+ <node CREATED="1493418879485" FOLDED="true" ID="ID_1995497233" MODIFIED="1583097163789" TEXT="article">
251
+ <node CREATED="1493418891110" ID="ID_364756011" MODIFIED="1493418905253" TEXT="title"/>
252
+ <node CREATED="1493418906868" ID="ID_1676483995" MODIFIED="1493418911919" TEXT="text"/>
253
+ <node CREATED="1493487131376" ID="ID_1334057464" MODIFIED="1538328284823" TEXT="belongs_to :user, :class_name =&gt; &quot;User&quot;">
254
+ <icon BUILTIN="edit"/>
255
+ </node>
256
+ <node CREATED="1493705838166" ID="ID_408271104" MODIFIED="1493705877062" TEXT="has_many :comments">
257
+ <icon BUILTIN="edit"/>
258
+ </node>
259
+ <node CREATED="1493718773517" ID="ID_944554146" MODIFIED="1493718808965" TEXT="validates :title, :text, :user_id, presence: true">
260
+ <icon BUILTIN="edit"/>
261
+ </node>
262
+ <node CREATED="1494181636998" ID="ID_229502630" MODIFIED="1494181660419" TEXT="body"/>
263
+ <node CREATED="1497913676275" ID="ID_404103076" MODIFIED="1497913685065" TEXT="keywords"/>
264
+ </node>
265
+ <node CREATED="1493418915637" FOLDED="true" ID="ID_429078131" MODIFIED="1583097162517" TEXT="comment">
266
+ <node CREATED="1493418939760" ID="ID_1251093062" MODIFIED="1493418943423" TEXT="body"/>
267
+ <node CREATED="1493418945686" ID="ID_911071644" MODIFIED="1493418986711" TEXT="belongs_to :article">
268
+ <icon BUILTIN="edit"/>
269
+ </node>
270
+ <node CREATED="1493643129947" ID="ID_588013696" MODIFIED="1493643146424" TEXT="belongs_to :user">
271
+ <icon BUILTIN="edit"/>
272
+ </node>
273
+ <node CREATED="1493718512191" ID="ID_173203253" MODIFIED="1493718583874" TEXT="validates :body, :user_id, :article_id, presence: true">
274
+ <icon BUILTIN="edit"/>
275
+ </node>
276
+ </node>
277
+ <node CREATED="1494040082403" FOLDED="true" ID="ID_864577403" MODIFIED="1583097161145" TEXT="picture">
278
+ <node CREATED="1494040091583" ID="ID_679208099" MODIFIED="1494040119098" TEXT="picture"/>
279
+ <node CREATED="1494040120208" ID="ID_1266154874" MODIFIED="1494040125130" TEXT="description"/>
280
+ <node CREATED="1493487131376" ID="ID_1422817360" MODIFIED="1493487186856" TEXT="belongs_to :user">
281
+ <icon BUILTIN="edit"/>
282
+ </node>
283
+ </node>
284
+ <node CREATED="1581177067029" FOLDED="true" ID="ID_1450593753" MODIFIED="1583089083450" TEXT="note">
285
+ <node CREATED="1581243923100" ID="ID_537548385" MODIFIED="1581243965554" TEXT="include Mongoid::Attributes::Dynamic">
286
+ <icon BUILTIN="edit"/>
287
+ </node>
288
+ <node CREATED="1581177848957" ID="ID_1611227370" MODIFIED="1581177857470" TEXT="title"/>
289
+ <node CREATED="1581177867775" ID="ID_88547965" MODIFIED="1581177883555" TEXT="body"/>
290
+ <node CREATED="1493643129947" ID="ID_1655403736" MODIFIED="1493643146424" TEXT="belongs_to :user">
291
+ <icon BUILTIN="edit"/>
292
+ </node>
293
+ <node CREATED="1581984419312" ID="ID_1934899110" MODIFIED="1581985586488" TEXT="before_validation :ensure_title_has_a_value ">
294
+ <icon BUILTIN="edit"/>
295
+ </node>
296
+ <node CREATED="1581495182445" ID="ID_1430552418" MODIFIED="1581985664674" TEXT="validates :title, length: { maximum: (MAX_TITLE_LENGTH = 30), message: &quot;Must be less than 30 characters&quot; }, presence: true">
297
+ <icon BUILTIN="edit"/>
298
+ </node>
299
+ <node CREATED="1581495221779" ID="ID_1231500988" MODIFIED="1581985709585" TEXT="validates :body, length: { maximum: (MAX_BODY_LENGTH = 1000), message: &quot;Must be less than 1000 characters&quot;} ">
300
+ <icon BUILTIN="edit"/>
301
+ </node>
302
+ <node CREATED="1581986280028" ID="ID_1069060625" MODIFIED="1581987310544" TEXT="private&#xa; def ensure_title_has_a_value&#xa; if title.blank?&#xa; self.title = body[0..(MAX_TITLE_LENGTH-1)] unless body.blank?&#xa; end&#xa; end&#xa; &#xa;">
303
+ <icon BUILTIN="edit"/>
304
+ </node>
305
+ </node>
306
+ </node>
307
+ </node>
308
+ </map>
@@ -63,13 +63,22 @@ module Jinda
63
63
  def redirect_to_root
64
64
  redirect_to root_path
65
65
  end
66
+ # Todo refactor code
66
67
  def get_option(opt, runseq=@runseq)
68
+ ma_log("Todo in def get_option(opt, runseq=@runseq)")
67
69
  xml= REXML::Document.new(runseq.xml).root
68
70
  url=''
69
- xml.each_element('///node') do |n|
70
- text= n.attributes['TEXT']
71
- url= text if text =~/^#{opt}:\s*/
71
+ # xml.each_element('///node') do |n|
72
+ xml.each_element('/node') do |n|
73
+ if n.attributes['TEXT']
74
+ text = n.attributes['TEXT']
75
+ puts "text = " + text
76
+ url= text if text =~ /^#{opt}:\s*/
77
+ puts "url = " + url
78
+ ma_log("Todo in def get_option(opt, runseq=@runseq)")
79
+ end
72
80
  end
81
+ return nil if url.blank?
73
82
  c, h= url.split(':', 2)
74
83
  opt= h ? h.strip : false
75
84
  end
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.4.9"
2
+ VERSION = "0.5.0"
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.4.9
4
+ version: 0.5.0
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: 2020-03-30 00:00:00.000000000 Z
12
+ date: 2020-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -157,7 +157,7 @@ files:
157
157
  - lib/generators/jinda/templates/app/assets/javascripts/application.js
158
158
  - lib/generators/jinda/templates/app/assets/javascripts/application.js-jqm
159
159
  - lib/generators/jinda/templates/app/assets/javascripts/cable.js
160
- - lib/generators/jinda/templates/app/assets/javascripts/disable_enter_key.js-org
160
+ - lib/generators/jinda/templates/app/assets/javascripts/disable_enter_key.js
161
161
  - lib/generators/jinda/templates/app/assets/javascripts/iscroll-wrapper.js
162
162
  - lib/generators/jinda/templates/app/assets/javascripts/iscroll.js
163
163
  - lib/generators/jinda/templates/app/assets/javascripts/jinda.js
@@ -202,6 +202,7 @@ files:
202
202
  - lib/generators/jinda/templates/app/assets/stylesheets/jquery.mobile.splitview.css
203
203
  - lib/generators/jinda/templates/app/assets/stylesheets/kul-4.2.css
204
204
  - lib/generators/jinda/templates/app/assets/stylesheets/kul-4.2.min.css
205
+ - lib/generators/jinda/templates/app/assets/stylesheets/modules.scss
205
206
  - lib/generators/jinda/templates/app/assets/stylesheets/sarabun.css
206
207
  - lib/generators/jinda/templates/app/assets/stylesheets/social.scss
207
208
  - lib/generators/jinda/templates/app/channels/application_cable/channel.rb
@@ -372,6 +373,7 @@ files:
372
373
  - lib/generators/jinda/templates/test/test_helper.rb
373
374
  - lib/jinda.rb
374
375
  - lib/jinda/ template/view.html.erb
376
+ - lib/jinda/app/jinda/index.mm
375
377
  - lib/jinda/app/jinda/template/view.html.erb
376
378
  - lib/jinda/gemhelpers.rb
377
379
  - lib/jinda/helpers.rb