Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
78c9903f
Commit
78c9903f
authored
Jun 13, 2019
by
farhatahmad
Committed by
Jesus Federico
Jun 13, 2019
Browse files
Options
Downloads
Patches
Plain Diff
GRN2-xx: Cleaned up Javascript Complaints from Scrutinizer (#557)
* First step * Fix flash issue
parent
cb939735
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/assets/javascripts/admins.js
+11
-11
11 additions, 11 deletions
app/assets/javascripts/admins.js
app/assets/javascripts/search.js
+4
-4
4 additions, 4 deletions
app/assets/javascripts/search.js
app/controllers/admins_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/admins_controller.rb
with
16 additions
and
16 deletions
app/assets/javascripts/admins.js
+
11
−
11
View file @
78c9903f
...
@@ -32,10 +32,10 @@ $(document).on('turbolinks:load', function(){
...
@@ -32,10 +32,10 @@ $(document).on('turbolinks:load', function(){
})
})
//clear the role filter if user clicks on the x
//clear the role filter if user clicks on the x
$
(
"
.clear-role
"
).
click
(
function
(
data
)
{
$
(
"
.clear-role
"
).
click
(
function
()
{
search
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
search
'
)
var
search
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
search
'
)
url
=
window
.
location
.
pathname
+
"
?page=1
"
var
url
=
window
.
location
.
pathname
+
"
?page=1
"
if
(
search
)
{
if
(
search
)
{
url
+=
"
&search=
"
+
search
url
+=
"
&search=
"
+
search
...
@@ -52,8 +52,8 @@ $(document).on('turbolinks:load', function(){
...
@@ -52,8 +52,8 @@ $(document).on('turbolinks:load', function(){
$
(
this
).
ColorPickerSetColor
(
colour
);
$
(
this
).
ColorPickerSetColor
(
colour
);
},
},
onSubmit
:
function
(
_hsb
,
hex
,
_rgb
,
_el
)
{
onSubmit
:
function
(
_hsb
,
hex
)
{
$
.
post
(
$
(
"
#coloring-path-regular
"
).
val
(),
{
color
:
'
#
'
+
hex
}).
done
(
function
(
data
)
{
$
.
post
(
$
(
"
#coloring-path-regular
"
).
val
(),
{
color
:
'
#
'
+
hex
}).
done
(
function
()
{
location
.
reload
()
location
.
reload
()
});
});
},
},
...
@@ -65,8 +65,8 @@ $(document).on('turbolinks:load', function(){
...
@@ -65,8 +65,8 @@ $(document).on('turbolinks:load', function(){
$
(
this
).
ColorPickerSetColor
(
colour
);
$
(
this
).
ColorPickerSetColor
(
colour
);
},
},
onSubmit
:
function
(
_hsb
,
hex
,
_rgb
,
_el
)
{
onSubmit
:
function
(
_hsb
,
hex
)
{
$
.
post
(
$
(
"
#coloring-path-lighten
"
).
val
(),
{
color
:
'
#
'
+
hex
}).
done
(
function
(
data
)
{
$
.
post
(
$
(
"
#coloring-path-lighten
"
).
val
(),
{
color
:
'
#
'
+
hex
}).
done
(
function
()
{
location
.
reload
()
location
.
reload
()
});
});
},
},
...
@@ -78,8 +78,8 @@ $(document).on('turbolinks:load', function(){
...
@@ -78,8 +78,8 @@ $(document).on('turbolinks:load', function(){
$
(
this
).
ColorPickerSetColor
(
colour
);
$
(
this
).
ColorPickerSetColor
(
colour
);
},
},
onSubmit
:
function
(
_hsb
,
hex
,
_rgb
,
_el
)
{
onSubmit
:
function
(
_hsb
,
hex
)
{
$
.
post
(
$
(
"
#coloring-path-darken
"
).
val
(),
{
color
:
'
#
'
+
hex
}).
done
(
function
(
data
)
{
$
.
post
(
$
(
"
#coloring-path-darken
"
).
val
(),
{
color
:
'
#
'
+
hex
}).
done
(
function
()
{
location
.
reload
()
location
.
reload
()
});
});
},
},
...
@@ -108,9 +108,9 @@ function changeBrandingImage(path) {
...
@@ -108,9 +108,9 @@ function changeBrandingImage(path) {
// Filters by role
// Filters by role
function
filterRole
(
role
)
{
function
filterRole
(
role
)
{
search
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
search
'
)
var
search
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
search
'
)
url
=
window
.
location
.
pathname
+
"
?page=1
"
+
"
&role=
"
+
role
var
url
=
window
.
location
.
pathname
+
"
?page=1
"
+
"
&role=
"
+
role
if
(
search
)
{
if
(
search
)
{
url
+=
"
&search=
"
+
search
url
+=
"
&search=
"
+
search
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/search.js
+
4
−
4
View file @
78c9903f
...
@@ -78,9 +78,9 @@ function searchPage() {
...
@@ -78,9 +78,9 @@ function searchPage() {
var
action
=
$
(
"
body
"
).
data
(
'
action
'
);
var
action
=
$
(
"
body
"
).
data
(
'
action
'
);
// Check if the user filtered by role
// Check if the user filtered by role
role
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
role
'
)
var
role
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
role
'
)
url
=
window
.
location
.
pathname
+
"
?page=1&search=
"
+
search
var
url
=
window
.
location
.
pathname
+
"
?page=1&search=
"
+
search
if
(
role
)
{
if
(
role
)
{
url
+=
"
&role=
"
+
role
url
+=
"
&role=
"
+
role
...
@@ -99,9 +99,9 @@ function clearSearch() {
...
@@ -99,9 +99,9 @@ function clearSearch() {
var
controller
=
$
(
"
body
"
).
data
(
'
controller
'
);
var
controller
=
$
(
"
body
"
).
data
(
'
controller
'
);
var
action
=
$
(
"
body
"
).
data
(
'
action
'
);
var
action
=
$
(
"
body
"
).
data
(
'
action
'
);
role
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
role
'
)
var
role
=
new
URL
(
location
.
href
).
searchParams
.
get
(
'
role
'
)
url
=
window
.
location
.
pathname
+
"
?page=1
"
var
url
=
window
.
location
.
pathname
+
"
?page=1
"
if
(
role
)
{
if
(
role
)
{
url
+=
"
&role=
"
+
role
url
+=
"
&role=
"
+
role
...
...
This diff is collapsed.
Click to expand it.
app/controllers/admins_controller.rb
+
1
−
1
View file @
78c9903f
...
@@ -111,7 +111,7 @@ class AdminsController < ApplicationController
...
@@ -111,7 +111,7 @@ class AdminsController < ApplicationController
# POST /admins/branding
# POST /admins/branding
def
branding
def
branding
@settings
.
update_value
(
"Branding Image"
,
params
[
:url
])
@settings
.
update_value
(
"Branding Image"
,
params
[
:url
])
redirect_to
admins_path
,
flash:
{
success:
I18n
.
t
(
"administrator.flash.settings
.image
"
)
}
redirect_to
admins_path
,
flash:
{
success:
I18n
.
t
(
"administrator.flash.settings"
)
}
end
end
# POST /admins/color
# POST /admins/color
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment