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
df45ffdf
Unverified
Commit
df45ffdf
authored
Jul 31, 2020
by
ArtOfCode
Committed by
GitHub
Jul 31, 2020
Browse files
Options
Downloads
Plain Diff
Merge pull request #126 from codidact/luap42/patches
Patches
parents
d96ae718
8f43898a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/pinned_links_controller.rb
+5
-1
5 additions, 1 deletion
app/controllers/pinned_links_controller.rb
app/controllers/votes_controller.rb
+7
-1
7 additions, 1 deletion
app/controllers/votes_controller.rb
with
12 additions
and
2 deletions
app/controllers/pinned_links_controller.rb
+
5
−
1
View file @
df45ffdf
...
...
@@ -59,7 +59,11 @@ class PinnedLinksController < ApplicationController
private
def
set_pinned_link
@link
=
PinnedLink
.
find
params
[
:id
]
@link
=
if
current_user
.
is_global_moderator
PinnedLink
.
unscoped
.
find
params
[
:id
]
else
PinnedLink
.
find
params
[
:id
]
end
end
def
pinned_link_params
...
...
This diff is collapsed.
Click to expand it.
app/controllers/votes_controller.rb
+
7
−
1
View file @
df45ffdf
...
...
@@ -14,7 +14,13 @@ class VotesController < ApplicationController
max_votes_per_day
=
SiteSetting
[
'FreeVotes'
]
+
(
@current_user
.
reputation
-
SiteSetting
[
'NewUserInitialRep'
])
if
recent_votes
>=
max_votes_per_day
vote_limit_msg
=
'You have used your daily vote limit: '
+
recent_votes
.
to_s
+
'/'
+
max_votes_per_day
.
to_s
vote_limit_msg
=
'You have used your daily vote limit of '
+
recent_votes
.
to_s
+
'votes. Gain more reputation'
\
' or come back tomorrow to continue voting.'
if
max_votes_per_day
<=
0
vote_limit_msg
=
'You need to gain some reputation on this site before you can start voting.'
end
render
json:
{
status:
'failed'
,
message:
vote_limit_msg
},
status:
403
return
end
...
...
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