Skip to content

Commit

Permalink
Update the source
Browse files Browse the repository at this point in the history
  • Loading branch information
vasanthlmsace committed Nov 14, 2024
1 parent c59d8d6 commit 6d93e22
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 48 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
- php: '8.2'
moodle-branch: 'MOODLE_405_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_404_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_403_STABLE'
database: 'pgsql'
# - php: '8.1'
# moodle-branch: 'MOODLE_404_STABLE'
# database: 'mariadb'
# - php: '8.0'
# moodle-branch: 'MOODLE_403_STABLE'
# database: 'pgsql'
- php: '7.4'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'
Expand Down
81 changes: 57 additions & 24 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ body.format-kickstart .form-control .fa-search {

#page-course-view-kickstart.kickstart-icon:before {
content: '\f1ce';
font-family: fontawesome;
font-family: var(--fa-style-family, "Font Awesome 6 Free", "Font Awesome 6 Brands", fontawesome);
font-weight: 700;
font-size: 40px;
position: fixed;
top: 50%;
Expand Down Expand Up @@ -123,12 +124,21 @@ body.format-kickstart .form-control .fa-search {
flex: 1 1 auto;
padding: 1.25rem;
}
.format-kickstart .card-body .card-title {
margin-top: 10px;
.format-kickstart .card-body .card-title,
.format-kickstart .card-body .card-text,
.format-kickstart .card-body p {
margin-bottom: 0;
}
.format-kickstart .card-body .text-muted {
margin-top: 5px;
}
.format-kickstart .card-body .card-text:empty,
.format-kickstart .card-body .text-muted:empty {
display: none;
}
.format-kickstart .course-content > .card .card-body {
text-align: right;
padding: 0;
display: flex;
align-items: center;
}
Expand All @@ -137,19 +147,19 @@ body.format-kickstart .form-control .fa-search {
float: none;
margin: 1rem 0;
}
.format-kickstart .course-content > .card .card-body {
.card-title {
text-align: left;
margin-top: 5px;
margin-bottom: 9px;
margin-right: 5px;
}
a.btn {
margin-right: 5px;
&:not(.btn-outline-dark) {
margin-left: auto;
}
}
.format-kickstart .course-content > .card .card-body .card-title {
width: 50%;
text-align: left;
margin-top: 5px;
margin-bottom: 9px;
margin-right: 5px;
}
.format-kickstart .course-content > .card .card-body a.btn {
margin-right: 5px;
margin-bottom: 5px;
}
.format-kickstart .course-content > .card .card-body a.btn:not(.btn-outline-dark) {
margin-left: auto;
}
.format-kickstart .card-footer {
padding: .75rem 1.25rem;
Expand All @@ -162,13 +172,11 @@ body.format-kickstart .form-control .fa-search {
}

@media (min-width: 576px) {
.mform > .form-group {
.format-kickstart .mform > .form-group {
margin-left: 1.5rem;
}
.format-kickstart .course-content > .card .card-body .card-title {
width: 66%;
}
}

body#page-course-format-kickstart-template.template-designer-format #fitem_id_coursetype {
display: none;
}
Expand All @@ -183,6 +191,7 @@ body#page-course-format-kickstart-template.template-designer-format #fitem_id_co
align-items: center;
}
.format-kickstart .course-content .kickstart-list-view .templates-block .card .card-body {
padding: 0;
display: flex;
align-items: center;
}
Expand Down Expand Up @@ -225,9 +234,7 @@ body#page-course-format-kickstart-template.template-designer-format #fitem_id_co
text-align: right;
border: 0;
background: none;
}
.format-kickstart .course-content .kickstart-list-view .templates-block .card .card-footer a {
margin-bottom: 10px;
padding: 0;
}
.format-kickstart .course-content .kickstart-list-view .templates-block .card .card-footer a.btn-outline-primary {
margin-left: 10px;
Expand All @@ -237,4 +244,30 @@ body#page-course-format-kickstart-template.template-designer-format #fitem_id_co
}
#page-admin-course-format-kickstart-templates .generaltable tbody tr td .singlebutton + .singlebutton {
margin: 10px 0;
}
}

/* Tile view */
.format-kickstart .course-content .kickstart-tile-view .templates-block .card {
padding: 0;
}

/* Content Migration from course block */
.format-kickstart.path-course-view .course-content .card {
padding: 15px;
}
/* Teacher profile block */
.format-kickstart.path-course-view .course-content .card .card-header,
.format-kickstart.path-course-view .course-content .card .card-header img {
border-radius: 50%;
}
/* End of Teacher profile block */
.format-kickstart.path-course-view .course-content .card .card-block a.btn {
margin-right: 10px;
}
.format-kickstart.path-course-view .input-group-append {
border: 0;
}
.format-kickstart.path-course-view .input-group-append button i.icon {
margin: 0;
}
/* End of Content Migration from course block */
52 changes: 52 additions & 0 deletions tests/behat/behat_format_kickstart.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,58 @@
*/
class behat_format_kickstart extends behat_base {


/**
* @Given /^I should see course format "(?P<element_string>(?:[^"]|\\")*)"$/
* @param string $format The course data
*/
public function i_should_see_define_course_format($format) {
global $CFG;
if ($CFG->branch <= '402') {
switch($format) {
case 'Single activity':
$format = 'Single activity format';
break;
case 'Social':
$format = 'Social format';
break;
case 'Custom sections':
$format = 'Topics format';
break;
case 'Weekly sections':
$format = 'Weekly format';
break;
}
}
$this->execute('behat_general::assert_page_contains_text', [$format]);
}


/**
* @Given /^I should not see course format "(?P<element_string>(?:[^"]|\\")*)"$/
* @param string $format The course data
*/
public function i_should_not_see_define_course_format($format) {
global $CFG;
if ($CFG->branch <= '402') {
switch($format) {
case 'Single activity':
$format = 'Single activity format';
break;
case 'Social':
$format = 'Social format';
break;
case 'Custom sections':
$format = 'Topics format';
break;
case 'Weekly sections':
$format = 'Weekly format';
break;
}
}
$this->execute('behat_general::assert_page_not_contains_text', [$format]);
}

/**
* Creates a new template with the provided table data matching template settings names with the desired values.
*
Expand Down
53 changes: 35 additions & 18 deletions tests/behat/format_kickstart_visibility.feature
Original file line number Diff line number Diff line change
Expand Up @@ -121,42 +121,54 @@ Feature: Check the kickstart course format features.
Scenario: Check the format plugin template access.
Given I log in as "admin"
Then I navigate to "Plugins > Course formats > Manage templates" in site administration
And I should see "Kickstart format"
And I should see "Single activity"
And I should see "Social"
And I should see "Custom sections"
And I should see "Weekly sections"
And I should see course format "Kickstart format"
And I should see course format "Single activity"
And I should see course format "Social"
And I should see course format "Custom sections"
And I should see course format "Weekly sections"
And I navigate to "Plugins > Course formats > Manage course formats" in site administration
And I click on "Disable" "link" in the "Single activity" "table_row"
# Todo:
#And I click on "Disable" "link" in the "Single activity" "table_row"
Then I click on "table.manageformattable tr:nth-child(3) td:nth-child(2)" "css_element"
#And I wait "5" seconds
Then I navigate to "Plugins > Course formats > Manage templates" in site administration
And I should not see "Single activity"
And I should not see course format "Single activity"
Then I am on "Course 1" course homepage
Then I should see "Course templates"
And I should not see "Single activity"
Then I should see "Custom sections"
And I click kickstart template ".use-template[data-templatename=\"Custom sections\"]"
And I should not see course format "Single activity"
Then I should see course format "Custom sections"
# Todo:
#And I click kickstart template ".use-template[data-templatename=\"Custom sections\"]"
Then I click on ".template-list .card-deck .card:nth-child(2) .card-footer a" "css_element"
#Then I wait "5" seconds
And I click on "Import" "button" in the ".modal" "css_element"
And I start watching to see if a new page loads
Then I should see "Course 1"
Then ".course-content .topics" "css_element" should exist
And I navigate to "Plugins > Course formats > Manage templates" in site administration
Then I click on "Edit" "button" in the "Custom sections" "table_row"
# TODo:
#Then I click on "Edit" "button" in the "Custom sections" "table_row"
Then I click on "table tr:nth-child(2) td:nth-child(6) button" "css_element"
And I should see "Edit template"
And I set the following fields to these values:
| Course layout | Show one section per page |
Then I press "Save changes"
Then I am on "Course 2" course homepage
And I click kickstart template ".use-template[data-templatename=\"Custom sections\"]"
# Todo:
#And I click kickstart template ".use-template[data-templatename=\"Custom sections\"]"
Then I click on ".template-list .card-deck .card:nth-child(2) .card-footer a" "css_element"

And I click on "Import" "button" in the ".modal" "css_element"
#And I start watching to see if a new page loads
Then I should see "Course 2"
Then ".course-content .topics" "css_element" should exist

Scenario: Check the visible course templates in different roles
Given I log in as "user1"
Then I am on "Course 1" course homepage
Then I should see "Course templates"
#Then I wait "5" seconds
# Todo:
And I click kickstart template ".use-template[data-templatename=\"Custom sections\"]"
#Then I click on ".template-list .card-deck .card:nth-child(2) .card-footer a" "css_element"
And I click on "Import" "button" in the ".modal" "css_element"
And I start watching to see if a new page loads
Then I should see "Course 1"
Expand All @@ -165,17 +177,22 @@ Feature: Check the kickstart course format features.
Scenario: Check the single activity format template
Given I log in as "admin"
And I am on "Course 3" course homepage with editing mode on
Then I should see "Course templates"
And I should see "Single activity"
And I click kickstart template ".use-template[data-templatename=\"Single activity\"]"
And I should see course format "Single activity"
# Todo:
#And I click kickstart template ".use-template[data-templatename=\"Single activity\"]"
Then I click on ".template-list .card-deck:nth-child(2) .card:nth-child(2) .card-footer a" "css_element"
Then I wait "10" seconds
And I click on "Import" "button" in the ".modal" "css_element"
And I start watching to see if a new page loads
Then I wait "10" seconds
And I set the following fields to these values:
| Forum name | Test Forum |
Then I press "Save and display"
Then I should see "There are no discussion topics yet in this forum"
And I navigate to "Plugins > Course formats > Manage templates" in site administration
Then I click on "Edit" "button" in the "Single activity" "table_row"
# Todo:
#Then I click on "Edit" "button" in the "Single activity" "table_row"
Then I click on "table tr:nth-child(4) td:nth-child(6) button" "css_element"
And I should see "Edit template"
And I set the following fields to these values:
| Type of activity | Page |
Expand Down

0 comments on commit 6d93e22

Please sign in to comment.