| | | 1 | | @inject MUNity.Database.Context.MunityContext dbContext |
| | | 2 | | @inject Services.ConferenceWebsiteService websiteService |
| | | 3 | | |
| | 0 | 4 | | @if (MenuItem != null) |
| | 0 | 5 | | { |
| | 0 | 6 | | if (MenuItem.Items == null || MenuItem.Items.Count == 0) |
| | 0 | 7 | | { |
| | | 8 | | <li> |
| | | 9 | | <i class="fa fa-file text-warning fa-lg"></i> |
| | 0 | 10 | | @if (rename) |
| | 0 | 11 | | { |
| | | 12 | | <input @bind="@MenuItem.Title" /> |
| | 0 | 13 | | <button class="btn btn-sm btn-success" @onclick="() => { websiteService.RenameMenuEntry(MenuItem.Id, Men |
| | 0 | 14 | | } |
| | | 15 | | else |
| | 0 | 16 | | { |
| | 0 | 17 | | <a class="cursor-pointer" @onclick="() => PageSelected.InvokeAsync(MenuItem)">@MenuItem.Title</a> |
| | 0 | 18 | | <i class="fa fa-pen" @onclick="() => rename = true"></i> |
| | 0 | 19 | | } |
| | | 20 | | </li> |
| | | 21 | | |
| | 0 | 22 | | } |
| | | 23 | | else |
| | 0 | 24 | | { |
| | | 25 | | <li> |
| | | 26 | | <i class="fa fa-folder text-primary fa-lg"></i> |
| | 0 | 27 | | @MenuItem.Title |
| | | 28 | | <ul> |
| | 0 | 29 | | @foreach (var subItem in MenuItem.Items) |
| | 0 | 30 | | { |
| | | 31 | | <WebEditorMenuItemComponent MenuItem="@subItem" |
| | 0 | 32 | | AddPage="(i) => AddPage.InvokeAsync(i)" |
| | 0 | 33 | | PageSelected="(i) => PageSelected.InvokeAsync(i)" /> |
| | | 34 | | |
| | 0 | 35 | | } |
| | 0 | 36 | | <li class="cursor-pointer" @onclick="() => AddPage.InvokeAsync(this.MenuItem)"><i class="fa fa-plus text |
| | | 37 | | </ul> |
| | | 38 | | </li> |
| | 0 | 39 | | } |
| | 0 | 40 | | } |
| | | 41 | | else |
| | 0 | 42 | | { |
| | | 43 | | <li>ERR 52534</li> |
| | 0 | 44 | | } |
| | | 45 | | |
| | | 46 | | |
| | | 47 | | @code { |
| | 0 | 48 | | [Parameter] public MUNity.Schema.Conference.Website.MenuItem MenuItem { get; set; } |
| | | 49 | | |
| | 0 | 50 | | [Parameter] public EventCallback<MUNity.Schema.Conference.Website.MenuItem> AddPage { get; set; } |
| | | 51 | | |
| | 0 | 52 | | [Parameter] public EventCallback<MUNity.Schema.Conference.Website.MenuItem> PageSelected { get; set; } |
| | | 53 | | |
| | | 54 | | private bool rename; |
| | | 55 | | } |