-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed globalize resource visitor and added the test (#1756)
* Fixed globalize resource visitor and added the test * Fixed unit tests - RequiredResource is added to a different place, changin the auto-generated ids of controls
- Loading branch information
1 parent
ce78339
commit 955698c
Showing
10 changed files
with
124 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...mples/Common/ViewModels/FeatureSamples/Formatting/AutoResourceInclusionMasterViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DotVVM.Framework.ViewModel; | ||
using DotVVM.Framework.Hosting; | ||
|
||
namespace DotVVM.Samples.Common.ViewModels.FeatureSamples.Formatting | ||
{ | ||
public class AutoResourceInclusionMasterViewModel : DotvvmViewModelBase | ||
{ | ||
|
||
} | ||
} | ||
|
40 changes: 40 additions & 0 deletions
40
src/Samples/Common/ViewModels/FeatureSamples/Formatting/AutoResourceInclusionViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DotVVM.Framework.ViewModel; | ||
using DotVVM.Framework.Hosting; | ||
|
||
namespace DotVVM.Samples.Common.ViewModels.FeatureSamples.Formatting | ||
{ | ||
public class AutoResourceInclusionViewModel : AutoResourceInclusionMasterViewModel | ||
{ | ||
public List<Item> Items { get; set; } | ||
|
||
public int Number { get; set; } = 15; | ||
|
||
public override Task PreRender() | ||
{ | ||
if (!Context.IsPostBack) | ||
{ | ||
Items = new List<Item>() | ||
{ | ||
new Item() { Id = 1, DateCreated = new DateTime(2020, 1, 2, 20, 3, 45) }, | ||
new Item() { Id = 2, DateCreated = new DateTime(2020, 1, 2, 21, 4, 46) }, | ||
new Item() { Id = 3, DateCreated = new DateTime(2020, 1, 2, 22, 5, 47) }, | ||
}; | ||
} | ||
return base.PreRender(); | ||
} | ||
|
||
public class Item | ||
{ | ||
public int Id { get; set; } | ||
|
||
public DateTime DateCreated { get; set; } | ||
} | ||
|
||
} | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
src/Samples/Common/Views/FeatureSamples/Formatting/AutoResourceInclusion.dothtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@viewModel DotVVM.Samples.Common.ViewModels.FeatureSamples.Formatting.AutoResourceInclusionViewModel, DotVVM.Samples.Common | ||
@masterPage Views/FeatureSamples/Formatting/AutoResourceInclusionMaster.dotmaster | ||
|
||
<dot:Content ContentPlaceHolderID="MainContent"> | ||
<h1>Makes sure that Globalize resource is added correctly</h1> | ||
|
||
<dot:AuthenticatedView> | ||
<AuthenticatedTemplate> | ||
{{value: Number}} | ||
</AuthenticatedTemplate> | ||
</dot:AuthenticatedView> | ||
|
||
<dot:Repeater DataSource="{value: Items}"> | ||
<EmptyDataTemplate> | ||
test | ||
</EmptyDataTemplate> | ||
<ItemTemplate> | ||
<p> | ||
<dot:RouteLink RouteName="RepeaterRouteLink-PageDetail" Param-Id="{value: Id}" Text="{value: Id}" /> | ||
<br /> | ||
{{value: DateCreated.ToString("g")}} | ||
</p> | ||
</ItemTemplate> | ||
</dot:Repeater> | ||
|
||
</dot:Content> |
18 changes: 18 additions & 0 deletions
18
src/Samples/Common/Views/FeatureSamples/Formatting/AutoResourceInclusionMaster.dotmaster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@viewModel DotVVM.Samples.Common.ViewModels.FeatureSamples.Formatting.AutoResourceInclusionMasterViewModel, DotVVM.Samples.Common | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
</head> | ||
<body> | ||
|
||
|
||
<dot:ContentPlaceHolder ID="MainContent" /> | ||
|
||
</body> | ||
</html> | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters