Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
53c5b671
Commit
53c5b671
authored
Jul 21, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix translations for Star/Unstar in JS file
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
1733090a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
app/assets/javascripts/star.js
app/assets/javascripts/star.js
+4
-2
app/views/projects/buttons/_star.html.haml
app/views/projects/buttons/_star.html.haml
+1
-1
changelogs/unreleased/35391-fix-star-i18n-in-js.yml
changelogs/unreleased/35391-fix-star-i18n-in-js.yml
+4
-0
No files found.
app/assets/javascripts/star.js
View file @
53c5b671
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-unused-vars, one-var, no-var, one-var-declaration-per-line, prefer-arrow-callback, no-new, max-len */
/* global Flash */
import
{
__
,
s__
}
from
'
./locale
'
;
export
default
class
Star
{
constructor
()
{
$
(
'
.project-home-panel .toggle-star
'
).
on
(
'
ajax:success
'
,
function
(
e
,
data
,
status
,
xhr
)
{
...
...
@@ -11,10 +13,10 @@ export default class Star {
toggleStar
=
function
(
isStarred
)
{
$this
.
parent
().
find
(
'
.star-count
'
).
text
(
data
.
star_count
);
if
(
isStarred
)
{
$starSpan
.
removeClass
(
'
starred
'
).
text
(
'
Star
'
);
$starSpan
.
removeClass
(
'
starred
'
).
text
(
s__
(
'
StarProject|Star
'
)
);
$starIcon
.
removeClass
(
'
fa-star
'
).
addClass
(
'
fa-star-o
'
);
}
else
{
$starSpan
.
addClass
(
'
starred
'
).
text
(
'
Unstar
'
);
$starSpan
.
addClass
(
'
starred
'
).
text
(
__
(
'
Unstar
'
)
);
$starIcon
.
removeClass
(
'
fa-star-o
'
).
addClass
(
'
fa-star
'
);
}
};
...
...
app/views/projects/buttons/_star.html.haml
View file @
53c5b671
changelogs/unreleased/35391-fix-star-i18n-in-js.yml
0 → 100644
View file @
53c5b671
---
title
:
Fix translations for Star/Unstar in JS file
merge_request
:
author
:
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