Skip to content

Commit

Permalink
feat(view): update course folder view
Browse files Browse the repository at this point in the history
- update material view to include workflow state
- update folder and subfolder permission view to include canManageKnowledgeBase
  • Loading branch information
Jonaspng committed Jan 5, 2025
1 parent 5b44956 commit 7292b2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/course/material/folders/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ json.subfolders @subfolders do |subfolder|
json.showSdlWarning show_sdl_warning?(subfolder)
json.canEdit can?(:edit, subfolder)
json.canDelete can?(:destroy, subfolder)
json.canManageKnowledgeBase current_course_user&.manager_or_owner?
end
end

json.materials @folder.materials.includes(:updater) do |material|
json.id material.id
json.name material.name
json.workflowState material.workflow_state
json.description format_ckeditor_rich_text(material.description)
json.materialUrl url_to_material(current_course, @folder, material)
json.updatedAt material.attachment.updated_at
Expand Down Expand Up @@ -59,6 +61,7 @@ json.advanceStartAt current_course.advance_start_at_duration

json.permissions do
json.isCurrentCourseStudent current_course_user&.student?
json.canManageKnowledgeBase current_course_user&.manager_or_owner?
json.canStudentUpload @folder.can_student_upload
json.canCreateSubfolder can?(:new_subfolder, @folder)
json.canUpload can?(:upload, @folder)
Expand Down

0 comments on commit 7292b2d

Please sign in to comment.