Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
birger
users
Commits
cdb90deb
Commit
cdb90deb
authored
Sep 25, 2018
by
o@immerda.ch
Browse files
small ux changes
totp still needs to improve a lot...
parent
91d3d089
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/views/app_passwords/show.html.erb
View file @
cdb90deb
...
...
@@ -10,49 +10,58 @@
<div
class=
"qr-field"
>
<%=
raw
(
@qr
.
as_html
)
%>
</div>
</div>
</p>
<%
end
%>
<p>
<%=
t
:app_passwords_help
%>
</p>
<%
if
@passwords
&&
!
@passwords
.
empty?
%>
<ul>
<%
@passwords
.
each
do
|
pw
,
lastlogin
|
%>
<li>
<%=
form_tag
(
app_passwords_path
,
method:
"post"
)
do
%>
<%=
pw
%>
(
<%-
if
lastlogin
%>
<%=
t
(
:last_used
)
%>
:
<%=
lastlogin
%>
<%-
else
%>
<%=
t
(
:never_used
)
%>
<%-
end
%>
)
<%=
hidden_field_tag
(
:delete
,
''
,
value:
pw
)
%>
<%=
submit_tag
(
t
:delete
)
%>
<%
end
%>
</li>
<%
end
%>
</ul>
<hr/ >
<%
end
%>
<br
/>
<%=
form_tag
(
app_passwords_path
,
method:
"post"
)
do
%>
<table>
<tr><td>
<%=
label_tag
(
:app_name
,
(
t
:app_name
))
%>
</td><td>
<%=
text_field_tag
(
:app_name
,
''
,
value:
t
(
:app_name
),
autocomplete:
'off'
)
%>
</td></tr><tr><td>
<%=
label_tag
(
:password
,
(
t
:your_main_pw
))
%>
</td><td>
<%=
password_field_tag
(
:password
,
nil
,
placeholder:
t
(
:enter_your_current_pw
))
%>
</td></tr>
</table>
<%=
link_to
t
(
:back
),
app_passwords_path
%>
<%
else
%>
<p>
<%=
t
:app_passwords_help
%>
</p>
<%
if
@passwords
&&
!
@passwords
.
empty?
%>
<br
/>
<hr
/>
<ul>
<%
@passwords
.
each
do
|
pw
,
lastlogin
|
%>
<li>
<%=
form_tag
(
app_passwords_path
,
method:
"post"
)
do
%>
<%=
pw
%>
(
<%-
if
lastlogin
%>
<%=
t
(
:last_used
)
%>
:
<%=
lastlogin
%>
<%-
else
%>
<%=
t
(
:never_used
)
%>
<%-
end
%>
)
<%=
hidden_field_tag
(
:delete
,
''
,
value:
pw
)
%>
<%=
submit_tag
(
t
:delete
)
%>
<%
end
%>
</li>
<%
end
%>
</ul>
<hr/ >
<%
end
%>
<br
/>
<p>
<%=
submit_tag
(
t
:generate
)
%>
<%=
link_to
t
(
:back
),
root_path
%>
<b>
<%=
t
:new_app_passwords
%>
:
</b>
</p>
<%=
form_tag
(
app_passwords_path
,
method:
"post"
)
do
%>
<table>
<tr><td>
<%=
label_tag
(
:app_name
,
(
t
:app_name
))
%>
</td><td>
<%=
text_field_tag
(
:app_name
,
''
,
value:
t
(
:app_name
),
autocomplete:
'off'
)
%>
</td></tr><tr><td>
<%=
label_tag
(
:password
,
(
t
:your_main_pw
))
%>
</td><td>
<%=
password_field_tag
(
:password
,
nil
,
placeholder:
t
(
:enter_your_current_pw
))
%>
</td></tr>
</table>
<p>
<%=
submit_tag
(
t
:generate
)
%>
<%=
link_to
t
(
:back
),
root_path
%>
</p>
<%
end
%>
<%
end
%>
app/views/tfa/show.html.erb
View file @
cdb90deb
...
...
@@ -2,40 +2,49 @@
<p>
<%=
t
(
:status
)
%>
:
<%=
@existing_totps
.
present?
?
"<b>
#{
t
(
:activated
)
}
</b>"
.
html_safe
:
t
(
:disabled
)
%>
</p>
<p>
<%=
t
:tfa_enable_help
%>
</p>
<h4>
<%=
t
(
:totp_enable
)
%>
</h4>
<p>
<%=
t
:totp_enable_help
%>
<%=
link_to
'FreeOTP'
,
'https://freeotp.github.io/'
,
target:
'_new'
%>
</p>
<%
if
@totp_qr
-%>
<%=
render
'new_totp'
%>
<%
end
-
%>
<%=
render
'new_totp'
%>
<%=
link_to
t
(
:back
),
tfa_path
%>
<%
has_default
=
false
if
@existing_totps
.
present?
-%>
<h4>
<%=
t
(
:existing_totps
)
%>
</h4>
<ul>
<%
@existing_totps
.
each
do
|
name
,
kind
|
has_default
=
true
if
name
==
'default'
-%>
<li>
<%=
name
%>
<%=
link_to
t
(
:delete
),
"/tfa/
#{
URI
.
encode
(
name
)
}
/delete_totp"
,
method: :post
%>
</li>
<%
else
%>
<p>
<%=
t
:tfa_enable_help
%>
</p>
<h4>
<%=
t
(
:totp_enable
)
%>
</h4>
<p>
<%=
t
:totp_enable_help
%>
<%=
link_to
'FreeOTP'
,
'https://freeotp.github.io/'
,
target:
'_new'
%>
</p>
<%
has_default
=
false
if
@existing_totps
.
present?
-%>
<hr
/>
<h4>
<%=
t
(
:existing_totps
)
%>
</h4>
<ul>
<%
@existing_totps
.
each
do
|
name
,
kind
|
has_default
=
true
if
name
==
'default'
-%>
<li>
<%=
name
%>
<%=
link_to
t
(
:delete
),
"/tfa/
#{
URI
.
encode
(
name
)
}
/delete_totp"
,
method: :post
%>
</li>
<%
end
-%>
</ul>
<%
end
-%>
</ul>
<%
end
-%>
<%=
form_tag
(
tfa_path
,
method:
"post"
)
do
%>
<table>
<tr><td>
<%=
label_tag
(
:name
,
(
t
:name
))
%>
</td><td>
<%=
text_field_tag
(
:name
,
''
,
value:
(
has_default
?
"default-
#{
Time
.
now
.
strftime
(
"%Y%m%d%H%M"
)
}
"
:
'default'
),
maxlength:
255
,
autocomplete:
'off'
)
%>
</td></tr>
</table>
<%=
hidden_field
(
''
,
:kind
,
:value
=>
'totp'
)
%>
<%=
submit_tag
(
t
(
:create
))
%>
<%=
link_to
t
(
:back
),
root_path
%>
<%
end
%>
<hr
/>
<p>
<b>
<%=
t
(
:totp_enable
)
%>
:
</b>
</p>
<%=
form_tag
(
tfa_path
,
method:
"post"
)
do
%>
<table>
<tr><td>
<%=
label_tag
(
:name
,
(
t
:name
))
%>
</td><td>
<%=
text_field_tag
(
:name
,
''
,
value:
(
has_default
?
"default-
#{
Time
.
now
.
strftime
(
"%Y%m%d%H%M"
)
}
"
:
'default'
),
maxlength:
255
,
autocomplete:
'off'
)
%>
</td></tr>
</table>
<%=
hidden_field
(
''
,
:kind
,
:value
=>
'totp'
)
%>
<%=
submit_tag
(
t
(
:create
))
%>
<%=
link_to
t
(
:back
),
root_path
%>
<%
end
%>
<%
end
-%>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment