jinda 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/lib/generators/jinda/templates/app/assets/stylesheets/application.css +7 -0
  4. data/lib/generators/jinda/templates/app/assets/stylesheets/jinda.css +0 -86
  5. data/lib/generators/jinda/templates/app/controllers/jinda_org/admins_controller.rb +1 -1
  6. data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +1 -1
  7. data/lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb +3 -3
  8. data/lib/generators/jinda/templates/app/controllers/jinda_org/password_resets_controller.rb +3 -3
  9. data/lib/generators/jinda/templates/app/controllers/jinda_org/sessions_controller.rb +1 -1
  10. data/lib/generators/jinda/templates/app/jinda/index.mm +1 -1
  11. data/lib/generators/jinda/templates/app/models/article.rb +1 -1
  12. data/lib/generators/jinda/templates/app/models/comment.rb +1 -1
  13. data/lib/generators/jinda/templates/app/models/jinda/notice.rb +1 -1
  14. data/lib/generators/jinda/templates/app/models/jinda/role.rb +1 -1
  15. data/lib/generators/jinda/templates/app/models/jinda/runseq.rb +1 -1
  16. data/lib/generators/jinda/templates/app/models/jinda/xmain.rb +1 -1
  17. data/lib/generators/jinda/templates/app/models/{jinda/user.rb → user.rb} +1 -1
  18. data/lib/generators/jinda/templates/app/views/admins/edit_role/edit_role.html.erb +1 -1
  19. data/lib/generators/jinda/templates/app/views/admins/edit_role/select_user.html.erb +1 -1
  20. data/lib/generators/jinda/templates/app/views/identities/new.html.erb +32 -30
  21. data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +1 -1
  22. data/lib/generators/jinda/templates/app/views/jinda/notice_logs.haml +1 -1
  23. data/lib/generators/jinda/templates/app/views/jinda/run_form.haml +36 -35
  24. data/lib/generators/jinda/templates/app/views/sessions/new.html.erb +20 -16
  25. data/lib/generators/jinda/templates/db/seeds.rb +1 -1
  26. data/lib/generators/jinda/templates/spec/models/user_spec.rb +1 -1
  27. data/lib/generators/jinda/templates/spec/support/factory_bot.rb +1 -1
  28. data/lib/jinda/helpers.rb +1 -1
  29. data/lib/jinda/version.rb +1 -1
  30. data/lib/tasks/jinda.rake +1 -1
  31. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cd4de28f45b4463ded5ffebe8043fbcfb119e2e7c5efd3b363b8204c9be59e3
4
- data.tar.gz: 7c4ac62821ed90f54e9d4a79be1a50af44e19582a400435759caa6ecd7763e3b
3
+ metadata.gz: 673f63519baba2d14750c80b76aea80d6c5823289dcb174c40ed2c9d484f61f6
4
+ data.tar.gz: 9af4281b173296766412ae636e9e7ba79f98eab8ab1f10a438370b0f88ff378d
5
5
  SHA512:
6
- metadata.gz: 0eaba51a975152a236b4437ce7db88cd5f9c286d6a062ed4cb91362bb4a284eaf064d2c6b8bc0767ac8311fce447249a2e670484682d0791b8c9bd8189442998
7
- data.tar.gz: 6dea82f8dbee880741ebab8a4a8e249962d457f15869294aa55d6b703bebdfc73e6d1cf044e431ec07d7274010d7aa2989237d4f8db346954c81bbe27441d7e1
6
+ metadata.gz: 871c548a4ddc1f98cddb49781e13a00f1852c7aa52ed53318bb0d068b235f101fc495a8e87fbd8a26f1da224081e5ab2cbeaef70422a98d84ebcc87ea743dc0c
7
+ data.tar.gz: 1f0c3b66424e3e6a7dba74019c48f0cecb57d3f28bacbb377e9e4a72cea24764d25f8e87dcae40818a6e4aeaf49d2e3b8635ea91b3a9452e39edae788e4a70e0
data/README.md CHANGED
@@ -27,7 +27,8 @@ These versions works for sure but others may do.
27
27
  * authentication use omniauth-identity
28
28
 
29
29
  ## Sample Application
30
-
30
+ ### Screen shot install Jinda
31
+ * https://www.youtube.com/watch?v=XUXv7Yrskjk&feature=youtu.be
31
32
  ### Sample Jinda in Docker
32
33
 
33
34
  * https://github.com/kul1/b-255523-jd
@@ -39,7 +40,7 @@ app without ActiveRecord
39
40
 
40
41
  ## Add jinda to your Gemfile:
41
42
 
42
- gem 'jinda', '~> 0.4.3'
43
+ gem 'jinda', '~> 0.4.4'
43
44
 
44
45
  For Development (most updated)
45
46
 
@@ -25,3 +25,10 @@
25
25
  @import "font-awesome-sprockets";
26
26
  @import "font-awesome";
27
27
  @import "social";
28
+
29
+
30
+
31
+
32
+
33
+
34
+
@@ -1,22 +1,3 @@
1
- body {
2
- font-size: 1em;
3
- }
4
- .map {
5
- margin-bottom: 1em;
6
- }
7
- .map img {
8
- max-width: none !important;
9
- }
10
- #output_link {
11
- text-align:center;
12
- border: 3px solid #999;
13
- background-color: #ddd;
14
- height: 80px;
15
- padding-top: 10px;
16
- }
17
- #output_link a {
18
- font-size:36pt;
19
- }
20
1
  #tooltip{
21
2
  position:absolute;
22
3
  border:1px solid #333;
@@ -69,70 +50,3 @@ body {
69
50
  display: table-cell;
70
51
  text-align:center;
71
52
  }
72
- #title {
73
- font-size: 16pt;
74
- font-weight: bold;
75
- }
76
- #subtitle {
77
- font-weight: bold;
78
- text-align:right;
79
- }
80
-
81
- .ui-btn-inner { padding: 2px 25px; }
82
- .ui-btn-up-c,
83
- .ui-btn-hover-c,
84
- .ui-btn-down-c {
85
- font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
86
- /*font-size: 110%;*/
87
- }
88
- .ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: 7px 75px 7px 15px; display: block; }
89
- .ui-link-inherit { font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;}
90
- label.ui-input-text {
91
- font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
92
- /*font-size: 110%;*/
93
- text-shadow: none;
94
- }
95
- label.ui-select {
96
- font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
97
- /*font-size: 110%;*/
98
- text-shadow: none;
99
- }
100
- .ui-body-c {
101
- font-family: 'TH SarabunPSK', Helvetica, Arial, sans-serif;
102
- /*font-size: 1.4em;*/
103
- text-shadow: none;
104
- }
105
- .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; }
106
-
107
- .flickr_pagination {
108
- text-align: center;
109
- padding: .3em; }
110
- .flickr_pagination a, .flickr_pagination span {
111
- padding: .2em .5em; }
112
- .flickr_pagination span.disabled {
113
- color: #AAA; }
114
- .flickr_pagination span.current {
115
- font-weight: bold;
116
- color: #FF0084; }
117
- .flickr_pagination a {
118
- border: 1px solid #DDDDDD;
119
- color: #0063DC;
120
- text-decoration: none; }
121
- .flickr_pagination a:hover, .flickr_pagination a:focus {
122
- border-color: #003366;
123
- background: #0063DC;
124
- color: white; }
125
- .flickr_pagination .page_info {
126
- color: #aaa;
127
- padding-top: .8em; }
128
- .flickr_pagination .prev_page, .flickr_pagination .next_page {
129
- border-width: 2px; }
130
- .flickr_pagination .prev_page {
131
- margin-right: 1em; }
132
- .flickr_pagination .next_page {
133
- margin-left: 1em; }
134
-
135
-
136
-
137
-
138
-
@@ -1,6 +1,6 @@
1
1
  class AdminsController < ApplicationController
2
2
  def update_role
3
- user = Jinda::User.find_by :code=> $xvars["select_user"]["code"]
3
+ user = User.find_by :code=> $xvars["select_user"]["code"]
4
4
  user.update_attribute :role, $xvars["edit_role"]["role"]
5
5
  end
6
6
  end
@@ -50,7 +50,7 @@ class ArticlesController < ApplicationController
50
50
  #
51
51
  # duplicated from jinda_controller
52
52
  # Expected to use in jinda)controller
53
- current_ma_user = Jinda::User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
53
+ current_ma_user = User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
54
54
 
55
55
  if Rails.env.test? #Temp solution until fix test of current_ma_user
56
56
  current_ma_user = $xvars["current_ma_user"]
@@ -2,7 +2,7 @@ class PasswordResetsController < ApplicationController
2
2
 
3
3
  def create
4
4
  ##user = User.find_by_email(params[:email])
5
- user = Jinda::User.where(:email => params[:email]).first
5
+ user = User.where(:email => params[:email]).first
6
6
 
7
7
  user.send_password_reset if user
8
8
  redirect_to root_url, :notice => "Email sent with password reset instructions."
@@ -10,12 +10,12 @@ class PasswordResetsController < ApplicationController
10
10
 
11
11
  def edit
12
12
  ##@user = User.find_by_password_reset_token!(params[:id])
13
- @user = Jinda::User.where(:password_reset_token => params[:id]).first
13
+ @user = User.where(:password_reset_token => params[:id]).first
14
14
  end
15
15
 
16
16
  def update
17
17
  ##@user = User.find_by_password_reset_token!(params[:id])
18
- @user = Jinda::User.where(:password_reset_token => params[:id]).first
18
+ @user = User.where(:password_reset_token => params[:id]).first
19
19
  if @user.password_reset_sent_at < 2.hours.ago
20
20
  redirect_to new_password_reset_path, :alert => "Password reset has expired."
21
21
  elsif @user.update_attributes(params[:user])
@@ -5,7 +5,7 @@ class PasswordResetsController < ApplicationController
5
5
 
6
6
  def create
7
7
  #user = User.find_by_email(params[:email])
8
- user = Jinda::User.where(:email => params[:email]).first
8
+ user = User.where(:email => params[:email]).first
9
9
 
10
10
  user.send_password_reset if user
11
11
  redirect_to root_url, :ma_notice => "Email sent with password reset instructions."
@@ -14,12 +14,12 @@ class PasswordResetsController < ApplicationController
14
14
  def edit
15
15
  ## Deprecated syntax in rail 5
16
16
  ##@user = User.find_by_password_reset_token!(params[:id])
17
- @user = Jinda::User.where(:password_reset_token => params[:id]).first
17
+ @user = User.where(:password_reset_token => params[:id]).first
18
18
  end
19
19
 
20
20
  def update
21
21
  ##@user = User.find_by_password_reset_token!(params[:id])
22
- @user = Jinda::User.where(:password_reset_token => params[:id]).first
22
+ @user = User.where(:password_reset_token => params[:id]).first
23
23
  if @user.password_reset_sent_at < 2.hours.ago
24
24
  redirect_to new_password_reset_path, :alert => "Password &crarr;
25
25
  reset has expired."
@@ -13,7 +13,7 @@ class SessionsController < ApplicationController
13
13
  # see app/views/sessions/new.html.erb for sample
14
14
  def create
15
15
  auth = request.env["omniauth.auth"]
16
- user = Jinda::User.from_omniauth(auth)
16
+ user = User.from_omniauth(auth)
17
17
  session[:user_id] = user.id
18
18
  if params.permit[:remember_me]
19
19
  cookies.permanent[:auth_token] = user.auth_token
@@ -153,7 +153,7 @@
153
153
  <node CREATED="1493418879485" ID="ID_1995497233" MODIFIED="1493718770637" TEXT="article">
154
154
  <node CREATED="1493418891110" ID="ID_364756011" MODIFIED="1493418905253" TEXT="title"/>
155
155
  <node CREATED="1493418906868" ID="ID_1676483995" MODIFIED="1493418911919" TEXT="text"/>
156
- <node CREATED="1493487131376" ID="ID_1334057464" MODIFIED="1538328284823" TEXT="belongs_to :user, :class_name =&gt; &quot;Jinda::User&quot;">
156
+ <node CREATED="1493487131376" ID="ID_1334057464" MODIFIED="1538328284823" TEXT="belongs_to :user, :class_name =&gt; &quot;User&quot;">
157
157
  <icon BUILTIN="edit"/>
158
158
  </node>
159
159
  <node CREATED="1493705838166" ID="ID_408271104" MODIFIED="1493705877062" TEXT="has_many :comments">
@@ -5,7 +5,7 @@ class Article
5
5
  include Mongoid::Timestamps
6
6
  field :title, :type => String
7
7
  field :text, :type => String
8
- belongs_to :user, :class_name => "Jinda::User"
8
+ belongs_to :user, :class_name => "User"
9
9
  has_many :comments
10
10
  validates :title, :text, :user_id, presence: true
11
11
  field :body, :type => String
@@ -5,7 +5,7 @@ class Comment
5
5
  include Mongoid::Timestamps
6
6
  field :body, :type => String
7
7
  belongs_to :article
8
- belongs_to :user, :class_name => "Jinda::User"
8
+ belongs_to :user, :class_name => "User"
9
9
  validates :body, :user_id, :article_id, presence: true
10
10
  # jinda end
11
11
  end
@@ -5,7 +5,7 @@ class Jinda::Notice
5
5
  field :message, :type => String
6
6
  field :unread, :type => Boolean
7
7
  field :ip, :type => String
8
- belongs_to :user, :class_name => "Jinda::User"
8
+ belongs_to :user, :class_name => "User"
9
9
 
10
10
  def self.recent(user_id, ip)
11
11
  where(unread: true, ip: ip).last
@@ -4,5 +4,5 @@ class Jinda::Role
4
4
  include Mongoid::Timestamps
5
5
  field :code, :type => String
6
6
  field :name, :type => String
7
- belongs_to :user, :class_name => "Jinda::User"
7
+ belongs_to :user, :class_name => "User"
8
8
  end
@@ -2,7 +2,7 @@
2
2
  class Jinda::Runseq
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
5
- belongs_to :user, :class_name => "Jinda::User"
5
+ belongs_to :user, :class_name => "User"
6
6
  belongs_to :xmain, :class_name => "Jinda::Xmain"
7
7
 
8
8
  field :action, :type => String
@@ -10,7 +10,7 @@ class Jinda::Xmain
10
10
  field :name, :type => String
11
11
  field :ip, :type => String
12
12
  field :status, :type => String
13
- belongs_to :user, :class_name => "Jinda::User"
13
+ belongs_to :user, :class_name => "User"
14
14
  field :xvars, :type => Hash
15
15
  field :current_runseq, :type => String
16
16
  # Jinda end
@@ -1,4 +1,4 @@
1
- class Jinda::User
1
+ class User
2
2
  include Mongoid::Document
3
3
  # https://docs.mongodb.com/mongoid/master/tutorials/mongoid-indexes/
4
4
  index({ code: 1 }, { unique: true, name: "code_index" })
@@ -1,5 +1,5 @@
1
1
  <%
2
- user = Jinda::User.find_by :code=> $xvars["select_user"]["code"]
2
+ user = User.find_by :code=> $xvars["select_user"]["code"]
3
3
  %>
4
4
  Role codes seperated by comma
5
5
  <p>
@@ -1,4 +1,4 @@
1
1
  <div class="field" data-role="fieldcontain">
2
2
  <%= label_tag :code, 'User code' %>
3
- <%= select_tag :code, options_from_collection_for_select(Jinda::User.all.asc(:code), :code, :code), "data-native-menu"=>"false" %>
3
+ <%= select_tag :code, options_from_collection_for_select(User.all.asc(:code), :code, :code), "data-native-menu"=>"false" %>
4
4
  </div>
@@ -1,30 +1,32 @@
1
- <%- @title= 'Sign Up' %>
2
- <%= form_tag "/auth/identity/register", {'data-ajax'=>'false'} do %>
3
- <% if @identity && @identity.errors.any? %>
4
- <div class="error_messages">
5
- <h2><%= pluralize(@identity.errors.count, "error") %> prohibited this account from being saved:</h2>
6
- <ul>
7
- <% @identity.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
- <div class="field" data-role="fieldcontain">
14
- <%= label_tag :code, 'Username' %>
15
- <%= text_field_tag :code, @identity.try(:code) %>
16
- </div>
17
- <div class="field" data-role="fieldcontain">
18
- <%= label_tag :email %>
19
- <%= text_field_tag :email, @identity.try(:email) %>
20
- </div>
21
- <div class="field" data-role="fieldcontain">
22
- <%= label_tag :password, 'Password' %>
23
- <%= password_field_tag :password %>
24
- </div>
25
- <div class="field" data-role="fieldcontain">
26
- <%= label_tag :password_confirmation, 'Confirm password' %>
27
- <%= password_field_tag :password_confirmation %>
28
- </div>
29
- <div class="actions"><%= submit_tag "Sign Up" %></div>
30
- <% end %>
1
+ <div class="container">
2
+ <%- @title= 'Sign Up' %>
3
+ <%= form_tag "/auth/identity/register", {'data-ajax'=>'false'} do %>
4
+ <% if @identity && @identity.errors.any? %>
5
+ <div class="error_messages">
6
+ <h2><%= pluralize(@identity.errors.count, "error") %> prohibited this account from being saved:</h2>
7
+ <ul>
8
+ <% @identity.errors.full_messages.each do |msg| %>
9
+ <li><%= msg %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
14
+ <div class="field" data-role="fieldcontain">
15
+ <%= label_tag :code, 'Username' %>
16
+ <%= text_field_tag :code, @identity.try(:code) %>
17
+ </div>
18
+ <div class="field" data-role="fieldcontain">
19
+ <%= label_tag :email %>
20
+ <%= text_field_tag :email, @identity.try(:email) %>
21
+ </div>
22
+ <div class="field" data-role="fieldcontain">
23
+ <%= label_tag :password, 'Password' %>
24
+ <%= password_field_tag :password %>
25
+ </div>
26
+ <div class="field" data-role="fieldcontain">
27
+ <%= label_tag :password_confirmation, 'Confirm password' %>
28
+ <%= password_field_tag :password_confirmation %>
29
+ </div>
30
+ <div class="actions"><%= submit_tag "Sign Up" %></div>
31
+ <% end %>
32
+ </div>
@@ -21,7 +21,7 @@
21
21
 
22
22
  %h2 Installation
23
23
  %ul
24
- %li add gem 'jinda', '0.4.3'
24
+ %li add gem 'jinda', '0.4.4'
25
25
  %li bundle
26
26
  %li rails generate jinda:install
27
27
  %li (run all with "sh install.sh" )
@@ -9,7 +9,7 @@
9
9
  - @notice= notice
10
10
  - current_notice = @notice.id
11
11
  - #current_notice_user = @notice.user
12
- - notice_user = (Jinda::User.find @notice.user ? notice.user : 0)
12
+ - notice_user = (User.find @notice.user ? notice.user : 0)
13
13
  - (notice_user_name = notice_user.code) if notice_user
14
14
 
15
15
  %tr
@@ -1,37 +1,38 @@
1
- .head
2
- = step(@runseq.form_step, @xvars['total_form_steps'])
3
- %p
4
- - user = current_ma_user || User.new
5
- - form_class = 'formtastic'
6
- - next_step = 'end_form'
7
- - if @help
8
- %div(data-role="collapsible" data-theme="e" data-content-theme="c" data-mini="true")
9
- %h3 Help
10
- %p= markdown(@help)
11
- = form_tag({ :action => next_step } , {:multipart => true, :onSubmit=>'return validate()', :class=>form_class, "data-ajax"=>"#{ajax?(@ui)}"}) do
12
- = hidden_field_tag 'xmain_id', @xmain.id
13
- = hidden_field_tag 'ajax', ajax?(@ui)
14
- = hidden_field_tag 'runseq_id', @runseq.id
15
- = hidden_field_tag 'step', @xvars[:current_step]
16
- %div(data-role="fieldcontain")
17
- = render :inline=> @ui
1
+ .container
2
+ .head
3
+ = step(@runseq.form_step, @xvars['total_form_steps'])
18
4
  %p
19
- = submit_tag NEXT
20
- %p
21
- :javascript
22
- $(function() {
23
- $('.required').append('<span style="color:red"> *</span>');
24
- $('.refresh').append(" <img src='/images/refresh.png'/>");
25
- $("input").keypress(function (evt) {
26
- //Deterime where our character code is coming from within the event
27
- var charCode = evt.charCode || evt.keyCode;
28
- if (charCode == 13) { //Enter key's keycode
29
- alert("Please click the button");
30
- return false;
31
- }
5
+ - user = current_ma_user || User.new
6
+ - form_class = 'formtastic'
7
+ - next_step = 'end_form'
8
+ - if @help
9
+ %div(data-role="collapsible" data-theme="e" data-content-theme="c" data-mini="true")
10
+ %h3 Help
11
+ %p= markdown(@help)
12
+ = form_tag({ :action => next_step } , {:multipart => true, :onSubmit=>'return validate()', :class=>form_class, "data-ajax"=>"#{ajax?(@ui)}"}) do
13
+ = hidden_field_tag 'xmain_id', @xmain.id
14
+ = hidden_field_tag 'ajax', ajax?(@ui)
15
+ = hidden_field_tag 'runseq_id', @runseq.id
16
+ = hidden_field_tag 'step', @xvars[:current_step]
17
+ %div(data-role="fieldcontain")
18
+ = render :inline=> @ui
19
+ %p
20
+ = submit_tag NEXT
21
+ %p
22
+ :javascript
23
+ $(function() {
24
+ $('.required').append('<span style="color:red"> *</span>');
25
+ $('.refresh').append(" <img src='/images/refresh.png'/>");
26
+ $("input").keypress(function (evt) {
27
+ //Deterime where our character code is coming from within the event
28
+ var charCode = evt.charCode || evt.keyCode;
29
+ if (charCode == 13) { //Enter key's keycode
30
+ alert("Please click the button");
31
+ return false;
32
+ }
33
+ });
34
+ });
35
+ $( document ).one( "pagechange", function(){
36
+ $('input[type="file"]').textinput({theme: 'c'});
32
37
  });
33
- });
34
- $( document ).one( "pagechange", function(){
35
- $('input[type="file"]').textinput({theme: 'c'});
36
- });
37
-
38
+
@@ -1,16 +1,20 @@
1
- <%= form_tag "/auth/identity/callback", {'data-ajax'=>'false'} do %>
2
- <div class="field" data-role="fieldcontain">
3
- <%= label_tag :auth_key, "User name" %>
4
- <%= text_field_tag :auth_key %>
5
- </div>
6
- <div class="field" data-role="fieldcontain">
7
- <%= label_tag :password, "Password" %>
8
- <%= password_field_tag :password %>
9
- </div>
10
- <div class="field" data-role="fieldcontain" data-icon="info">
11
- <%= label_tag :remember_me %>
12
- <%= check_box_tag :remember_me, 1, params.permit[:remember_me] %>
13
- </div>
14
- <div class="actions"><%= submit_tag "Sign In" %></div>
15
- <%= link_to 'Forgotten password?', new_password_reset_path, data: {icon: 'info', mini: 'true', role: 'button'} %>
16
- <% end %>
1
+ <div class="container">
2
+ <div class="ui.head">
3
+ <%= form_tag "/auth/identity/callback", {'data-ajax'=>'false'} do %>
4
+ <div class="field" data-role="fieldcontain">
5
+ <%= label_tag :auth_key, "User name" %>
6
+ <%= text_field_tag :auth_key %>
7
+ </div>
8
+ <div class="field" data-role="fieldcontain">
9
+ <%= label_tag :password, "Password" %>
10
+ <%= password_field_tag :password %>
11
+ </div>
12
+ <div class="field" data-role="fieldcontain" data-icon="info">
13
+ <%= label_tag :remember_me %>
14
+ <%= check_box_tag :remember_me, 1, params.permit[:remember_me] %>
15
+ </div>
16
+ <div class="actions"><%= submit_tag "Sign In" %></div>
17
+ <%= link_to 'Forgotten password?', new_password_reset_path, data: {icon: 'info', mini: 'true', role: 'button'} %>
18
+ <% end %>
19
+ </div>
20
+ </div>
@@ -1,6 +1,6 @@
1
1
  unless Identity.where(code:"admin").exists?
2
2
  identity= Identity.create :code => "admin", :email => "admin@test.com", :password => "secret",
3
3
  :password_confirmation => "secret"
4
- Jinda::User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
4
+ User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
5
5
  :email => identity.email, :role => "M,A,D"
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- RSpec.describe "Jinda::User", :type => :model do
3
+ RSpec.describe "User", :type => :model do
4
4
  it "prevents duplicates " do
5
5
  user1 = create(:user, code: 'abc', email: 'test@email.com')
6
6
  user2 = build(:user, code: 'abc', email: 'test@email.com')
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :user, class: Jinda::User do
2
+ factory :user, class: User do
3
3
  code {"Tester"}
4
4
  email {"tester@test.comm"}
5
5
  end
data/lib/jinda/helpers.rb CHANGED
@@ -235,7 +235,7 @@ module Jinda
235
235
  # return nil
236
236
  # end
237
237
  #@user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token]
238
- @user ||= Jinda::User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
238
+ @user ||= User.where(:auth_token => cookies[:auth_token]).first if cookies[:auth_token]
239
239
  return @user
240
240
  end
241
241
 
data/lib/jinda/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
data/lib/tasks/jinda.rake CHANGED
@@ -19,7 +19,7 @@ namespace :jinda do
19
19
  unless Identity.where(code:"admin").exists?
20
20
  identity= Identity.create :code => "admin", :email => "admin@test.com", :password => "secret",
21
21
  :password_confirmation => "secret", :image => "https://user-images.githubusercontent.com/3953832/42472827-50ed8cbc-8388-11e8-8982-fa523c25288f.png"
22
- Jinda::User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
22
+ User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
23
23
  :email => identity.email, :role => "M,A,D", :auth_token => "71JxMH5fxi23zinBoq1uKA", :image => identity.image
24
24
  end
25
25
  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.3
4
+ version: 0.4.4
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: 2019-12-01 00:00:00.000000000 Z
12
+ date: 2019-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -248,10 +248,10 @@ files:
248
248
  - lib/generators/jinda/templates/app/models/jinda/role.rb
249
249
  - lib/generators/jinda/templates/app/models/jinda/runseq.rb
250
250
  - lib/generators/jinda/templates/app/models/jinda/service.rb
251
- - lib/generators/jinda/templates/app/models/jinda/user.rb
252
251
  - lib/generators/jinda/templates/app/models/jinda/xmain.rb
253
252
  - lib/generators/jinda/templates/app/models/param.rb
254
253
  - lib/generators/jinda/templates/app/models/person.rb
254
+ - lib/generators/jinda/templates/app/models/user.rb
255
255
  - lib/generators/jinda/templates/app/views/adminbsbs/content.haml
256
256
  - lib/generators/jinda/templates/app/views/admins/edit_role/edit_role.html.erb
257
257
  - lib/generators/jinda/templates/app/views/admins/edit_role/select_user.html.erb