appendix: 23 Code-Ausschnitte aus dem Houston-Repository
Pin nixpkgs to the revision used by itc.componentware: the channel version ships a latexminted that crashes on Python 3.14, which made every listing fail and sent latexmk into an endless error prompt. Also force nonstopmode/halt-on-error so a broken listing can never loop again.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System.Globalization;
|
||||
using Houston.Resources;
|
||||
|
||||
namespace Houston.Model.Documents;
|
||||
|
||||
public enum DocumentType
|
||||
{
|
||||
ServiceProtocol,
|
||||
AcceptanceDocuments,
|
||||
SlaReportsTicketProcessing,
|
||||
MonitoringReports,
|
||||
SecurityAssessments,
|
||||
BillingData,
|
||||
ContractDocuments,
|
||||
}
|
||||
|
||||
public static class DocumentTypeExtensions
|
||||
{
|
||||
public const string OtherDocumentsDisplayName = "Sonstige Dokumente";
|
||||
public const string OtherDocumentsValue = "OtherDocuments";
|
||||
|
||||
public static string? FromStorageFolderName(string storageFolderName) =>
|
||||
APITranslation.ResourceManager.GetString(storageFolderName, CultureInfo.InvariantCulture);
|
||||
|
||||
public static DocumentType? ParseStorageFolderName(string storageFolderName)
|
||||
{
|
||||
var type = FromStorageFolderName(storageFolderName);
|
||||
if (!Enum.TryParse<DocumentType>(type, ignoreCase: true, out var variant))
|
||||
return null;
|
||||
|
||||
return variant;
|
||||
}
|
||||
|
||||
extension(DocumentType documentType)
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the S3 subfolder that holds documents of this type, i.e. the German translation.
|
||||
/// </summary>
|
||||
public string StorageFolderName =>
|
||||
APITranslation.ResourceManager.GetString(documentType.ToString(), CultureInfo.InvariantCulture)
|
||||
?? throw new NotImplementedException($"Missing translation for DocumentType '{documentType}'.");
|
||||
}
|
||||
Reference in New Issue
Block a user