diff --git a/Back/Data/Models/Blog.cs b/Back/Data/Models/Blog.cs index c223364..8230e3a 100644 --- a/Back/Data/Models/Blog.cs +++ b/Back/Data/Models/Blog.cs @@ -10,6 +10,7 @@ public string Time { get; set; } public bool Status { get; set; } public string? Tags { get; set; } - public string? Description { get; set; } + public string? DescriptionTag { get; set; } + public string? keywordsTag { get; set; } } } diff --git a/Back/Services/ServBase.cs b/Back/Services/ServBase.cs index cf74fa8..1b9bee7 100644 --- a/Back/Services/ServBase.cs +++ b/Back/Services/ServBase.cs @@ -79,7 +79,8 @@ namespace Back.Services Text=s.Text, Time=s.Time, Tags= s.Tags, - Description=s.Description + DescriptionTag=s.DescriptionTag, + keywordsTag=s.keywordsTag }).FirstOrDefaultAsync(); return result; } diff --git a/Shared/DTOs/BlogDto.cs b/Shared/DTOs/BlogDto.cs index 6763add..cbf3df3 100644 --- a/Shared/DTOs/BlogDto.cs +++ b/Shared/DTOs/BlogDto.cs @@ -22,6 +22,7 @@ namespace Shared.DTOs public string Date { get; set; } public string Time { get; set; } public string? Tags { get; set; } - public string? Description { get; set; } + public string? DescriptionTag { get; set; } + public string? keywordsTag { get; set; } } } diff --git a/TaxPayerFull/Pages/BlogDetails.razor b/TaxPayerFull/Pages/BlogDetails.razor index d28cebd..0763651 100644 --- a/TaxPayerFull/Pages/BlogDetails.razor +++ b/TaxPayerFull/Pages/BlogDetails.razor @@ -244,7 +244,7 @@ public async Task GenerateTags() { - description = Item.Description ?? Item.Title; + description = Item.DescriptionTag; } } diff --git a/moadiran/Layout/BlogLayout.razor b/moadiran/Layout/BlogLayout.razor deleted file mode 100644 index b0236e2..0000000 --- a/moadiran/Layout/BlogLayout.razor +++ /dev/null @@ -1,33 +0,0 @@ -@inherits LayoutComponentBase - - - - - - - - - - - - - - - - - - - - - - - -
-
- @Body - -
-
- - - diff --git a/moadiran/Layout/EmptyLayout.razor b/moadiran/Layout/EmptyLayout.razor deleted file mode 100644 index 7c90556..0000000 --- a/moadiran/Layout/EmptyLayout.razor +++ /dev/null @@ -1,7 +0,0 @@ -@inherits LayoutComponentBase - -
-
- @Body -
-
\ No newline at end of file diff --git a/moadiran/Pages/BlogDetails.razor b/moadiran/Pages/BlogDetails.razor index bc66048..143d788 100644 --- a/moadiran/Pages/BlogDetails.razor +++ b/moadiran/Pages/BlogDetails.razor @@ -1,40 +1,22 @@  @inject HttpClient _hc -@layout EmptyLayout +@layout Shared.BlogLayout @page "/BlogDetails/{ItemID:int}" @using global::Shared.DTOs @using moadiran.Layout @inject NavigationManager Navigation @Item?.Title + + - - - - - - - - - - - - - - - - - - - - - - + @if (!string.IsNullOrEmpty(description)) + {} + @if (!string.IsNullOrEmpty(keywords)) + { } - -
-
-
+ +
-

@Item?.Title.Split(':')[1]

+

@Item?.Title.Split(':')[1]

@@ -91,7 +73,7 @@
- +
@((MarkupString)Item?.Text) @@ -182,18 +164,11 @@ - -
-
- - - - - - + @code { //meta tags - public string description { get; set; } + public string? description { get; set; } + public string? keywords { get; set; } //--------------------- public string strSearch { get; set; } [Parameter] @@ -245,8 +220,8 @@ } public async Task GenerateTags() { - - description = Item.Description ?? Item.Title; + keywords = Item.keywordsTag; + description = Item.DescriptionTag; } } diff --git a/moadiran/Pages/Home.razor b/moadiran/Pages/Home.razor index bda8889..27dfcc1 100644 --- a/moadiran/Pages/Home.razor +++ b/moadiran/Pages/Home.razor @@ -1,9 +1,12 @@ @inject Fixedvalues fv; @page "/" +@inject IConfiguration _config @using moadiran.Layout مُؤدیٰران (مدیریت صورتحساب ها) - + + +
@@ -22,14 +25,14 @@
-

+

مُؤدیٰران -

-

+

+

سامانه ای برای مدیران -

-

+

+

امتحانش رایگانه
@@ -398,3 +401,11 @@
+@code { + protected override async Task OnInitializedAsync() + { + description = _config.GetSection("MetaTags:Home:description").Value; + await base.OnInitializedAsync(); + } + public string description { get; set; } +} \ No newline at end of file diff --git a/moadiran/Pages/ListBlog.razor b/moadiran/Pages/ListBlog.razor index ecbfc36..0f83e0b 100644 --- a/moadiran/Pages/ListBlog.razor +++ b/moadiran/Pages/ListBlog.razor @@ -1,6 +1,6 @@ - +@inject IConfiguration _config @inject HttpClient _hc -@layout BlogLayout +@layout Shared.BlogLayout @page "/ListBlog" @page "/ListBlog/{Tag}" @page "/SearchBlog/{itemSearch}" @@ -9,6 +9,12 @@ @using global::Shared.DTOs @inject NavigationManager Navigation دانشنامه + + + + + +
@@ -103,6 +109,8 @@
@code { + public string description { get; set; } + public string keywords { get; set; } [Parameter] public string? Tag { get; set; } @@ -113,14 +121,22 @@ public PagingDto? request { get; set; } + protected override async Task OnInitializedAsync() + { + description = _config.GetSection("MetaTags:ListBlog:description").Value; + keywords = _config.GetSection("MetaTags:ListBlog:keywords").Value; + await base.OnInitializedAsync(); + } protected override async Task OnParametersSetAsync() { if (PageIndex == null) PageIndex = 1; string url = $"Base/LastBlog?PageIndex={PageIndex ?? 1}&PageSize=6"; if (!string.IsNullOrEmpty(itemSearch)) url += $" &ItemSearch={itemSearch}"; - else if (!string.IsNullOrEmpty(Tag)) url += $" &Tag={Tag}"; + else if (!string.IsNullOrEmpty(Tag)) url += $" &Tag={Tag}"; request = await _hc.GetFromJsonAsync>(url); + + await base.OnParametersSetAsync(); } diff --git a/moadiran/Pages/Verification.razor b/moadiran/Pages/Verification.razor index 3d5b5b2..a019e57 100644 --- a/moadiran/Pages/Verification.razor +++ b/moadiran/Pages/Verification.razor @@ -2,8 +2,15 @@ @page "/Verification/{ID:int}" @inject HttpClient _hc @inject NavigationManager nav +@inject IConfiguration _config + مودیران / احراز هویت + + + + +
@@ -84,6 +91,7 @@
@code { + public string description { get; set; } List messages = new List(); public string hidden { get; set; } public bool SpinnerVisible { get; set; } = false; @@ -103,6 +111,11 @@ [SupplyParameterFromForm] public VerificationCodeDto? VerificationCodeModel { get; set; } = new VerificationCodeDto(); + protected override async Task OnInitializedAsync() + { + description = _config.GetSection("MetaTags:Verification:description").Value; + await base.OnInitializedAsync(); + } protected override async Task OnParametersSetAsync() { var request = await _hc.GetAsync($"Verification/GetVerification/{ID}"); diff --git a/moadiran/Pages/_Layout.cshtml b/moadiran/Pages/_Layout.cshtml index ec3cfaf..7ccefef 100644 --- a/moadiran/Pages/_Layout.cshtml +++ b/moadiran/Pages/_Layout.cshtml @@ -6,19 +6,30 @@ - - + مُؤدیٰران (مدیریت صورتحساب ها) - - - - + + + + + + + + + + + + + + + + @@ -26,7 +37,7 @@ - @RenderBody() + @RenderBody()
diff --git a/moadiran/Shared/BlogLayout.razor b/moadiran/Shared/BlogLayout.razor new file mode 100644 index 0000000..37c5e70 --- /dev/null +++ b/moadiran/Shared/BlogLayout.razor @@ -0,0 +1,14 @@ +@using moadiran.Layout +@inherits LayoutComponentBase + + + +
+
+ @Body + +
+
+ + + diff --git a/moadiran/Layout/BlogLayout.razor.css b/moadiran/Shared/BlogLayout.razor.css similarity index 100% rename from moadiran/Layout/BlogLayout.razor.css rename to moadiran/Shared/BlogLayout.razor.css diff --git a/moadiran/Shared/MainLayout.razor b/moadiran/Shared/MainLayout.razor index 886535f..9acc4e8 100644 --- a/moadiran/Shared/MainLayout.razor +++ b/moadiran/Shared/MainLayout.razor @@ -1,30 +1,8 @@ @using moadiran.Layout @inherits LayoutComponentBase @inject Fixedvalues fv; - - - - - - - - - - - - - - - - - - - - - -
@@ -33,7 +11,7 @@
@code { - public string description { get; set; } = "سامانه ای برای مدیریت صورتحساب های فروش با الگوی سازمان امورمالیاتی کشور و ارسال صورت حساب به سامانه مودیان"; + protected override async Task OnAfterRenderAsync(bool firstRender) { if(firstRender) diff --git a/moadiran/appsettings.json b/moadiran/appsettings.json index 10f68b8..aefc728 100644 --- a/moadiran/appsettings.json +++ b/moadiran/appsettings.json @@ -5,5 +5,17 @@ "Microsoft.AspNetCore": "Warning" } }, + "MetaTags": { + "Verification": { + "description": "سامانه ای برای مدیریت صورتحساب های فروش با الگوی سازمان امورمالیاتی کشور و ارسال صورت حساب به سامانه مودیان" + }, + "Home": { + "description": "سامانه ای برای مدیریت صورتحساب های فروش با الگوی سازمان امورمالیاتی کشور و ارسال صورت حساب به سامانه مودیان" + }, + "ListBlog": { + "description": "دانشنانه مؤدیران", + "keywords": "دانشنانه مؤدیران" + } + }, "AllowedHosts": "*" }