Skip to content

Commit 45634ae

Browse files
committed
feat: general improvements and minor bugs
1 parent cd21479 commit 45634ae

11 files changed

Lines changed: 219 additions & 32 deletions

File tree

src/WebUI/Internationalization/de

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ controlpage.label=Steuerelemente
1515

1616
fragmentpage.label=Fragmente
1717
fragmentpage.description=Demonstration der Verwendung von Fragmenten in WebExpress.
18+
19+
statuspage.label=StatusPage
20+
statuspage.description=Demonstration der Statusseiten in WebExpress.
21+
statuspage.400=Fehler 400 - Ungültige Anforderung
22+
statuspage.404=Fehler 404 - Seite nicht gefunden
23+
statuspage.500=Fehler 500 - Interner Serverfehler

src/WebUI/Internationalization/en

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ controlpage.label=Controls
1515

1616
fragmentpage.label=Fragments
1717
fragmentpage.description=Demonstration of using fragments in WebExpress.
18+
19+
statuspage.label=StatusPage
20+
statuspage.description=Demonstration of status pages in WebExpress.
21+
statuspage.400=Error 400 - Bad Request
22+
statuspage.404=Error 404 - Page not found
23+
statuspage.500=Error 500 - Internal Server Error

src/WebUI/Model/Location.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using WebExpress.WebApp.WebRestApi;
3-
using WebExpress.WebCore.WebUri;
43

54
namespace WebExpress.Tutorial.WebUI.Model
65
{
@@ -24,11 +23,6 @@ public class Location : IRestApiCrudSelectionItem
2423
/// </summary>
2524
public string Description { get; set; }
2625

27-
/// <summary>
28-
/// Returns or sets an optional deep link target to the location.
29-
/// </summary>
30-
public IUri Uri { get; set; }
31-
3226
/// <summary>
3327
/// Returns or sets the island the location belongs to (e.g., "Melee Island", "Monkey Island").
3428
/// </summary>

src/WebUI/Model/ViewModel.cs

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -552,134 +552,159 @@ public static IEnumerable<Inventory> GetMonkeyIslandInventories()
552552
/// <returns>An collection containing the locations.</returns>
553553
public static IEnumerable<Location> GetMonkeyIslandLocations()
554554
{
555-
// locations from "The Secret of Monkey Island" (1990)
555+
// locations from "The Secret of Monkey Island"
556556
// melee island
557557
yield return new Location
558558
{
559559
Text = "Lookout Point",
560-
Description = "Clifftop vantage point where the Lookout keeps watch over Mêlée Island."
560+
Description = "Clifftop vantage point where the Lookout keeps watch over Mêlée Island.",
561+
Island = "Mêlée Island"
561562
};
562563
yield return new Location
563564
{
564565
Text = "Mêlée Island Village",
565-
Description = "Central village street with shops and notable buildings."
566+
Description = "Central village street with shops and notable buildings.",
567+
Island = "Mêlée Island"
566568
};
567569
yield return new Location
568570
{
569571
Text = "Scumm Bar",
570-
Description = "Notorious pirate tavern by the docks."
572+
Description = "Notorious pirate tavern by the docks.",
573+
Island = "Mêlée Island"
571574
};
572575
yield return new Location
573576
{
574577
Text = "Docks",
575-
Description = "Harbor area where ships moor and the Scumm Bar is located."
578+
Description = "Harbor area where ships moor and the Scumm Bar is located.",
579+
Island = "Mêlée Island"
576580
};
577581
yield return new Location
578582
{
579583
Text = "Jail",
580-
Description = "Small prison that houses characters like Otis."
584+
Description = "Small prison that houses characters like Otis.",
585+
Island = "Mêlée Island"
581586
};
582587
yield return new Location
583588
{
584589
Text = "General Store",
585-
Description = "Village shop run by the shopkeeper."
590+
Description = "Village shop run by the shopkeeper.",
591+
Island = "Mêlée Island"
586592
};
587593
yield return new Location
588594
{
589595
Text = "Church",
590-
Description = "Chapel used for certain story events."
596+
Description = "Chapel used for certain story events.",
597+
Island = "Mêlée Island"
591598
};
592599
yield return new Location
593600
{
594601
Text = "Alley",
595-
Description = "Narrow back alley with hidden goings-on."
602+
Description = "Narrow back alley with hidden goings-on.",
603+
Island = "Mêlée Island"
596604
};
597605
yield return new Location
598606
{
599607
Text = "Governor's Mansion",
600-
Description = "Residence of Governor Elaine Marley, guarded by piranha poodles."
608+
Description = "Residence of Governor Elaine Marley, guarded by piranha poodles.",
609+
Island = "Mêlée Island"
601610
};
602611
yield return new Location
603612
{
604613
Text = "Circus of the Fettuccini Brothers",
605-
Description = "Traveling circus for daring stunts and a few bruises."
614+
Description = "Traveling circus for daring stunts and a few bruises.",
615+
Island = "Mêlée Island"
606616
};
607617
yield return new Location
608618
{
609619
Text = "Forest",
610-
Description = "Maze-like woods that hide several paths and clearings."
620+
Description = "Maze-like woods that hide several paths and clearings.",
621+
Island = "Mêlée Island"
611622
};
612623
yield return new Location
613624
{
614625
Text = "Fork in the Forest",
615-
Description = "Signposted fork that helps (or hinders) orientation."
626+
Description = "Signposted fork that helps (or hinders) orientation.",
627+
Island = "Mêlée Island"
616628
};
617629
yield return new Location
618630
{
619631
Text = "Sword Master's House",
620-
Description = "Secluded home of the Sword Master, reachable through the forest."
632+
Description = "Secluded home of the Sword Master, reachable through the forest.",
633+
Island = "Mêlée Island"
621634
};
622635
yield return new Location
623636
{
624637
Text = "Stan's Previously Owned Vessels",
625-
Description = "Shipyard where Stan sells second-hand ships with flair."
638+
Description = "Shipyard where Stan sells second-hand ships with flair.",
639+
Island = "Mêlée Island"
626640
};
627641

628642
// monkey island (key locations)
629643
yield return new Location
630644
{
631645
Text = "Landing Beach",
632-
Description = "Sandy shore where the Sea Monkey reaches Monkey Island."
646+
Description = "Sandy shore where the Sea Monkey reaches Monkey Island.",
647+
Island = "Monkey Island"
633648
};
634649
yield return new Location
635650
{
636651
Text = "Jungle",
637-
Description = "Dense jungle covering most of the island."
652+
Description = "Dense jungle covering most of the island.",
653+
Island = "Monkey Island"
638654
};
639655
yield return new Location
640656
{
641657
Text = "Herman Toothrot's Camp",
642-
Description = "Makeshift camp of castaway Herman Toothrot."
658+
Description = "Makeshift camp of castaway Herman Toothrot.",
659+
Island = "Monkey Island"
643660
};
644661
yield return new Location
645662
{
646663
Text = "Banana Grove",
647-
Description = "Spot to acquire bananas for a helpful primate."
664+
Description = "Spot to acquire bananas for a helpful primate.",
665+
Island = "Monkey Island"
648666
};
649667
yield return new Location
650668
{
651669
Text = "Lagoon",
652-
Description = "Quiet inland waterbody used in puzzle-solving."
670+
Description = "Quiet inland waterbody used in puzzle-solving.",
671+
Island = "Monkey Island"
653672
};
654673
yield return new Location
655674
{
656675
Text = "Cannibal Village",
657-
Description = "Huts of the vegetarian cannibals with unique interior design."
676+
Description = "Huts of the vegetarian cannibals with unique interior design.",
677+
Island = "Monkey Island"
658678
};
659679
yield return new Location
660680
{
661681
Text = "Giant Stone Monkey Head",
662-
Description = "Ancient statue hiding an entrance to catacombs."
682+
Description = "Ancient statue hiding an entrance to catacombs.",
683+
Island = "Monkey Island"
663684
};
664685
yield return new Location
665686
{
666687
Text = "Volcano Rim",
667-
Description = "Fiery heart of the island visible near the catacombs."
688+
Description = "Fiery heart of the island visible near the catacombs.",
689+
Island = "Monkey Island"
668690
};
669691
yield return new Location
670692
{
671693
Text = "Sea Monkey Wreck",
672-
Description = "The Sea Monkey in less-than-seaworthy condition on the shore."
694+
Description = "The Sea Monkey in less-than-seaworthy condition on the shore.",
695+
Island = "Monkey Island"
673696
};
674697
yield return new Location
675698
{
676699
Text = "Catacombs",
677-
Description = "Underground passages leading to LeChuck's ghost ship."
700+
Description = "Underground passages leading to LeChuck's ghost ship.",
701+
Island = "Monkey Island"
678702
};
679703
yield return new Location
680704
{
681705
Text = "LeChuck's Ghost Ship",
682-
Description = "The dread pirate's vessel anchored in hidden waters."
706+
Description = "The dread pirate's vessel anchored in hidden waters.",
707+
Island = "Monkey Island"
683708
};
684709

685710
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using WebExpress.WebApp.WebPage;
2+
using WebExpress.WebApp.WebScope;
3+
using WebExpress.WebCore.WebAttribute;
4+
using WebExpress.WebCore.WebMessage;
5+
using WebExpress.WebCore.WebPage;
6+
using WebExpress.WebUI.WebIcon;
7+
8+
namespace WebExpress.Tutorial.WebUI.WWW.StatusPages
9+
{
10+
/// <summary>
11+
/// Represents the home page for the tutorial.
12+
/// </summary>
13+
[WebIcon<IconHome>]
14+
[Title("webexpress.tutorial.webui:homepage.label")]
15+
[Icon("fa fa-home")]
16+
[Scope<IScopeGeneral>]
17+
public sealed class BadRequest : IPage<VisualTreeWebApp>, IScopeGeneral
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the class.
21+
/// </summary>
22+
public BadRequest()
23+
{
24+
}
25+
26+
/// <summary>
27+
/// Processing of the resource.
28+
/// </summary>
29+
/// <param name="renderContext">The context for rendering the page.</param>
30+
/// <param name="visualTree">The visual tree of the web application.</param>
31+
public void Process(IRenderContext renderContext, VisualTreeWebApp visualTree)
32+
{
33+
throw new BadRequestException("This is a bad request example.");
34+
}
35+
}
36+
}

src/WebUI/WWW/StatusPages/Index.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using WebExpress.WebApp.WebPage;
2+
using WebExpress.WebApp.WebScope;
3+
using WebExpress.WebCore.WebAttribute;
4+
using WebExpress.WebCore.WebPage;
5+
using WebExpress.WebUI.WebIcon;
6+
7+
namespace WebExpress.Tutorial.WebUI.WWW.StatusPages
8+
{
9+
/// <summary>
10+
/// Represents the home page for the tutorial.
11+
/// </summary>
12+
[WebIcon<IconHome>]
13+
[Title("webexpress.tutorial.webui:homepage.label")]
14+
[Icon("fa fa-home")]
15+
[Scope<IScopeGeneral>]
16+
public sealed class Index : IPage<VisualTreeWebApp>, IScopeGeneral
17+
{
18+
/// <summary>
19+
/// Initializes a new instance of the class.
20+
/// </summary>
21+
public Index()
22+
{
23+
}
24+
25+
/// <summary>
26+
/// Processing of the resource.
27+
/// </summary>
28+
/// <param name="renderContext">The context for rendering the page.</param>
29+
/// <param name="visualTree">The visual tree of the web application.</param>
30+
public void Process(IRenderContext renderContext, VisualTreeWebApp visualTree)
31+
{
32+
throw new System.NotImplementedException();
33+
}
34+
}
35+
}

src/WebUI/WebFragment/ControlPage/ControlLinkFragment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using WebExpress.WebCore.WebComponent;
77
using WebExpress.WebCore.WebFragment;
88
using WebExpress.WebCore.WebHtml;
9+
using WebExpress.WebCore.WebScope;
910
using WebExpress.WebUI.WebControl;
1011
using WebExpress.WebUI.WebFragment;
1112
using WebExpress.WebUI.WebIcon;
@@ -21,6 +22,8 @@ namespace WebExpress.Tutorial.WebUI.WebFragment.ControlPage
2122
/// </remarks>
2223
[Section<SectionAppNavigationPrimary>]
2324
[Scope<IScopeGeneral>]
25+
[Scope<IScopeAdmin>]
26+
[Scope<IScopeStatusPage>]
2427
[Cache]
2528
public sealed class ControlLinkFragment : FragmentControlNavigationItemLink
2629
{

src/WebUI/WebFragment/FragmentPage/FragmentLinkFragment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using WebExpress.WebCore.WebComponent;
66
using WebExpress.WebCore.WebFragment;
77
using WebExpress.WebCore.WebHtml;
8+
using WebExpress.WebCore.WebScope;
89
using WebExpress.WebUI.WebControl;
910
using WebExpress.WebUI.WebFragment;
1011
using WebExpress.WebUI.WebIcon;
@@ -20,6 +21,8 @@ namespace WebExpress.Tutorial.WebUI.WebFragment.FragmentPage
2021
/// </remarks>
2122
[Section<SectionAppNavigationPrimary>]
2223
[Scope<IScopeGeneral>]
24+
[Scope<IScopeAdmin>]
25+
[Scope<IScopeStatusPage>]
2326
[Cache]
2427
public sealed class FragmentLinkFragment : FragmentControlNavigationItemLink
2528
{

src/WebUI/WebFragment/HomePage/HomeLinkFragment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using WebExpress.WebCore.WebComponent;
66
using WebExpress.WebCore.WebFragment;
77
using WebExpress.WebCore.WebHtml;
8+
using WebExpress.WebCore.WebScope;
89
using WebExpress.WebUI.WebControl;
910
using WebExpress.WebUI.WebFragment;
1011
using WebExpress.WebUI.WebIcon;
@@ -20,6 +21,8 @@ namespace WebExpress.Tutorial.WebUI.WebFragment.HomePage
2021
/// </remarks>
2122
[Section<SectionAppNavigationPreferences>]
2223
[Scope<IScopeGeneral>]
24+
[Scope<IScopeAdmin>]
25+
[Scope<IScopeStatusPage>]
2326
[Cache]
2427
public sealed class HomeLinkFragment : FragmentControlNavigationItemLink
2528
{

src/WebUI/WebFragment/InfoPage/InfoLinkFragment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using WebExpress.WebCore.WebComponent;
66
using WebExpress.WebCore.WebFragment;
77
using WebExpress.WebCore.WebHtml;
8+
using WebExpress.WebCore.WebScope;
89
using WebExpress.WebUI.WebControl;
910
using WebExpress.WebUI.WebFragment;
1011
using WebExpress.WebUI.WebIcon;
@@ -20,6 +21,8 @@ namespace WebExpress.Tutorial.WebUI.WebFragment.InfoPage
2021
/// </remarks>
2122
[Section<SectionAppNavigationSecondary>]
2223
[Scope<IScopeGeneral>]
24+
[Scope<IScopeAdmin>]
25+
[Scope<IScopeStatusPage>]
2326
[Cache]
2427
public sealed class InfoLinkFragment : FragmentControlNavigationItemLink
2528
{

0 commit comments

Comments
 (0)