Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1.6 KB
Raw Blame
@model CourseModel
<vc:admin-widget widget-zone="course_details_subject_top" additional-data="Model"/>
@if (!string.IsNullOrEmpty(Model.Id))
{
    @* an inline-edit grid in a titled card; grid.js moves its Add new into the card header *@
    <admin-card title="@Loc["Admin.Courses.Course.Subjects"]" flush>
        <admin-grid id="subjects-grid"
                    confirm-destroy="true"
                    read-url="@Url.Action("Subjects", "Course", new { courseId = Model.Id, area = Constants.AreaAdmin })"
                    create-url="@Url.Action("SubjectAdd", "Course", new { courseId = Model.Id, area = Constants.AreaAdmin })"
                    update-url="@Url.Action("SubjectUpdate", "Course", new { courseId = Model.Id, area = Constants.AreaAdmin })"
                    destroy-url="@Url.Action("SubjectDelete", "Course", new { courseId = Model.Id, area = Constants.AreaAdmin })"
                    pager="Compact"
                    edit-mode="Inline">
            <grid-toolbar-create/>
            <grid-column field="Name" title="@Loc["Admin.Courses.Course.Subject.Fields.Name"]" width="400" editor="Text"/>
            <grid-column field="DisplayOrder" title="@Loc["Admin.Courses.Course.Subject.Fields.DisplayOrder"]" width="100" format="{0:0}" editor="Integer" default-value="0"/>
            <grid-commands edit="true" destroy="true" width="200"/>
        </admin-grid>
    </admin-card>
}
else
{
    <div class="note note-info">
        @Loc["Admin.Courses.Course.Subject.SaveBeforeEdit"]
    </div>
}
<vc:admin-widget widget-zone="course_details_subject_bottom" additional-data="Model"/>