Ignore:
Timestamp:
08/23/24 15:40:14 (5 weeks ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
e9bb9d1
Parents:
72b1da2
Message:

fix access

implement multiple access pages with different roles
optimize present three structure of BlogPost and Answer

Location:
PostgreSqlDotnetCore/Views
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Views/Blog/Details.cshtml

    r72b1da2 r118e414  
    8080                    @Html.ActionLink("Details", "Details", "BlogPostAnswers", new { id = item.id }) |
    8181                    @Html.ActionLink("Delete", "Delete", "BlogPostAnswers", new { id = item.id })
     82
     83                    @Html.ActionLink("Create an Answer", "Create", "BlogPostAnswers", new { id = item.BlogPostConsultationid, parentId = item.id })
    8284                </td>
    8385            </tr>
     
    8789</div>
    8890<p>
     91    @Html.ActionLink("Create an Answer", "Create", "BlogPostAnswers", new { id = Model.id, parentId = Model.id })
    8992    @Html.ActionLink("Edit", "Edit", new { id = Model.id }) |
    9093    @Html.ActionLink("Back to List", "Index")
  • PostgreSqlDotnetCore/Views/Blog/Index.cshtml

    r72b1da2 r118e414  
    2929    </tr>
    3030
    31 @foreach (var item in Model) {
    32     <tr>
    33         <td>
    34             @Html.DisplayFor(modelItem => item.date_askes)
    35         </td>
    36         <td>
    37             @Html.DisplayFor(modelItem => item.title)
    38         </td>
     31    @foreach (var item in Model)
     32    {
     33        <tr>
     34            <td>
     35                @Html.DisplayFor(modelItem => item.date_askes)
     36            </td>
     37            <td>
     38                @Html.DisplayFor(modelItem => item.title)
     39            </td>
    3940
    40         <td>
    41             @Html.DisplayFor(modelItem => item.description)
    42         </td>
    43         <th>
    44             @Html.DisplayFor(model => item.users_id)
    45         </th>
     41            <td>
     42                @Html.DisplayFor(modelItem => item.description)
     43            </td>
     44            <th>
     45                @Html.DisplayFor(model => item.users_id)
     46            </th>
    4647
    47        @*<td>
    48             @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
    49             @Html.ActionLink("Answers", "Details", new { id = item.id }) |
    50             @Html.ActionLink("Delete", "Delete", new { id = item.id })
     48            @*<td>
     49        @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
     50        @Html.ActionLink("Answers", "Details", new { id = item.id }) |
     51        @Html.ActionLink("Delete", "Delete", new { id = item.id })
    5152        </td>
    5253        *@
    53            
    5454
    5555
    5656
    57               @if (item.users_id == ViewBag.CurrentUserId)
    58               {
    59               <td>
    60             @Html.ActionLink("Edit", "Edit", new { id = item.id })
    61             @Html.ActionLink("Delete", "Delete", new { id = item.id })
    62              
    63         </td>
     57
     58            @if (item.users_id == ViewBag.CurrentUserId)
     59            {
     60                <td>
     61                    @Html.ActionLink("Edit", "Edit", new { id = item.id })
     62                    @Html.ActionLink("Delete", "Delete", new { id = item.id })
     63
     64                </td>
    6465            }
    6566
    66            
    6767
    6868            @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
    6969            {
    7070                <td>
    71                    
    72                     @Html.ActionLink("Answers", "Details", new { id = item.id }) 
    73                    
     71
     72                    @Html.ActionLink("Answers", "Details", new { id = item.id })
     73
    7474
    7575                </td>
    7676            }
    77            
    7877
    7978
    80            
    81        
    82            
    83     </tr>
    84 }
     79
     80
     81
     82
     83        </tr>
     84    }
    8585
    8686</table>
  • PostgreSqlDotnetCore/Views/BlogPostAnswers/Create.cshtml

    r72b1da2 r118e414  
    1717    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    1818
    19     <div class="form-group">
     19   @* <div class="form-group">
    2020        @Html.LabelFor(model => model.parent_id, htmlAttributes: new { @class = "control-label col-md-2" })
    2121        <div class="col-md-10">
     
    2424        </div>
    2525    </div>
    26 
     26 *@
    2727    <div class="form-group">
    2828        @Html.LabelFor(model => model.reply, htmlAttributes: new { @class = "control-label col-md-2" })
  • PostgreSqlDotnetCore/Views/BlogPostAnswers/Details.cshtml

    r72b1da2 r118e414  
    3131<p>
    3232    @Html.ActionLink("Edit", "Edit", new { id = Model.id }) |
    33     @Html.ActionLink("Back to List", "Index")
     33    @* @Html.ActionLink("Back to List", "Index") *@
     34    <a href="javascript:void(0);" onclick="history.go(-1);">Back to List</a>
    3435</p>
  • PostgreSqlDotnetCore/Views/Customer/Index.cshtml

    r72b1da2 r118e414  
    1717    {
    1818
    19         <p>
     19       /* <p>
    2020            @Html.ActionLink("Create New", "Create")
    2121        </p>
     22        */
     23
     24        @if (ViewBag.CanCreate)
     25        {
     26            <p>
     27                @Html.ActionLink("Create New", "Create")
     28            </p>
     29        }
    2230        <table class="table">
    2331            <tr>
  • PostgreSqlDotnetCore/Views/Shared/_Layout.cshtml

    r72b1da2 r118e414  
    1313</head>
    1414<body>
    15     <h1>@(ViewBag.isAuthenticated == null ? "krij" : "prikazi")</h1>
     15    @* <h1>@(ViewBag.isAuthenticated == null ? "krij" : "prikazi")</h1> *@
    1616    <header>
    1717        <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
     
    4747                                    <a class="nav-link text-dark" asp-area="" asp-controller="Customer" asp-action="Index">Manage Customers</a>
    4848                                </li>
    49                                 <li class="nav-item">
     49                               @* <li class="nav-item">
    5050                                    <a class="nav-link text-dark" asp-area="" asp-controller="City" asp-action="Index">Manage Cities</a>
    5151                                </li>
    52                                
     52                               *@
    5353                                <li class="nav-item">
    5454                                    <a class="nav-link text-dark" asp-area="" asp-controller="Blog" asp-action="Index">BlogPost</a>
     
    5656                            }
    5757
     58                         
     59
    5860                           
    5961                        }
     62                        @if (ViewBag.OnlyAdminManager != null)
     63                        {
     64                            <li class="nav-item">
     65                                <a class="nav-link text-dark" asp-area="" asp-controller="City" asp-action="Index">Manage Cities</a>
     66                            </li>
     67                        }
     68
    6069
    6170                       
Note: See TracChangeset for help on using the changeset viewer.