a TexString is an HtmlString
This commit is contained in:
parent
d6c3e0a595
commit
0bd21a4353
2 changed files with 14 additions and 18 deletions
|
|
@ -11,7 +11,7 @@ using Yavsc.ViewModels.Gen;
|
|||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
public class TeXString
|
||||
public class TeXString : HtmlString
|
||||
{
|
||||
|
||||
public class Replacement
|
||||
|
|
@ -54,28 +54,24 @@ namespace Yavsc.Helpers
|
|||
new Replacement("†","\\dag"),
|
||||
new Replacement("–","\\textendash")
|
||||
};
|
||||
string data;
|
||||
public TeXString(string str)
|
||||
|
||||
public TeXString(string str) : base(TR(str))
|
||||
{
|
||||
data = str;
|
||||
|
||||
|
||||
}
|
||||
private static string TR(string source)
|
||||
{
|
||||
string result=source;
|
||||
foreach (var r in SpecialCharsRendering)
|
||||
{
|
||||
data = r.Execute(data);
|
||||
result = r.Execute(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
override public string ToString()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
public HtmlString ToHtmlString()
|
||||
{
|
||||
return new HtmlString(ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static class TeXHelpers
|
||||
{
|
||||
public static string NewLinesWith(this string target, string separator)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
\def\FactureNum {@Model.Id.ToString()} % Numéro de facture
|
||||
\def\FactureAcquittee {@ViewBag.Acquitted?"oui":"non"} % Facture acquittée : oui/non
|
||||
\def\FactureLieu {@proaddrm} % Lieu de l'édition de la facture
|
||||
\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) @TeXHelpers.ToTeX(Model.Title)} % Objet du document
|
||||
\def\FactureObjet {@(new HtmlString(isestimate?"Devis":"Facture")) : @TeXHelpers.ToTeX(Model.Title)} % Objet du document
|
||||
% Description de la facture
|
||||
\def\FactureDescr {
|
||||
@TeXHelpers.ToTeX(Model.Description)
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
<text>
|
||||
\begin{flushright}
|
||||
@(new HtmlString(isestimate?"Devis validé":"Facture validée")) le @TeXHelpers.ToTeX(Model.ProviderValidationDate.ToString("dddd dd MMMM yyyy",
|
||||
CultureInfo.CreateSpecificCulture("fr-FR"))).ToHtmlString()
|
||||
CultureInfo.CreateSpecificCulture("fr-FR")))
|
||||
\end{flushright}
|
||||
@if (prosign.Exists) {
|
||||
<text>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue