Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
9153a41b
Commit
9153a41b
authored
Nov 28, 2023
by
Taico Aerts
Browse files
Options
Downloads
Plain Diff
Merge branch 'eip-develop' into eip-master
parents
c15cdc1c
e9361423
Branches
Branches containing commit
No related tags found
1 merge request
!81
Fix the number of searches graph
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/badges_controller.rb
+7
-1
7 additions, 1 deletion
app/controllers/badges_controller.rb
app/views/badges/award.html.erb
+2
-2
2 additions, 2 deletions
app/views/badges/award.html.erb
with
9 additions
and
3 deletions
app/controllers/badges_controller.rb
+
7
−
1
View file @
9153a41b
...
...
@@ -21,6 +21,7 @@ class BadgesController < ApplicationController
respond_to
do
|
format
|
if
@badge
.
save
Rails
.
cache
.
delete
'network/badges/badge_ids'
format
.
html
{
redirect_to
badges_url
,
notice:
'Badge was successfully created.'
}
format
.
json
{
render
:show
,
status: :created
,
location:
@badge
}
else
...
...
@@ -34,6 +35,7 @@ class BadgesController < ApplicationController
def
update
respond_to
do
|
format
|
if
@badge
.
update
(
badge_params
)
Rails
.
cache
.
delete
'network/badges/badge_ids'
format
.
html
{
redirect_to
badges_url
,
notice:
'Badge was successfully updated.'
}
format
.
json
{
render
:show
,
status: :ok
,
location:
@badge
}
else
...
...
@@ -46,6 +48,7 @@ class BadgesController < ApplicationController
# DELETE /badges/1 or /badges/1.json
def
destroy
@badge
.
destroy
Rails
.
cache
.
delete
'network/badges/badge_ids'
respond_to
do
|
format
|
format
.
html
{
redirect_to
badges_url
,
notice:
'Badge was successfully destroyed.'
}
...
...
@@ -80,6 +83,9 @@ class BadgesController < ApplicationController
when
'User'
@user_badge
.
reference_url
=
Rails
.
application
.
routes
.
path_for
(
controller:
'users'
,
action:
'show'
,
id:
@user_badge
.
badge_source_id
)
when
'Tag'
@user_badge
.
reference_url
=
Rails
.
application
.
routes
.
path_for
(
controllers:
'tags'
,
action:
'show'
,
id:
@user_badge
.
badge_source_id
)
else
@user_badge
.
reference_url
=
''
end
...
...
@@ -105,7 +111,7 @@ class BadgesController < ApplicationController
# Defines the available types of association for the UserBadge polymorphic relationship
def
badge_source_types
%w[Post User]
%w[Post User
Tag
]
end
# Only allow a list of trusted parameters through.
...
...
...
...
This diff is collapsed.
Click to expand it.
app/views/badges/award.html.erb
+
2
−
2
View file @
9153a41b
...
...
@@ -15,7 +15,7 @@
Select which badge should be awarded. In case you want to create a new badge, you can do so
<%=
link_to
"here"
,
new_badge_path
,
class:
'link is-underlined'
,
target:
"_blank"
,
'aria-label'
:
'Add new badge'
%>
</span>
<%=
f
.
select
:badge
,
options_for_select
(
Badge
.
where
(
:
manually_awardable
=>
true
).
mapping
.
to_a
,
selected:
[]),
<%=
f
.
select
:badge
,
options_for_select
(
Badge
.
where
(
manually_awardable
:
true
).
pluck
(
:title
,
:id
)
,
selected:
[]),
{
include_blank:
false
},
multiple:
false
,
class:
'form-element'
%>
</div>
...
...
@@ -32,7 +32,7 @@
<div
class=
"grid--cell is-6 is-12-sm"
>
<div
class=
"form-caption"
>
Entity Type
</div>
<%=
f
.
select
:badge_source_type
,
options_for_select
(
@entity_types
,
selected:
[]),
{
include_blank:
fals
e
},
class:
'form-element'
%>
{
include_blank:
tru
e
},
class:
'form-element'
%>
</div>
<div
class=
"grid--cell is-6 is-12-sm"
>
<div
class=
"form-caption"
>
Id of the entity
</div>
...
...
...
...
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
sign in
to comment