mirror of
https://ghfast.top/https://github.com/discourse/docker_manager.git
synced 2026-05-23 00:04:03 +08:00
gjs, helper invocation case, typos, latest license template, unnecessary tracking, concatClass, unnecessary service injection, new imports, whitespace, pure function helper, htmlSafe calling convention, this. in template, unused vars in ruby, update linting, qunit-dom
16 lines
410 B
JavaScript
16 lines
410 B
JavaScript
import { htmlSafe } from "@ember/template";
|
|
|
|
export default function commitUrl(cssClass, version, prettyVersion, url) {
|
|
if (!prettyVersion) {
|
|
return "";
|
|
}
|
|
|
|
if (!url) {
|
|
return prettyVersion;
|
|
}
|
|
|
|
const repoUrl = url.substr(0, url.search(/(\.git)?$/));
|
|
return htmlSafe(
|
|
`<a class='${cssClass} commit-hash' title='${version}' href='${repoUrl}/commit/${version}'>${prettyVersion}</a>`
|
|
);
|
|
}
|