-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce template helper, octicon tweaks, js refactor
- Loading branch information
1 parent
472a12e
commit c968fee
Showing
9 changed files
with
98 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
<div class="ui compact tiny menu"> | ||
<a class="{{if not .IsShowClosed}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}"> | ||
{{svg "octicon-issue-opened" 16 "mr-3"}} | ||
<span class="js-format-pretty-number" data-original="{{.IssueStats.OpenCount}}">{{PrettyNumber .IssueStats.OpenCount}}</span> {{.i18n.Tr "repo.issues.open_title"}} | ||
{{if .PageIsPullList}} | ||
{{svg "octicon-git-pull-request" 16 "mr-3"}} | ||
{{else}} | ||
{{svg "octicon-issue-opened" 16 "mr-3"}} | ||
{{end}} | ||
{{JsPrettyNumber .IssueStats.OpenCount}} {{.i18n.Tr "repo.issues.open_title"}} | ||
</a> | ||
<a class="{{if .IsShowClosed}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}"> | ||
{{svg "octicon-issue-closed" 16 "mr-3"}} | ||
<span class="js-format-pretty-number" data-original="{{.IssueStats.ClosedCount}}">{{PrettyNumber .IssueStats.ClosedCount}}</span> {{.i18n.Tr "repo.issues.closed_title"}} | ||
</span> | ||
{{svg "octicon-check" 16 "mr-3"}} | ||
{{JsPrettyNumber .IssueStats.ClosedCount}} {{.i18n.Tr "repo.issues.closed_title"}} | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {prettyNumber} from '../utils.js'; | ||
|
||
const {lang} = document.documentElement; | ||
|
||
export function initFormattingReplacements() { | ||
// replace english formatted numbers with locale-specific separators | ||
for (const el of document.getElementsByClassName('js-pretty-number')) { | ||
const num = Number(el.getAttribute('data-value')); | ||
console.log(num); | ||
const formatted = prettyNumber(num, lang); | ||
if (formatted && formatted !== el.textContent) { | ||
el.textContent = formatted; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters