PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CaritasServiceFundVeloMissingConclusion.razor 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @page "/fundvelo/conclusion_missing"
  2. @using cwebplusApp.Shared.Services;
  3. @using cwebplusApp.Shared.Models;
  4. @using cwebplusApp.Components;
  5. @inject NavigationManager NavigationManager;
  6. @inject IStringLocalizer<Resources> i18n;
  7. @inject PageHistoryManager PageHistoryManager;
  8. @inject ReportDataProvider ReportDataProvider;
  9. @inject IBicycleRestService IBicycleRestService;
  10. @inject Toaster Toaster;
  11. @inject AppState AppState;
  12. <div class="row px-3 h-100">
  13. <div class="row no-gutters align-items-start justify-content-center w-100">
  14. <MatHeadline4 Style="font-family:Ubuntu;padding-top:0.5em">@i18n["Info"]</MatHeadline4>
  15. </div>
  16. <div class="row no-gutters align-items-start justify-content-center w-100">
  17. @if (running) {
  18. <div style="width:48px;margin:0 auto;">
  19. <MatProgressCircle Indeterminate="true" Size="MatProgressCircleSize.Large" />
  20. </div>
  21. <div class="w-100" style="text-align:center;">
  22. <h6 style="font-style:italic;padding-bottom:1em">@i18n["Info.Report.Transmitting"]</h6>
  23. </div>
  24. } else {
  25. if (ResposeStatus.OK == responseStatus) {
  26. <MatHeadline5 Style="font-family:Ubuntu; text-align:center">@i18n["FinishedTextMissing"]</MatHeadline5>
  27. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800">@i18n["FinishedTextMissing_Heading1"]</MatSubtitle1>
  28. <ul class="w-100">
  29. <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_2"]</li>
  30. <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_3"]</li>
  31. </ul>
  32. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800;padding-top:20px">@i18n["FinishedTextMissing_Heading2"]</MatSubtitle1>
  33. <ul class="w-100">
  34. <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_4"]</li>
  35. <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_5"]</li>
  36. <li class="w-100" style="font-family: Ubuntu; text-align: left">@i18n["FinishedTextMissing_6"]</li>
  37. </ul>
  38. <MatHeadline5 Class="w-100" Style="font-family: Ubuntu; text-align: left;padding-top:20px">@i18n["FinishedTextMissing_Heading3"]</MatHeadline5>
  39. <div class="w-100">
  40. <MatIcon Style="padding-right:1rem">
  41. <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
  42. <path d="M0 0h24v24H0V0z" fill="none" />
  43. <path d="M19 17.47c-.88-.07-1.75-.22-2.6-.45l-1.19 1.19c1.2.41 2.48.67 3.8.75v-1.49zM5.03 5c.09 1.32.35 2.59.75 3.8l1.2-1.2c-.23-.84-.38-1.71-.44-2.6H5.03z" opacity=".3" />
  44. <path d="M9.07 7.57C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02zm7.33 9.45c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19zM5.79 8.8c-.41-1.21-.67-2.48-.76-3.8h1.5c.07.89.22 1.76.46 2.59L5.79 8.8z" />
  45. </svg>
  46. </MatIcon>
  47. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800;display:contents">@i18n["FinishedTextMissing_LostOffice_Phone"]</MatSubtitle1>
  48. </div>
  49. <div class="w-100">
  50. <MatIcon Style="padding-right:1rem">
  51. <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
  52. <path d="M0 0h24v24H0V0z" fill="none" />
  53. <path d="M20 8l-8 5-8-5v10h16zm0-2H4l8 4.99z" opacity=".3" />
  54. <path d="M4 20h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2zM20 6l-8 4.99L4 6h16zM4 8l8 5 8-5v10H4V8z" />
  55. </svg>
  56. </MatIcon>
  57. <MatSubtitle1 Class="w-100" Style="font-family: Ubuntu;text-align:left; font-weight:800; display:contents">@i18n["FinishedTextMissing_LostOffice_Mail"]</MatSubtitle1>
  58. </div>
  59. <div class="w-100">
  60. <MatIcon Style="padding-right:1rem">
  61. <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
  62. <path d="M0 0h24v24H0V0z" fill="none" />
  63. <path d="M12 4C9.24 4 7 6.24 7 9c0 2.85 2.92 7.21 5 9.88 2.11-2.69 5-7 5-9.88 0-2.76-2.24-5-5-5zm0 7.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" opacity=".3" />
  64. <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z" />
  65. <circle cx="12" cy="9" r="2.5" />
  66. </svg>
  67. </MatIcon>
  68. <MatSubtitle1 Class="w-100" Style="font-family:Ubuntu; text-align:left; font-weight:800; display:contents">@i18n["FinishedTextMissing_LostOffice_Address"]</MatSubtitle1>
  69. </div>
  70. } else if (ResposeStatus.Error == responseStatus) {
  71. <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)">
  72. <FailureImage></FailureImage>
  73. </Animate>
  74. } else {
  75. <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(2.5)">
  76. <WarningImage></WarningImage>
  77. </Animate>
  78. }
  79. }
  80. </div>
  81. <div class="row no-gutters align-items-end justify-content-center w-100" style="padding-top: 2em; padding-bottom: 1em">
  82. <div class="col w-100 text-center">
  83. <MatButton Class="w-50" Raised="true" @onclick="Finished">@i18n["Finished"]</MatButton>
  84. </div>
  85. </div>
  86. </div>
  87. @code {
  88. enum ResposeStatus : ushort {
  89. OK = 1,
  90. Error = 10,
  91. NoConnection = 20
  92. }
  93. private ResposeStatus responseStatus = ResposeStatus.NoConnection;
  94. private bool running = true;
  95. ReportResponse response;
  96. protected async override void OnInitialized() {
  97. base.OnInitialized();
  98. PageHistoryManager.AddPageToHistory(NavigationManager.Uri);
  99. try {
  100. if (ReportDataProvider.ReportRepositoryItem != null) {
  101. response = await IBicycleRestService.SendMissingReport((MissingReportRepositoryItem)ReportDataProvider.ReportRepositoryItem);
  102. } else {
  103. response = await IBicycleRestService.SendMissingReport(ReportDataProvider.Report);
  104. }
  105. responseStatus = response == null ? ResposeStatus.NoConnection : System.Net.HttpStatusCode.OK == response.StatusCode ? ResposeStatus.OK : ResposeStatus.Error;
  106. } catch (HttpRequestException ex) {
  107. response = new(i18n.GetString("MissingBike"), new string[] { ex.Message });
  108. responseStatus = ResposeStatus.Error;
  109. }
  110. running = false;
  111. if (ResposeStatus.OK == responseStatus) {
  112. Toaster.ShowSuccess(i18n.GetString("MissingBike"), response.Message);
  113. PageHistoryManager.Reset();
  114. } else if (ResposeStatus.Error == responseStatus) {
  115. Toaster.ShowError(response.Message, response.GetDataAsFormattedList());
  116. } else {
  117. Toaster.ShowWarning(i18n.GetString("Warning.NoConnection.Title"), i18n.GetString("Warning.NoConnection.Msg"));
  118. PageHistoryManager.Reset();
  119. }
  120. StateHasChanged();
  121. AppState.NotifyChanged();
  122. }
  123. private void Finished() {
  124. NavigationManager.NavigateTo("caritas_services");
  125. }
  126. }