Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
immerda
Immerda Apps
users
Commits
e4eb57bf
Commit
e4eb57bf
authored
Jul 29, 2018
by
o
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow filter by ismailbox
parent
921e28a0
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
5 deletions
+25
-5
app/assets/javascripts/sodium.js
app/assets/javascripts/sodium.js
+1
-0
app/assets/javascripts/userlist.js
app/assets/javascripts/userlist.js
+8
-0
app/assets/javascripts/users.coffee
app/assets/javascripts/users.coffee
+4
-0
app/controllers/concerns/api_backend.rb
app/controllers/concerns/api_backend.rb
+4
-2
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+3
-1
app/views/users/edit.html.erb
app/views/users/edit.html.erb
+1
-1
app/views/users/show.html.erb
app/views/users/show.html.erb
+3
-0
config/initializers/assets.rb
config/initializers/assets.rb
+1
-1
No files found.
app/assets/javascripts/sodium.js
0 → 100644
View file @
e4eb57bf
This diff is collapsed.
Click to expand it.
app/assets/javascripts/userlist.js
0 → 100644
View file @
e4eb57bf
function
action
()
{
document
.
forms
[
0
].
submit
()
}
function
loadActions
()
{
document
.
getElementById
(
'
only_mailbox
'
).
addEventListener
(
"
change
"
,
action
)
}
window
.
addEventListener
(
"
load
"
,
loadActions
)
app/assets/javascripts/users.coffee
0 → 100644
View file @
e4eb57bf
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
/
/=
require
userlist
app/controllers/concerns/api_backend.rb
View file @
e4eb57bf
...
...
@@ -94,8 +94,10 @@ module ApiBackend
get
([
"check_valid_new_email"
],
{
'email'
=>
email
})
end
def
self
.
list
(
filter
=
nil
,
domain
=
nil
)
get
([
"list"
],
{
'filter'
=>
filter
,
'domain'
=>
domain
})
def
self
.
list
(
filter
=
nil
,
domain
=
nil
,
mailbox
=
nil
)
get
([
"list"
],
{
'filter'
=>
filter
,
'domain'
=>
domain
,
'mailbox'
=>
mailbox
})
end
def
self
.
list_public_domains
...
...
app/controllers/users_controller.rb
View file @
e4eb57bf
class
UsersController
<
AdminController
def
show
@only_mailbox
=
(
params
[
'only_mailbox'
]
==
'true'
)
||
nil
begin
res
=
ApiBackend
::
list
((
if
params
[
:filter
]
!=
""
then
params
[
:filter
]
else
nil
end
),
(
if
params
[
:domain
]
!=
""
then
params
[
:domain
]
else
nil
end
))
(
if
params
[
:domain
]
!=
""
then
params
[
:domain
]
else
nil
end
),
@only_mailbox
)
@users
=
res
[
'users'
]
rescue
end
...
...
app/views/users/edit.html.erb
View file @
e4eb57bf
...
...
@@ -58,7 +58,7 @@
<%
if
@the_user
[
'login_method'
]
==
'trees'
%>
<h4>
PW Reset
</h4>
Recover secret box with:
<input
type=
'text'
value=
"./trees-cli.rb recover --keyring master.kring --token '
<%=
if
@the_user
[
'trees_recovery_token'
]
then
@the_user
[
'trees_recovery_token'
]
else
'token'
end
%>
' --pass 'pass' --account '
<%=
@the_user
[
'email'
]
%>
"
>
<input
type=
'text'
value=
"./trees-cli.rb recover --keyring master.kring --token '
<%=
if
@the_user
[
'trees_recovery_token'
]
then
@the_user
[
'trees_recovery_token'
]
else
'token'
end
%>
' --pass 'pass' --account '
<%=
@the_user
[
'email'
]
%>
'
"
>
<table><tr><td>
<%=
form_tag
(
@post_path
,
method:
"post"
)
do
%>
<%=
label_tag
(
:trees_secret_box
,
(
t
:trees_secret_box
))
%>
...
...
app/views/users/show.html.erb
View file @
e4eb57bf
...
...
@@ -3,6 +3,9 @@
<%=
form_tag
(
"/users"
,
method:
"get"
)
do
%>
<%=
t
(
:filter
)
%>
<%=
text_field_tag
(
:filter
,
params
[
:filter
])
%>
<%=
t
(
:domain
)
%>
<%=
text_field_tag
(
:domain
,
params
[
:domain
])
%>
<input
type=
"checkbox"
id=
"only_mailbox"
name=
"only_mailbox"
value=
"true"
<%=
if
@only_mailbox
then
'checked="checked"'
else
''
end
%>
/>
<%=
t
:mailbox
%>
<%=
submit_tag
(
"filter"
)
%>
<%
end
%>
...
...
config/initializers/assets.rb
View file @
e4eb57bf
...
...
@@ -11,4 +11,4 @@ Rails.application.config.assets.paths << Rails.root.join('node_modules')
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
Rails
.
application
.
config
.
assets
.
precompile
+=
%w( sessions.js password.js signup.js )
Rails
.
application
.
config
.
assets
.
precompile
+=
%w( sessions.js password.js signup.js
users.js
)
mh
@mh
mentioned in commit
545da839
·
Sep 29, 2020
mentioned in commit
545da839
mentioned in commit 545da83948dc39e086e4d4df802889257a30f83b
Toggle commit list
Write
Preview
Markdown
is supported
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