Commit 75f3c96e authored by ZTGAME\jiangpengqing's avatar ZTGAME\jiangpengqing

当uid为null或者空字符串时,gitment不显示

parent ccabc01d
......@@ -188,7 +188,7 @@ function getDefinitions(category) {
function handleItem(vm, gitContribute, gitUrlPattern) {
// get contribution information
vm.docurl = common.getImproveTheDocHref(vm, gitContribute, gitUrlPattern);
vm.sourceurl = common.getViewSourceHref(vm, gitContribute, gitUrlPattern);
vm.sourceurl = common.getViewSourceHref(vm, null, gitUrlPattern);
// set to null incase mustache looks up
vm.summary = vm.summary || null;
......
......@@ -32,7 +32,7 @@ function getHtmlId(input) {
// Note: the parameter `gitContribute` won't be used in this function
function getViewSourceHref(item, gitContribute, gitUrlPattern) {
if (!item || !item.source || !item.source.remote) return '';
return getRemoteUrl(item.source.remote, item.source.startLine - '0' + 1, gitContribute, gitUrlPattern);
return getRemoteUrl(item.source.remote, item.source.startLine - '0' + 1, null, gitUrlPattern);
}
function getImproveTheDocHref(item, gitContribute, gitUrlPattern) {
......@@ -119,7 +119,8 @@ function getRepoWithoutGitExtension(repo) {
function normalizeGitUrlToHttps(repo) {
var pos = repo.indexOf('@');
if (pos == -1) return repo;
return 'https://' + repo.substr(pos + 1).replace(/:[0-9]+/g, '').replace(/:/g, '/');
//return 'https://' + repo.substr(pos + 1).replace(/:[0-9]+/g, '').replace(/:/g, '/');
return 'https://' + repo.substr(pos + 1).replace(/:/g, '/');
}
function getNewFileUrl(item, gitContribute, gitUrlPattern) {
......
......@@ -11,5 +11,7 @@ exports.preTransform = function (model) {
* This method will be called at the end of exports.transform in conceptual.html.primary.js
*/
exports.postTransform = function (model) {
if(model.uid == null || model.uid.trim() == "")
model.gitment_enable = false
return model;
}
\ No newline at end of file
......@@ -3,6 +3,5 @@
{{{rawTitle}}}
{{{conceptual}}}
{{^_disableToc}}
<h1>Down of conceptual!{{{uid}}}</h1>
{{>partials/gitment}}
{{/_disableToc}}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment