Skip to content

Commit

Permalink
styl pro patičku
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrotter committed Mar 26, 2024
1 parent e14df3d commit 0703be6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ZZZO/ZZZO.Common/Generators/GeneratorHtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override string FileSuffix
public List<string> Styles
{
get;
} = Directory.GetFiles(Constants.PathsAndFiles.AppStylesFolder, "*", SearchOption.TopDirectoryOnly)
} = Directory.GetFiles(Constants.PathsAndFiles.AppStylesFolder, "*.css", SearchOption.TopDirectoryOnly)
.Select(Path.GetFileName).ToList();

public override string Title
Expand Down Expand Up @@ -386,7 +386,7 @@ private string GenerateResolution(
return accepted ? generatedResolutionTitle : null;
}

private string GetStyle(string styleName)
public static string GetStyle(string styleName)
{
return File.ReadAllText(Path.Combine(Constants.PathsAndFiles.AppStylesFolder, styleName));
}
Expand Down
12 changes: 6 additions & 6 deletions ZZZO/ZZZO/ViewModels/GeneratorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public ICommand PrintCmd
get;
}

public string SelectedHtmlFooterStyle
{
get => $"{SelectedHtmlStyle}.footer";
}

public string SelectedHtmlStyle
{
get
Expand Down Expand Up @@ -197,12 +202,7 @@ private async void ExportPdf(ChromiumWebBrowser browser)
PrintBackground = true,
PreferCssPageSize = true,
HeaderTemplate = "<div class='text center'></div>",
FooterTemplate =
"<div class='text center'>" +
"<span class='pageNumber'></span>" +
" - " +
"<span class='totalPages'></span>" +
"</div>"
FooterTemplate = Common.Generators.GeneratorHtml.GetStyle(SelectedHtmlFooterStyle)
});
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion ZZZO/ZZZO/ZzzoCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static string ChooseSaveFile(
string initialDirectory = Path.GetDirectoryName(zasedani.VystupniSoubor);
string initialFileName = Path.GetFileName(zasedani.VystupniSoubor) + $".{fileSuffix}";

d.InitialDirectory = initialDirectory ?? Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
d.InitialDirectory = initialDirectory != null && Directory.Exists(initialDirectory) ? initialDirectory : Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
d.FileName = initialFileName;
}

Expand Down
3 changes: 2 additions & 1 deletion resources/styles/svésedlice.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Svésedlice, Czechia - style for generating municipality meeting reports.
--failure-color: red;
--warning-color: orange;
--signature-color: gray;

font-family: "EB Garamond", serif;
}

/* Targets all the pages */
Expand All @@ -19,7 +21,6 @@ Svésedlice, Czechia - style for generating municipality meeting reports.

body {
margin: 0;
font-family: "EB Garamond", serif;
font-optical-sizing: auto;
font-size: 11pt;
line-height: 1;
Expand Down
10 changes: 10 additions & 0 deletions resources/styles/svésedlice.css.footer
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<style>
div {
font-family: "Times New Roman";
}
</style>
<div class='text center'>
<span class='pageNumber'></span>
-
<span class='totalPages'></span>
</div>

0 comments on commit 0703be6

Please sign in to comment.