jinda 0.5.2 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/generators/jinda/install_generator.rb +10 -2
- data/lib/generators/jinda/templates/README.md +1 -1
- data/lib/generators/jinda/templates/app/assets/stylesheets/app.scss +11 -5
- data/lib/generators/jinda/templates/app/assets/stylesheets/articles.scss +16 -6
- data/lib/generators/jinda/templates/app/controllers/concerns/jinda_general_concern.rb +27 -4
- data/lib/generators/jinda/templates/app/controllers/concerns/jinda_run_concern.rb +135 -6
- data/lib/generators/jinda/templates/app/controllers/jinda_org/application_controller.rb +0 -1
- data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +58 -35
- data/lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb +12 -10
- data/lib/generators/jinda/templates/app/controllers/jinda_org/docs_controller.rb +56 -0
- data/lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb +23 -2
- data/lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb +6 -8
- data/lib/generators/jinda/templates/app/jinda/index.mm +90 -25
- data/lib/generators/jinda/templates/app/jinda/template/view.html.erb +22 -23
- data/lib/generators/jinda/templates/app/models/jinda/doc.rb +5 -0
- data/lib/generators/jinda/templates/app/views/articles/index.haml +2 -2
- data/lib/generators/jinda/templates/app/views/articles/my.haml +3 -3
- data/lib/generators/jinda/templates/app/views/articles/new_article/form_article.html.erb +5 -3
- data/lib/generators/jinda/templates/app/views/articles/show.html.haml +4 -3
- data/lib/generators/jinda/templates/app/views/docs/doc_edit/doc_edit.html.erb +21 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_edit/doc_select.html.erb +14 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.html.erb +26 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.md +36 -0
- data/lib/generators/jinda/templates/app/views/docs/doc_xedit/doc_edit.html.erb +21 -0
- data/lib/generators/jinda/templates/app/views/docs/edit/select_note.html.erb +14 -0
- data/lib/generators/jinda/templates/app/views/docs/index.haml +21 -0
- data/lib/generators/jinda/templates/app/views/docs/my.haml +27 -0
- data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +3 -3
- data/lib/generators/jinda/templates/app/views/jinda/run_output.haml +3 -3
- data/lib/generators/jinda/templates/app/views/layouts/_head.html.erb +7 -10
- data/lib/generators/jinda/templates/app/views/layouts/{_metatag.html.erb → _meta_tag.html.erb} +0 -0
- data/lib/generators/jinda/templates/app/views/layouts/jqm/_full.haml +1 -9
- data/lib/generators/jinda/templates/app/views/notes/new/new_note.html.erb +1 -1
- data/lib/jinda/helpers.rb +11 -16
- data/lib/jinda/version.rb +1 -1
- data/lib/jquery.validate.js +1293 -0
- metadata +13 -8
- data/lib/generators/jinda/templates/app/views/layouts/_meta_tags.html.erb +0 -5
- data/lib/generators/jinda/templates/app/views/new.html.erb +0 -7
- data/lib/jinda/ template/view.html.erb +0 -25
- data/lib/jinda/app/jinda/index.mm +0 -309
- data/lib/jinda/app/jinda/template/view.html.erb +0 -27
@@ -1,27 +1,26 @@
|
|
1
1
|
<%
|
2
|
-
|
2
|
+
doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
|
3
3
|
%>
|
4
4
|
<%= fields_for doc do |f| %>
|
5
|
-
|
6
|
-
|
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
|
-
|
13
|
-
<%= f.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<%=
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
class Jinda::Doc
|
3
3
|
include Mongoid::Document
|
4
4
|
include Mongoid::Timestamps
|
5
|
+
include Mongoid::Attributes::Dynamic
|
5
6
|
field :name, :type => String
|
6
7
|
field :filename, :type => String
|
7
8
|
field :content_type, :type => String
|
@@ -14,8 +15,12 @@ class Jinda::Doc
|
|
14
15
|
belongs_to :user
|
15
16
|
belongs_to :service, :class_name => "Jinda::Service"
|
16
17
|
field :ip, :type => String
|
18
|
+
field :description, :type => String
|
19
|
+
field :category, :type => String
|
17
20
|
field :ma_display, :type => Boolean
|
18
21
|
field :ma_secured, :type => Boolean
|
22
|
+
field :dscan, :type => String
|
23
|
+
field :keywords, :type => String
|
19
24
|
|
20
25
|
def self.search(q, page, per_page=PER_PAGE)
|
21
26
|
paginate :per_page=>per_page, :page => page, :conditions =>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
- @articles.each do |article|
|
12
12
|
%tr
|
13
13
|
%td= article.user.code if article.user
|
14
|
-
%td= link_to article.title, :controller=>"articles", :action=>"show", :
|
14
|
+
%td= link_to article.title, :controller=>"articles", :action=>"show", :article_id=>article.id
|
15
15
|
%td= article.text
|
16
16
|
%td= article.created_at
|
17
17
|
%td= article.updated_at
|
@@ -20,4 +20,4 @@
|
|
20
20
|
- unless current_ma_user.role.upcase.split(',').include?("A")
|
21
21
|
- next unless article.user
|
22
22
|
- next unless current_ma_user == article.user
|
23
|
-
= link_to image_tag('delete.png', style:'border:none; float:none;'), "
|
23
|
+
= link_to image_tag('delete.png', style:'border:none; float:none;'), {controller: "articles", action: "destroy", article_id: article.id}, data: { confirm: "Please Confirm" }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
- @title= "My Articles"
|
2
2
|
%p
|
3
3
|
- @page_title = 'All Articlces'
|
4
|
-
= paginate @
|
4
|
+
= paginate @my_articles
|
5
5
|
%table#article-table
|
6
6
|
%tr
|
7
7
|
%th Title
|
@@ -10,9 +10,9 @@
|
|
10
10
|
%th Updated
|
11
11
|
%th Delete
|
12
12
|
%th Edit
|
13
|
-
- @
|
13
|
+
- @my_articles.each do |article|
|
14
14
|
%tr
|
15
|
-
%td= link_to article.title, :controller=>"articles", :action=>"show", :
|
15
|
+
%td= link_to article.title, :controller=>"articles", :action=>"show", :article_id => article.id
|
16
16
|
%td= article.text.html_safe
|
17
17
|
%td= article.created_at.strftime('%m/%d/%Y')
|
18
18
|
%td= article.updated_at.strftime('%m/%d/%Y')
|
@@ -2,13 +2,15 @@
|
|
2
2
|
<%
|
3
3
|
article = @article
|
4
4
|
%>
|
5
|
+
<div id="article-table">
|
5
6
|
<%= fields_for article do |f| %>
|
6
7
|
<%= f.label :title, "Title" %>
|
7
|
-
<%= f.text_field :title %>
|
8
|
+
<%= f.text_field :title, :required => true %>
|
8
9
|
<%= f.label :text, "Description" %>
|
9
|
-
<%= f.text_field :text %>
|
10
|
+
<%= f.text_field :text, :required => true %>
|
10
11
|
<%= f.label :text, "Keywords" %>
|
11
12
|
<%= f.text_field :keywords %>
|
12
13
|
<%= f.label :body, "Body Content" %>
|
13
|
-
<%= f.text_area :body %>
|
14
|
+
<%= f.text_area :body, :required => true %>
|
14
15
|
<% end %>
|
16
|
+
</div>
|
@@ -7,18 +7,19 @@
|
|
7
7
|
|
8
8
|
#article-text= @article.body.html_safe
|
9
9
|
|
10
|
-
= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "
|
10
|
+
= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "comments", action: "create", article_id: @article.id}, data: { confirm: "Please Confirm" }
|
11
11
|
- @comments.each do |comment|
|
12
12
|
%div#article-comment.ui-corner-all
|
13
13
|
Author:
|
14
14
|
%b= comment.user.code if comment.user
|
15
15
|
%div#comment-body
|
16
16
|
%i= comment.body
|
17
|
-
|
17
|
+
-#
|
18
18
|
- if login?
|
19
19
|
%h3 Add a comment:
|
20
|
-
= form_for @article.comments.build
|
20
|
+
= form_for([@comment, @article.comments.build]) do |f|
|
21
21
|
= f.hidden_field :article_id, :value => @article.id
|
22
22
|
= f.label :body, "Comment"
|
23
23
|
= f.text_area :body
|
24
|
+
= f.hidden_field :user_id, :value => current_ma_user
|
24
25
|
= f.submit
|
@@ -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" }
|
@@ -13,15 +13,15 @@
|
|
13
13
|
|
14
14
|
%h2 Recently tested with:
|
15
15
|
%ul
|
16
|
-
%li Rubygems 2.7.
|
17
|
-
%li Rails 6.0.
|
16
|
+
%li Rubygems 2.7.1
|
17
|
+
%li Rails 6.0.3
|
18
18
|
%li rails new YOURAPP --skip-test-unit --skip-bundle --skip-active-record --skip-javascript --skip-turbolinks
|
19
19
|
%li (rails new YOURAPP -BOTJ)
|
20
20
|
|
21
21
|
|
22
22
|
%h2 Installation
|
23
23
|
%ul
|
24
|
-
%li add gem 'jinda', '0.5.
|
24
|
+
%li add gem 'jinda', '0.5.7'
|
25
25
|
%li bundle
|
26
26
|
%li rails generate jinda:install
|
27
27
|
%li (run all with "sh install.sh" )
|
@@ -22,7 +22,7 @@
|
|
22
22
|
%th= t "user"
|
23
23
|
%th= "date"
|
24
24
|
- @xmain.docs.each do |doc|
|
25
|
-
- next unless doc.
|
25
|
+
- next unless doc.ma_display
|
26
26
|
%tr
|
27
27
|
%td= doc.id
|
28
28
|
%td
|
@@ -32,7 +32,7 @@
|
|
32
32
|
= image_tag 'page_attach.png'
|
33
33
|
= link_to_blank align_text(doc.name), :controller=>"jinda", :action=>:document, :id=>doc.id
|
34
34
|
%td= doc.filename
|
35
|
-
%td= doc.user.
|
36
|
-
%td=
|
35
|
+
%td= doc.user.code
|
36
|
+
%td= doc.updated_at
|
37
37
|
= submit_tag @message
|
38
38
|
%p
|
@@ -1,13 +1,10 @@
|
|
1
1
|
<head>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<meta name="language" content="en, th" />
|
6
|
-
<title>eLocal</title>
|
7
|
-
<link rel="shortcut icon" href="/assets/favicon.ico" />
|
8
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
|
9
|
-
<%= stylesheet_link_tag "jinda", "sarabun" %>
|
2
|
+
<%= favicon_link_tag %>
|
3
|
+
<%= csrf_meta_tags %>
|
4
|
+
<%= meta_tags %>
|
10
5
|
<meta name="description" content="Jinda" />
|
11
|
-
<%=
|
12
|
-
<%= javascript_include_tag "application", "
|
6
|
+
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track":"reload" %>
|
7
|
+
<%= javascript_include_tag "application", "data-turbolinks-track": "reload" %>
|
8
|
+
<%= stylesheet_link_tag "jinda", "sarabun" %>
|
9
|
+
<script src = "https://ajax.aspnetcdn.com/ajax/jquery.validate/1.12.0/jquery.validate.js" ></script>
|
13
10
|
</head>
|
data/lib/generators/jinda/templates/app/views/layouts/{_metatag.html.erb → _meta_tag.html.erb}
RENAMED
File without changes
|
@@ -1,15 +1,7 @@
|
|
1
1
|
!!! 5
|
2
2
|
%html
|
3
3
|
%head
|
4
|
-
=
|
5
|
-
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
|
6
|
-
= javascript_include_tag "application", 'data-turbolinks-track': 'reload'
|
7
|
-
= csrf_meta_tags
|
8
|
-
= display_meta_tags
|
9
|
-
- if GMAP
|
10
|
-
= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false"
|
11
|
-
-# if ADSENSE
|
12
|
-
= render :partial => 'custom/adsense'
|
4
|
+
= render :partial => "layouts/head"
|
13
5
|
%body
|
14
6
|
= render :partial => "jinda/menu"
|
15
7
|
%div{"data-id" => "main", "data-role" => "panel", "data-backbtn"=>"false"}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<%= fields_for doc, validate: true do |f| %>
|
8
8
|
<%= f.label :title, "Title" %>
|
9
|
-
<%= f.text_field :title %><Br>
|
9
|
+
<%= f.text_field :title, :required => true %><Br>
|
10
10
|
<%= f.label :body, "Body Content" %>
|
11
11
|
<%= f.text_area :body, :cols=>50, :rows=>6, required: true %>
|
12
12
|
<% end %>
|
data/lib/jinda/helpers.rb
CHANGED
@@ -107,7 +107,7 @@ module Jinda
|
|
107
107
|
return false unless action
|
108
108
|
i= i + 1
|
109
109
|
output_ma_display= false
|
110
|
-
if action=='output'
|
110
|
+
if action== ('output'|| 'list' ||'folder')
|
111
111
|
ma_display= get_option_xml("display", activity)
|
112
112
|
if ma_display && !affirm(ma_display)
|
113
113
|
output_ma_display= false
|
@@ -166,19 +166,6 @@ module Jinda
|
|
166
166
|
@runseq.save
|
167
167
|
end
|
168
168
|
|
169
|
-
def document
|
170
|
-
doc = Jinda::Doc.find params[:id]
|
171
|
-
if doc.cloudinary
|
172
|
-
require 'net/http'
|
173
|
-
require "uri"
|
174
|
-
uri = URI.parse(doc.url)
|
175
|
-
data = Net::HTTP.get_response(uri)
|
176
|
-
send_data(data.body, :filename=>doc.filename, :type=>doc.content_type, :disposition=>"inline")
|
177
|
-
else
|
178
|
-
data= read_binary(doc.url)
|
179
|
-
send_data(data, :filename=>doc.filename, :type=>doc.content_type, :disposition=>"inline")
|
180
|
-
end
|
181
|
-
end
|
182
169
|
def b(s)
|
183
170
|
"<b>#{s}</b>".html_safe
|
184
171
|
end
|
@@ -212,6 +199,7 @@ module Jinda
|
|
212
199
|
def redirect_to_root
|
213
200
|
redirect_to root_path
|
214
201
|
end
|
202
|
+
|
215
203
|
# Todo refactor code
|
216
204
|
def get_option(opt, runseq=@runseq)
|
217
205
|
xml= REXML::Document.new(runseq.xml).root
|
@@ -306,6 +294,7 @@ module Jinda
|
|
306
294
|
step1 = REXML::Document.new(xml).root.elements['node']
|
307
295
|
role= get_option_xml("role", step1) || ""
|
308
296
|
# rule= get_option_xml("rule", step1) || true
|
297
|
+
rule= get_option_xml("rule", step1) || true
|
309
298
|
return true if role==""
|
310
299
|
unless current_ma_user
|
311
300
|
return role.blank?
|
@@ -313,6 +302,7 @@ module Jinda
|
|
313
302
|
return false unless current_ma_user.role
|
314
303
|
return current_ma_user.has_role(role)
|
315
304
|
end
|
305
|
+
|
316
306
|
end
|
317
307
|
def ma_log(message)
|
318
308
|
# Jinda::Notice.create :message => ERB::Util.html_escape(message.gsub("`","'")),
|
@@ -851,11 +841,16 @@ module Jinda
|
|
851
841
|
when 'help' # Question
|
852
842
|
'if'
|
853
843
|
when 'forward' # Forward
|
854
|
-
'redirect'
|
844
|
+
# 'redirect'
|
845
|
+
'direct_to'
|
855
846
|
when 'kaddressbook' #Phone
|
856
847
|
'invoke' # invoke new service along the way
|
857
|
-
when '
|
848
|
+
when 'idea' # output
|
858
849
|
'output'
|
850
|
+
when 'list' # List
|
851
|
+
'list'
|
852
|
+
when 'folder' # Folder
|
853
|
+
'folder'
|
859
854
|
when 'mail'
|
860
855
|
'mail'
|
861
856
|
when 'xmag' # Tobe discussed
|