jinda 0.4.9 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/generators/jinda/install_generator.rb +13 -6
  4. data/lib/generators/jinda/templates/README.md +3 -3
  5. data/lib/generators/jinda/templates/app/assets/javascripts/{disable_enter_key.js-org → disable_enter_key.js} +0 -0
  6. data/lib/generators/jinda/templates/app/assets/stylesheets/modules.scss +84 -0
  7. data/lib/generators/jinda/templates/app/controllers/concerns/jinda_general_concern.rb +179 -0
  8. data/lib/generators/jinda/templates/app/controllers/concerns/jinda_run_concern.rb +351 -0
  9. data/lib/generators/jinda/templates/app/controllers/jinda_org/docs_controller.rb +55 -0
  10. data/lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb +30 -544
  11. data/lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb +4 -7
  12. data/lib/generators/jinda/templates/app/jinda/index.mm +55 -15
  13. data/lib/generators/jinda/templates/app/jinda/template/view.html.erb +22 -23
  14. data/lib/generators/jinda/templates/app/models/jinda/doc.rb +31 -17
  15. data/lib/generators/jinda/templates/app/views/docs/doc_edit/doc_edit.html.erb +21 -0
  16. data/lib/generators/jinda/templates/app/views/docs/doc_edit/doc_select.html.erb +14 -0
  17. data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.html.erb +26 -0
  18. data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.md +36 -0
  19. data/lib/generators/jinda/templates/app/views/docs/doc_xedit/doc_edit.html.erb +21 -0
  20. data/lib/generators/jinda/templates/app/views/docs/edit/select_note.html.erb +14 -0
  21. data/lib/generators/jinda/templates/app/views/docs/index.haml +21 -0
  22. data/lib/generators/jinda/templates/app/views/docs/my.haml +27 -0
  23. data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +3 -3
  24. data/lib/generators/jinda/templates/app/views/jinda/run_output.haml +3 -3
  25. data/lib/generators/jinda/templates/app/views/notes/my.haml +1 -1
  26. data/lib/jinda/helpers.rb +208 -59
  27. data/lib/jinda/version.rb +1 -1
  28. metadata +17 -8
  29. data/lib/generators/jinda/templates/app/controllers/ctrs_controller.rb-gem-test +0 -2
  30. data/lib/jinda/ template/view.html.erb +0 -25
  31. data/lib/jinda/app/jinda/template/view.html.erb +0 -27
@@ -20,8 +20,8 @@ class NotesController < ApplicationController
20
20
 
21
21
  def create
22
22
  @note = Note.new(
23
- title: $xvars["new_note"]["title"],
24
- body: $xvars["new_note"]["body"],
23
+ title: $xvars["new_note"]["note"]["title"],
24
+ body: $xvars["new_note"]["note"]["body"],
25
25
  user_id: $xvars["user_id"])
26
26
  @note.save!
27
27
  # if @note.save!
@@ -31,7 +31,6 @@ class NotesController < ApplicationController
31
31
  # format.html { render :new }
32
32
  # format.json { render json: @note.errors, status: :unprocessable_entity }
33
33
  # end
34
- redirect_to @note
35
34
 
36
35
  end
37
36
 
@@ -42,10 +41,8 @@ class NotesController < ApplicationController
42
41
  # They contain everything that we get their forms select_note and edit_note
43
42
  note_id = $xvars["select_note"] ? $xvars["select_note"]["id"] : $xvars["p"]["note_id"]
44
43
  @note = Note.find(note_id)
45
- @note.update(title: $xvars["edit_note"]["title"],
46
- body: $xvars["edit_note"]["body"])
47
- redirect_to @note
48
-
44
+ @note.update(title: $xvars["edit_note"]["note"]["title"],
45
+ body: $xvars["edit_note"]["note"]["body"])
49
46
  end
50
47
 
51
48
  def delete
@@ -1,7 +1,7 @@
1
1
  <map version="1.0.1">
2
2
  <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
3
3
  <node CREATED="1273819432637" ID="ID_1098419600" MODIFIED="1334737006485" TEXT="Jinda">
4
- <node CREATED="1273819462973" ID="ID_282419531" MODIFIED="1583088810861" POSITION="right" TEXT="services">
4
+ <node CREATED="1273819462973" ID="ID_282419531" MODIFIED="1589756758387" POSITION="right" TEXT="services">
5
5
  <node CREATED="1275756501221" FOLDED="true" ID="ID_1720745721" MODIFIED="1583097151076" TEXT="users:User">
6
6
  <node CREATED="1278491598711" ID="ID_1662699954" MODIFIED="1494393920347" TEXT="role:m"/>
7
7
  <node CREATED="1279700865182" ID="ID_1266797279" MODIFIED="1357798847781" TEXT="link:info: /users"/>
@@ -25,7 +25,7 @@
25
25
  </node>
26
26
  </node>
27
27
  </node>
28
- <node CREATED="1275752678377" FOLDED="true" ID="ID_1348489452" MODIFIED="1583097147577" TEXT="admins:Admin">
28
+ <node CREATED="1275752678377" ID="ID_1348489452" MODIFIED="1588883079396" TEXT="admins:Admin">
29
29
  <node CREATED="1275752688167" ID="ID_229996461" MODIFIED="1275752690948" TEXT="role:a"/>
30
30
  <node CREATED="1282722836614" ID="ID_1213363124" MODIFIED="1330477902602" TEXT="edit_role:edit user role">
31
31
  <node CREATED="1282722862918" ID="ID_1190117882" MODIFIED="1330477922159" TEXT="select_user:select user">
@@ -44,15 +44,54 @@
44
44
  <node CREATED="1275790679363" ID="ID_829325467" MODIFIED="1511159696044" TEXT="link: logs: /jinda/logs"/>
45
45
  <node CREATED="1507573166973" ID="ID_351025910" MODIFIED="1511159700908" TEXT="link: docs: /jinda/doc"/>
46
46
  </node>
47
- <node CREATED="1273706796854" FOLDED="true" ID="ID_1003882979" MODIFIED="1583097155227" TEXT="devs: Developer">
47
+ <node CREATED="1273706796854" ID="ID_1003882979" MODIFIED="1588964401951" TEXT="devs: Developer">
48
48
  <node CREATED="1275373154914" ID="ID_340725299" MODIFIED="1275373158632" TEXT="role:d"/>
49
49
  <node CREATED="1275788317299" ID="ID_716276608" MODIFIED="1511159716471" TEXT="link: error_logs: /jinda/error_logs"/>
50
+ <node CREATED="1275788317299" ID="ID_1570419198" MODIFIED="1587858894833" TEXT="link: notice_logs: /jinda/notice_logs"/>
51
+ </node>
52
+ <node CREATED="1589756777499" ID="ID_853155456" MODIFIED="1589772589662" TEXT="docs: Document">
53
+ <node CREATED="1589757073388" ID="ID_1938238774" MODIFIED="1589772640862" TEXT="link: My Document: /docs/my">
54
+ <node CREATED="1589757125861" ID="ID_521286668" MODIFIED="1589757136547" TEXT="role:m"/>
55
+ </node>
56
+ <node CREATED="1589756879955" ID="ID_899042293" MODIFIED="1589910229085" TEXT="doc_new: New Document">
57
+ <node CREATED="1589756946117" ID="ID_1840278804" MODIFIED="1589910235469" TEXT="doc_form: Doc Form">
58
+ <icon BUILTIN="attach"/>
59
+ <node CREATED="1589757054618" ID="ID_642998203" MODIFIED="1589757059003" TEXT="role: m"/>
60
+ </node>
61
+ <node CREATED="1589757264764" ID="ID_1352102524" MODIFIED="1589772413612" TEXT="doc_update: Doc update">
62
+ <icon BUILTIN="bookmark"/>
63
+ </node>
64
+ </node>
65
+ <node CREATED="1493419562726" ID="ID_339628868" MODIFIED="1590424956484" TEXT="doc_edit: Edit Document">
66
+ <icon BUILTIN="button_cancel"/>
67
+ <node CREATED="1493419577933" ID="ID_801950372" MODIFIED="1590180699851" TEXT="doc_select: Select Document">
68
+ <icon BUILTIN="attach"/>
69
+ <node CREATED="1493479602815" ID="ID_761787946" MODIFIED="1493479606921" TEXT="role:m"/>
70
+ </node>
71
+ <node CREATED="1493419612720" ID="ID_1190499756" MODIFIED="1590180735204" TEXT="doc_edit: Edit Document">
72
+ <icon BUILTIN="attach"/>
73
+ <node CREATED="1493479557266" ID="ID_1216426484" MODIFIED="1493479561055" TEXT="role:m"/>
74
+ </node>
75
+ <node CREATED="1581400438157" ID="ID_447781815" MODIFIED="1590180242343" TEXT="doc_update: Doc_update">
76
+ <icon BUILTIN="bookmark"/>
77
+ </node>
78
+ </node>
79
+ <node CREATED="1495246388313" ID="ID_278169779" MODIFIED="1590180135106" TEXT="doc_xedit: Doc_hidden_menu">
80
+ <icon BUILTIN="button_cancel"/>
81
+ <node CREATED="1493419612720" ID="ID_541432768" MODIFIED="1590180160498" TEXT="doc_edit: Edit">
82
+ <icon BUILTIN="attach"/>
83
+ <node CREATED="1493479557266" ID="ID_1339913531" MODIFIED="1493479561055" TEXT="role:m"/>
84
+ </node>
85
+ <node CREATED="1581400438157" ID="ID_802199910" MODIFIED="1590180242343" TEXT="doc_update: Doc_update">
86
+ <icon BUILTIN="bookmark"/>
87
+ </node>
88
+ </node>
50
89
  </node>
51
90
  <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">
91
+ <node CREATED="1493489768542" ID="ID_737469676" MODIFIED="1589772615102" TEXT="link:My Notes: /notes/my">
53
92
  <node CREATED="1493490295677" ID="ID_514416082" MODIFIED="1493490302239" TEXT="role:m"/>
54
93
  </node>
55
- <node CREATED="1493419257021" ID="ID_553734932" MODIFIED="1581180635669" TEXT="new: New Note">
94
+ <node CREATED="1493419257021" FOLDED="true" ID="ID_553734932" MODIFIED="1589772585873" TEXT="new: New Note">
56
95
  <node CREATED="1493419299004" ID="ID_723334321" MODIFIED="1581351169990" TEXT="new_note: New ">
57
96
  <icon BUILTIN="attach"/>
58
97
  <node CREATED="1493479075294" ID="ID_1009521360" MODIFIED="1493479079687" TEXT="role:m"/>
@@ -96,7 +135,7 @@
96
135
  <icon BUILTIN="bookmark"/>
97
136
  </node>
98
137
  </node>
99
- <node CREATED="1495246388313" ID="ID_807216843" MODIFIED="1585001129104" TEXT="xedit: Future use">
138
+ <node CREATED="1495246388313" FOLDED="true" ID="ID_807216843" MODIFIED="1590180066630" TEXT="xedit: Future use">
100
139
  <icon BUILTIN="button_cancel"/>
101
140
  <node CREATED="1493419612720" ID="ID_6864095" MODIFIED="1584999031935" TEXT="edit_note: Edit">
102
141
  <icon BUILTIN="attach"/>
@@ -107,12 +146,16 @@
107
146
  </node>
108
147
  </node>
109
148
  </node>
110
- <node CREATED="1493393619430" ID="ID_328863650" MODIFIED="1585001518753" TEXT="articles: Article">
149
+ <node CREATED="1493393619430" ID="ID_328863650" MODIFIED="1589327646872" TEXT="articles: Article">
111
150
  <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">
151
+ <node CREATED="1493489768542" FOLDED="true" ID="ID_1376361427" MODIFIED="1589757167952" TEXT="link: My article: /articles/my">
113
152
  <node CREATED="1493490295677" ID="ID_628476988" MODIFIED="1493490302239" TEXT="role:m"/>
114
153
  </node>
115
- <node CREATED="1493419257021" ID="ID_1355420049" MODIFIED="1493489729876" TEXT="new_article: New Article">
154
+ <node CREATED="1493419257021" ID="ID_1355420049" MODIFIED="1588619429446" TEXT="new_article: New Article">
155
+ <node CREATED="1588958814863" ID="ID_576640224" MODIFIED="1589053904119" TEXT="display: DisplayFile">
156
+ <icon BUILTIN="idea"/>
157
+ <node CREATED="1588959451085" ID="ID_779920893" MODIFIED="1588959473698" TEXT="display: Option"/>
158
+ </node>
116
159
  <node CREATED="1493419299004" ID="ID_1468250197" MODIFIED="1493419428686" TEXT="form_article: New Article">
117
160
  <icon BUILTIN="attach"/>
118
161
  <node CREATED="1493479075294" ID="ID_1145618514" MODIFIED="1493479079687" TEXT="role:m"/>
@@ -121,7 +164,7 @@
121
164
  <icon BUILTIN="bookmark"/>
122
165
  </node>
123
166
  </node>
124
- <node CREATED="1493419562726" ID="ID_922854639" MODIFIED="1493490306480" TEXT="edit_article: Edit Article">
167
+ <node CREATED="1493419562726" ID="ID_922854639" MODIFIED="1590180584955" TEXT="edit_article: Edit Article">
125
168
  <node CREATED="1493419577933" ID="ID_938626803" MODIFIED="1538329139586" TEXT="select_article: Select Article">
126
169
  <icon BUILTIN="attach"/>
127
170
  <node CREATED="1493479602815" ID="ID_753056881" MODIFIED="1493479606921" TEXT="role:m"/>
@@ -181,7 +224,8 @@
181
224
  <node CREATED="1494393494180" ID="ID_242460166" MODIFIED="1494393504971" TEXT="role:a"/>
182
225
  </node>
183
226
  <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">
227
+ <node CREATED="1493489768542" ID="ID_1053900670" MODIFIED="1591074318558" TEXT="link:My Notes: /api/v1/notes/my">
228
+ <icon BUILTIN="button_cancel"/>
185
229
  <node CREATED="1493490295677" ID="ID_1597553308" MODIFIED="1493490302239" TEXT="role:m"/>
186
230
  </node>
187
231
  <node CREATED="1493419257021" ID="ID_1182560700" MODIFIED="1581180635669" TEXT="new: New Note">
@@ -194,10 +238,6 @@
194
238
  </node>
195
239
  </node>
196
240
  <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
241
  <node CREATED="1493419612720" ID="ID_1362613316" MODIFIED="1581350996674" TEXT="edit_note: Edit">
202
242
  <icon BUILTIN="attach"/>
203
243
  <node CREATED="1493479557266" ID="ID_1838104057" MODIFIED="1493479561055" TEXT="role:m"/>
@@ -1,27 +1,26 @@
1
1
  <%
2
- doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
2
+ doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
3
  %>
4
4
  <%= fields_for doc do |f| %>
5
-
6
- <%= f.select :x, [["SELECTION 1", 1], ["SELECTION 2", 2], ["SELECTION 3", 3]] %>
7
-
8
-
9
- <%= f.label :x, "Reference number" %>
10
- <%= f.text_field :x %>
5
+ <%= f.label :category, "Category" %>
6
+ <%= f.select :category, [["Book", "book"], ["Letter", "letter"], ["Brochure", "brochure"]] %>
11
7
  <!--div>
12
- <%= f.label :w, "Confidential" , :class=>"ui-input-text" %>
13
- <%= f.select :w, [['normal',0],['secret',1],['top secret',2]],{},"data-native-menu"=>"false" %>
14
- </div-->
15
- <%= f.label :issue_on, "Dated" %>
16
- <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
17
- <%= f.label :y, "Summary" %>
18
- <%= f.text_area :summary, :cols=>50, :rows=>6 %>
19
- <%= f.label :dscan, "Attached document" %>
20
- <%= f.file_field :dscan %>
21
- <% end %>
22
- <%= label_tag :z, "Ungroup field" %>
23
- <%= text_field_tag :z %>
24
- <!--div>
25
- <%= label_tag :yes, "Logic field", :class=>"ui-input-text" %>
26
- <%= select_tag :yes, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
27
- </div-->
8
+ </div-->
9
+ <%= f.label :issue_on, "Dated" %>
10
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
11
+
12
+ <%= f.label :dscan, "Attached document" %>
13
+ <%= f.file_field :dscan %>
14
+ <% end %>
15
+ <div>
16
+ <%= label_tag :description, "Description" %>
17
+ <%= text_field_tag :description %>
18
+ </div>
19
+ <div>
20
+ <%= label_tag :ma_display, "Display", :class=>"ui-input-text" %>
21
+ <%= select_tag :ma_display, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
22
+ </div>
23
+ <div>
24
+ <%= label_tag :keywords, "Search Keywords" %>
25
+ <%= text_field_tag :keywords %>
26
+ </div>
@@ -1,22 +1,36 @@
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
5
+ include Mongoid::Attributes::Dynamic
6
+ field :name, :type => String
7
+ field :filename, :type => String
8
+ field :content_type, :type => String
9
+ field :data_text, :type => String
10
+ field :url, :type => String
11
+ field :basename, :type => String
12
+ field :cloudinary, :type => Boolean
13
+ belongs_to :xmain, :class_name => "Jinda::Xmain"
14
+ belongs_to :runseq, :class_name => "Jinda::Runseq"
15
+ belongs_to :user
16
+ belongs_to :service, :class_name => "Jinda::Service"
17
+ field :ip, :type => String
18
+ field :description, :type => String
19
+ field :category, :type => String
20
+ field :ma_display, :type => Boolean
21
+ field :ma_secured, :type => Boolean
18
22
  field :dscan, :type => String
19
- field :process_at, :type => Date
20
- field :issue_on, :type => Date
21
- # jinda end
23
+ field :keywords, :type => String
24
+
25
+ def self.search(q, page, per_page=PER_PAGE)
26
+ paginate :per_page=>per_page, :page => page, :conditions =>
27
+ ["content_type=? AND data_text LIKE ? AND (ma_secured=? OR ma_user_id=?)",
28
+ "output", "%#{q}%", false, session[:user_id] ],
29
+ :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id'
30
+ end
31
+ def self.search_ma_secured(q, page, per_page=PER_PAGE)
32
+ paginate :per_page=>per_page, :page => page, :conditions =>
33
+ ["content_type=? AND data_text LIKE ?", "output", "%#{q}%" ],
34
+ :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id'
35
+ end
22
36
  end
@@ -0,0 +1,21 @@
1
+ <%
2
+ doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
+ %>
4
+ <%= fields_for doc do |f| %>
5
+ <%= f.label :content_type, "Content type" %>
6
+ <%= f.select :content_type, [["pdf file", "pdf"], ["png file", "png"], ["html file", "html"]] %>
7
+ <!--div>
8
+ </div-->
9
+ <%= f.label :issue_on, "Dated" %>
10
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
11
+
12
+ <%= f.label :dscan, "Attached document" %>
13
+ <%= f.file_field :dscan %>
14
+ <%= f.label :filename, "File Name" %>
15
+ <% end %>
16
+ <%= label_tag :x, "x field" %>
17
+ <%= text_field_tag :x %>
18
+ <div>
19
+ <%= label_tag :ma_display, "Display", :class=>"ui-input-text" %>
20
+ <%= select_tag :ma_display, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
21
+ </div>
@@ -0,0 +1,14 @@
1
+
2
+ <%
3
+ if current_ma_user.role.upcase.split(',').include?("A")
4
+ note= Jinda::Doc.all.desc(:created_at)
5
+ else
6
+ note= Jinda::Doc.where(user: current_ma_user).desc(:created_at)
7
+ end
8
+ %>
9
+ <div class="field" data-role="fieldcontain">
10
+ <%= label_tag :filename, 'Select Document' %>
11
+ <br>
12
+ <br>
13
+ <%= select_tag :id, options_from_collection_for_select(note, :id, :filename), "notee-menu"=>"false" %>
14
+ </div>
@@ -0,0 +1,26 @@
1
+ <%
2
+ 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-->
9
+ <%= f.label :issue_on, "Dated" %>
10
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
11
+
12
+ <%= f.label :dscan, "Attached document" %>
13
+ <%= f.file_field :dscan %>
14
+ <% end %>
15
+ <div>
16
+ <%= label_tag :description, "Description" %>
17
+ <%= text_field_tag :description %>
18
+ </div>
19
+ <div>
20
+ <%= label_tag :ma_display, "Display", :class=>"ui-input-text" %>
21
+ <%= select_tag :ma_display, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
22
+ </div>
23
+ <div>
24
+ <%= label_tag :keywords, "Search Keywords" %>
25
+ <%= text_field_tag :keywords %>
26
+ </div>
@@ -0,0 +1,36 @@
1
+ <style>code { font-size: 0.8em;}</style>
2
+
3
+ <%= File.read('README.md') %>
4
+
5
+ ***
6
+
7
+ # Help (UNDER CONSTRUCTION: DUI)
8
+
9
+ <%= render :partial=>'jinda/modul.md', :collection=> Jinda::Module.all.asc(:seq) %>
10
+
11
+ ***
12
+
13
+ # Admin
14
+
15
+ ## Data Structure
16
+
17
+ <%- models= @app.elements["//node[@TEXT='models']"] %>
18
+
19
+ <%= render :partial=>'jinda/model.md', :collection=> models.map {|m| m.attributes["TEXT"] } %>
20
+
21
+ ***
22
+
23
+ # Contents
24
+
25
+ ## markdown
26
+
27
+ This document created and edited with
28
+ <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">markdown</a>
29
+
30
+ Contents:
31
+
32
+ * Requirement at `README.md`
33
+ * Controller Help at `app/controllers/system.md`
34
+ * Project at `app/views/project/<งาน>.md`
35
+ *
36
+ *
@@ -0,0 +1,21 @@
1
+ <%
2
+ doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
+ %>
4
+ <%= fields_for doc do |f| %>
5
+ <%= f.label :content_type, "Content type" %>
6
+ <%= f.select :content_type, [["pdf file", "pdf"], ["png file", "png"], ["html file", "html"]] %>
7
+ <!--div>
8
+ </div-->
9
+ <%= f.label :issue_on, "Dated" %>
10
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
11
+
12
+ <%= f.label :dscan, "Attached document" %>
13
+ <%= f.file_field :dscan %>
14
+ <%= f.label :filename, "File Name" %>
15
+ <% end %>
16
+ <%= label_tag :x, "x field" %>
17
+ <%= text_field_tag :x %>
18
+ <div>
19
+ <%= label_tag :ma_display, "Display", :class=>"ui-input-text" %>
20
+ <%= select_tag :ma_display, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
21
+ </div>
@@ -0,0 +1,14 @@
1
+
2
+ <%
3
+ if current_ma_user.role.upcase.split(',').include?("A")
4
+ note= Note.all.desc(:created_at)
5
+ else
6
+ note= Note.where(user: current_ma_user).desc(:created_at)
7
+ end
8
+ %>
9
+ <div class="field" data-role="fieldcontain">
10
+ <%= label_tag :title, 'Select Note' %>
11
+ <br>
12
+ <br>
13
+ <%= select_tag :id, options_from_collection_for_select(note, :id, :title), "notee-menu"=>"false" %>
14
+ </div>
@@ -0,0 +1,21 @@
1
+ - @title= "My Articles"
2
+ %p
3
+ - @page_title = 'All Articlces'
4
+ = paginate @articles
5
+ %table#article-table
6
+ %tr
7
+ %th Title
8
+ %th Description
9
+ %th Created
10
+ %th Updated
11
+ %th Delete
12
+ %th Edit
13
+ - @articles.each do |article|
14
+ %tr
15
+ %td= link_to article.title, :controller=>"articles", :action=>"show", :id=>article.id
16
+ %td= article.text.html_safe
17
+ %td= article.created_at.strftime('%m/%d/%Y')
18
+ %td= article.updated_at.strftime('%m/%d/%Y')
19
+ %td(align='center')= link_to image_tag('delete.png', style:'border:none; float:none;'), "#", :onclick=>"if (confirm('Please Confirm')) {location.hash='/articles/destroy/#{article.id}';}"
20
+ %td(align='center')= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "jinda", action: "init", s: 'articles:xedit_article', article_id: article.id}, data: { confirm: "Please Confirm" }
21
+
@@ -0,0 +1,27 @@
1
+ - @title= "My Documents"
2
+ %p
3
+ - @page_title = 'All Documents'
4
+ = paginate @docs
5
+ %table#document-table
6
+ %tr
7
+ %th File Name
8
+ %th Description
9
+ %th Category
10
+ %th Created
11
+ %th Delete
12
+ %th Edit
13
+ - @docs.each do |doc|
14
+ %tr
15
+ - @temp = doc.dscan
16
+ - if !@temp.blank?
17
+ - @dscan = @temp.scan(/document\/([^*]*)/).last.last
18
+ %td= link_to doc.filename, "#{jinda_document_path}?id=#{@dscan}", target: :_blank
19
+ - else
20
+ %td= doc.filename
21
+ %td= doc.description
22
+ %td= doc.category
23
+ %td= doc.created_at.strftime('%m/%d/%Y')
24
+ %td(align='center')= link_to image_tag('delete.png', style:'border:none; float:none;'), {controller: "docs", action: "destroy", doc_id: doc.id}, data: { confirm: "Please Confirm" }
25
+ %td(align='center')= image_tag('pencil.png', style:'border:none; float:none;')
26
+ - # To do
27
+ - # %td(align='center')= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "jinda", action: "init", s: 'docs:xedit_doc', doc_id: doc.id}, data: { confirm: "Please Confirm" }