Browse Source

show (preview) for the preview versions on the docs version list

resolves https://github.com/abpframework/abp/issues/5562
pull/5827/head
Yunus Emre Kalkan 6 years ago
parent
commit
c3103dee1c
  1. 5
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json
  2. 3
      modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/tr.json
  3. 15
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

5
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json

@ -13,7 +13,7 @@
"ClearCacheConfirmationMessage": "Are you sure to clear all caches for project \"{0}\"", "ClearCacheConfirmationMessage": "Are you sure to clear all caches for project \"{0}\"",
"ReIndexAllProjects": "ReIndex all projects", "ReIndexAllProjects": "ReIndex all projects",
"ReIndexProject": "ReIndex project", "ReIndexProject": "ReIndex project",
"ReIndexProjectConfirmationMessage":"Are you sure to reindex for project \"{0}\"", "ReIndexProjectConfirmationMessage": "Are you sure to reindex for project \"{0}\"",
"SuccessfullyReIndexProject": "Successfully reindex for project \"{0}\"", "SuccessfullyReIndexProject": "Successfully reindex for project \"{0}\"",
"ReIndexAllProjectConfirmationMessage": "Are you sure to reindex all project?", "ReIndexAllProjectConfirmationMessage": "Are you sure to reindex all project?",
"SuccessfullyReIndexAllProject": "Successfully reindex for all projects", "SuccessfullyReIndexAllProject": "Successfully reindex for all projects",
@ -33,6 +33,7 @@
"Upd": "Upd", "Upd": "Upd",
"NewExplanation": "Created in the last two weeks.", "NewExplanation": "Created in the last two weeks.",
"UpdatedExplanation": "Updated in the last two weeks.", "UpdatedExplanation": "Updated in the last two weeks.",
"Volo.Docs.Domain:010002": "ShortName {ShortName} already exists." "Volo.Docs.Domain:010002": "ShortName {ShortName} already exists.",
"Preview": "preview"
} }
} }

3
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/tr.json

@ -33,6 +33,7 @@
"Upd": "Günc", "Upd": "Günc",
"NewExplanation": "Son iki hafta içinde oluşturuldu.", "NewExplanation": "Son iki hafta içinde oluşturuldu.",
"UpdatedExplanation": "Son iki hafta içinde güncellendi.", "UpdatedExplanation": "Son iki hafta içinde güncellendi.",
"Volo.Docs.Domain:010002": "ShortName {ShortName} zaten var." "Volo.Docs.Domain:010002": "ShortName {ShortName} zaten var.",
"Preview": "ön izleme"
} }
} }

15
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -18,6 +18,7 @@ using Volo.Docs.HtmlConverting;
using Volo.Docs.Models; using Volo.Docs.Models;
using Volo.Docs.Projects; using Volo.Docs.Projects;
using Volo.Docs.GitHub.Documents.Version; using Volo.Docs.GitHub.Documents.Version;
using Volo.Docs.Localization;
namespace Volo.Docs.Pages.Documents.Project namespace Volo.Docs.Pages.Documents.Project
{ {
@ -99,6 +100,8 @@ namespace Volo.Docs.Pages.Documents.Project
_documentSectionRenderer = documentSectionRenderer; _documentSectionRenderer = documentSectionRenderer;
_versionHelper = versionHelper; _versionHelper = versionHelper;
_uiOptions = options.Value; _uiOptions = options.Value;
LocalizationResourceType = typeof(DocsResource);
} }
public virtual async Task<IActionResult> OnGetAsync() public virtual async Task<IActionResult> OnGetAsync()
@ -312,11 +315,15 @@ namespace Volo.Docs.Pages.Documents.Project
{ {
var LatestVersionBranchNameWithoutPrefix = RemoveVersionPrefix(Project.LatestVersionBranchName); var LatestVersionBranchNameWithoutPrefix = RemoveVersionPrefix(Project.LatestVersionBranchName);
var latest = versions.FirstOrDefault(v=> v.Version == LatestVersionBranchNameWithoutPrefix); foreach (var version in versions)
if (latest != null)
{ {
return latest; if (version.Version == LatestVersionBranchNameWithoutPrefix)
{
return version;
}
version.DisplayText = $"{version.DisplayText} ({L["Preview"].Value})";
} }
} }

Loading…
Cancel
Save