+ {/* Header */}
+
+
+
+
+
+
Course Content
+
+ {courseData?.course?.title} - Manage course materials
+
+
+
+
+
+
+
+ {/* Content List */}
+
+
+
Course Materials
+
+ {contentData?.contents?.length || 0} items
+
+
+
+ {contentData?.contents?.length > 0 ? (
+
+ {contentData.contents.map((content) => {
+ const IconComponent = getContentTypeIcon(content.type);
+ return (
+
+
+
+
+
+
{content.title}
+
{getContentTypeLabel(content.type)}
+ {content.description && (
+
{content.description}
+ )}
+ {content.fileUrl && (
+
File attached
+ )}
+
+
+
+
+
+ Order: {content.order}
+
+
+ Points: {content.points}
+
+ {content.isRequired && (
+
+ Required
+
+ )}
+ {content.isPublished ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+
+ );
+ })}
+
+ ) : (
+
+
+
No content yet
+
Start building your course by adding content
+
+ )}
+
+
+ {/* Add Content Modal */}
+ {showAddContentModal && (
+
+
+
+
Add Course Content
+
+
+
+
+
+
+ )}
+
+ {/* Edit Content Modal */}
+ {showEditContentModal && editingContent && (
+
+
+
+
Edit Course Content
+
+
+
+
+
+
+ )}
+
+ );
+};
+
+export default CourseContent;
\ No newline at end of file
diff --git a/frontend/src/pages/CourseDetail.js b/frontend/src/pages/CourseDetail.js
index f8ace70..c1025d9 100644
--- a/frontend/src/pages/CourseDetail.js
+++ b/frontend/src/pages/CourseDetail.js
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
-import { useParams } from 'react-router-dom';
+import { useParams, Link } from 'react-router-dom';
import { useQuery, useMutation, useQueryClient } from 'react-query';
import { useAuth } from '../contexts/AuthContext';
import { coursesAPI, enrollmentsAPI } from '../services/api';
@@ -9,13 +9,14 @@ import {
UserIcon,
StarIcon,
BookOpenIcon,
+ CogIcon,
} from '@heroicons/react/24/outline';
import LoadingSpinner from '../components/LoadingSpinner';
import toast from 'react-hot-toast';
const CourseDetail = () => {
const { id } = useParams();
- const { user, isTrainee } = useAuth();
+ const { user, isTrainee, isTrainer, isSuperAdmin } = useAuth();
const [enrolling, setEnrolling] = useState(false);
const queryClient = useQueryClient();
@@ -108,8 +109,21 @@ const CourseDetail = () => {
return (
-
{courseData.title}
-
{courseData.shortDescription}
+
+
+
{courseData.title}
+
{courseData.shortDescription}
+
+ {(isTrainer || isSuperAdmin) && (
+
+
+ Manage Content
+
+ )}
+
diff --git a/frontend/src/pages/CourseEdit.js b/frontend/src/pages/CourseEdit.js
index f76f29c..f072c03 100644
--- a/frontend/src/pages/CourseEdit.js
+++ b/frontend/src/pages/CourseEdit.js
@@ -27,6 +27,8 @@ const CourseEdit = () => {
const [imagePreview, setImagePreview] = useState(null);
const [uploadingImage, setUploadingImage] = useState(false);
+
+
const handleImageChange = (e) => {
const f = e.target.files[0];
setImageFile(f);
@@ -54,6 +56,8 @@ const CourseEdit = () => {
{ enabled: !!id }
);
+
+
useEffect(() => {
if (courseData && courseData.course) {
const c = courseData.course;
@@ -93,6 +97,8 @@ const CourseEdit = () => {
}
);
+
+
const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);
@@ -116,6 +122,8 @@ const CourseEdit = () => {
}));
};
+
+
if (!isTrainer && !isSuperAdmin) {
return (
@@ -425,6 +433,8 @@ const CourseEdit = () => {
+
+
{/* Submit Buttons */}
+
+
);
};
diff --git a/version.txt b/version.txt
index c8bc93c..5509167 100644
--- a/version.txt
+++ b/version.txt
@@ -1,4 +1,4 @@
-CourseWorx v1.1.0 - Course Content & Enrollment Management
+CourseWorx v1.1.1 - Enhanced Course Content Management Interface
==========================================================
This version adds comprehensive course content management and enrollment/subscriber functionality to the existing Course Management System.
@@ -111,6 +111,43 @@ MAJOR FEATURES IMPLEMENTED:
- Assignment management
- Database migrations and seeding
+NEW FEATURES IN v1.1.1:
+========================
+
+1. DEDICATED COURSE CONTENT MANAGEMENT PAGE
+-------------------------------------------
+- Separated content management from course editing
+- Dedicated `/courses/:id/content` route for content management
+- Comprehensive content CRUD operations (Create, Read, Update, Delete)
+- Enhanced user interface with prominent action buttons
+- Content type icons and visual indicators
+- Content status management (published/unpublished, required/optional)
+
+2. ENHANCED USER INTERFACE
+---------------------------
+- Prominent "Manage Content" button on course detail pages
+- Improved visual hierarchy and button styling
+- Better content organization and display
+- Enhanced modal interfaces for content creation/editing
+- Responsive design improvements
+- Loading states and error handling
+
+3. CONTENT MANAGEMENT WORKFLOW
+------------------------------
+- Add content with type-specific forms (Documents, Images, Videos, Articles, Quizzes, Certificates)
+- Edit existing content with pre-populated forms
+- Delete content with confirmation dialogs
+- File upload with type validation and progress tracking
+- Content ordering and points system
+- Publishing controls and status indicators
+
+4. NAVIGATION IMPROVEMENTS
+---------------------------
+- Direct access to content management from course detail pages
+- Back navigation to course detail page
+- Role-based visibility for content management features
+- Clean separation between course editing and content management
+
NEW FEATURES IN v1.1.0:
========================
@@ -310,5 +347,5 @@ DEPLOYMENT READINESS:
This version (1.1.0) adds comprehensive course content management and enrollment/subscriber functionality to the existing Course Management System, providing a complete foundation for creating rich educational content and managing student enrollments.
Release Date: [Current Date]
-Version: 1.1.0
+Version: 1.1.1
Status: Production Ready
\ No newline at end of file