jinda 0.4.3 → 0.4.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.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/generators/jinda/templates/app/assets/stylesheets/application.css +7 -0
- data/lib/generators/jinda/templates/app/assets/stylesheets/jinda.css +0 -86
- data/lib/generators/jinda/templates/app/controllers/jinda_org/admins_controller.rb +1 -1
- data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +1 -1
- data/lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb +3 -3
- data/lib/generators/jinda/templates/app/controllers/jinda_org/password_resets_controller.rb +3 -3
- data/lib/generators/jinda/templates/app/controllers/jinda_org/sessions_controller.rb +1 -1
- data/lib/generators/jinda/templates/app/jinda/index.mm +1 -1
- data/lib/generators/jinda/templates/app/models/article.rb +1 -1
- data/lib/generators/jinda/templates/app/models/comment.rb +1 -1
- data/lib/generators/jinda/templates/app/models/jinda/notice.rb +1 -1
- data/lib/generators/jinda/templates/app/models/jinda/role.rb +1 -1
- data/lib/generators/jinda/templates/app/models/jinda/runseq.rb +1 -1
- data/lib/generators/jinda/templates/app/models/jinda/xmain.rb +1 -1
- data/lib/generators/jinda/templates/app/models/{jinda/user.rb → user.rb} +1 -1
- data/lib/generators/jinda/templates/app/views/admins/edit_role/edit_role.html.erb +1 -1
- data/lib/generators/jinda/templates/app/views/admins/edit_role/select_user.html.erb +1 -1
- data/lib/generators/jinda/templates/app/views/identities/new.html.erb +32 -30
- data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +1 -1
- data/lib/generators/jinda/templates/app/views/jinda/notice_logs.haml +1 -1
- data/lib/generators/jinda/templates/app/views/jinda/run_form.haml +36 -35
- data/lib/generators/jinda/templates/app/views/sessions/new.html.erb +20 -16
- data/lib/generators/jinda/templates/db/seeds.rb +1 -1
- data/lib/generators/jinda/templates/spec/models/user_spec.rb +1 -1
- data/lib/generators/jinda/templates/spec/support/factory_bot.rb +1 -1
- data/lib/jinda/helpers.rb +1 -1
- data/lib/jinda/version.rb +1 -1
- data/lib/tasks/jinda.rake +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 673f63519baba2d14750c80b76aea80d6c5823289dcb174c40ed2c9d484f61f6
|
|
4
|
+
data.tar.gz: 9af4281b173296766412ae636e9e7ba79f98eab8ab1f10a438370b0f88ff378d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
43
|
+
gem 'jinda', '~> 0.4.4'
|
|
43
44
|
|
|
44
45
|
For Development (most updated)
|
|
45
46
|
|
|
@@ -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
|
-
|
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 ↵
|
|
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 =
|
|
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 => "
|
|
156
|
+
<node CREATED="1493487131376" ID="ID_1334057464" MODIFIED="1538328284823" TEXT="belongs_to :user, :class_name => "User"">
|
|
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 => "
|
|
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 => "
|
|
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 => "
|
|
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
|
|
@@ -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 => "
|
|
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
1
|
<div class="field" data-role="fieldcontain">
|
|
2
2
|
<%= label_tag :code, 'User code' %>
|
|
3
|
-
<%= select_tag :code, options_from_collection_for_select(
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- @notice= notice
|
|
10
10
|
- current_notice = @notice.id
|
|
11
11
|
- #current_notice_user = @notice.user
|
|
12
|
-
- notice_user = (
|
|
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
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
=
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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 "
|
|
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')
|
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 ||=
|
|
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
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
|
-
|
|
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.
|
|
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-
|
|
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
|