Repository navigation
Conversation
… home - refs chamilo#2256 Add a per-course introduction_position setting (above, below, left, right; default above) and apply it on the course homepage. Teachers can change it from a picker on the introduction block or from the course settings page.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2256
What
Teachers can choose where the course introduction sits on the course homepage: above, below, left or right of the tools. The default is above, so existing courses keep the current layout.
The position is stored as the per-course setting
introduction_position(categorycourse_homepage) inc_course_setting. No schema migration is needed; missing rows are treated asabove. New courses get the default row when they are created.Course homepage
CourseHome.vueapplies the setting with layout classes.1024pxand up). On smaller screens they stack the introduction above the tools.Course settings
Endpoint:
POST /api/course-settings/introduction-position?cid=&sid={ "position": "above"|"below"|"left"|"right" }CourseVoterEDIT). Other users, including students and teachers of a different course, get 403. Invalid values get 400.csrf: false).Tests
tests/CoreBundle/Api/CourseIntroductionPositionApiTest.php— teacher can save, student is refused, invalid values are rejected, a teacher of another course is refused. All 4 tests passed against thechamilo_test_testdatabase.tests/javascript/introductionPosition.test.cjs— layout resolution, including the mobile stack and the sequence-column fallback. 6 tests passed (node --test).src/andtests/PHP files: clean.CourseSettingsManager.phpandCourseHelper.phpare unrelated to this change. Psalm was not run (it cannot run on this box).Security review
v-htmlrendering is unchanged.Release note
Teachers can now place the course introduction above, below, to the left or to the right of the tools, from the course homepage or from Course settings. Existing courses stay unchanged (above the tools). On small screens, left and right stack above the tools. If the course sequence column is also shown, a right-hand introduction is displayed above the tools so the two columns do not overlap.