first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,15 @@
<div class="imagegallery-addentry">
<div class="mb-3">
<div class="font-weight-bold">[[title#name]]</div>
[[title]]
</div>
<div class="mb-3">
<div class="font-weight-bold">[[image#name]]</div>
[[image]]
</div>
<div class="mb-3">
<div class="font-weight-bold">[[description#name]]</div>
[[description]]
</div>
##otherfields##
</div>
@@ -0,0 +1,21 @@
<div class="imagegallery-asearch container">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
<div class="mb-3 col">
<div class="font-weight-bold mb-2">First name</div>
##firstname##
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">Last name</div>
##lastname##
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">[[title#name]]</div>
[[title]]
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">[[description#name]]</div>
[[description]]
</div>
</div>
</div>
@@ -0,0 +1,46 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy provider implementation for datapreset_imagegallery.
*
* @package datapreset_imagegallery
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace datapreset_imagegallery\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy provider implementation for datapreset_imagegallery.
*
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason(): string {
return 'privacy:metadata';
}
}
@@ -0,0 +1,38 @@
/****** List View CSS ******/
#imagegallery-list img.list_picture {
width: 100%;
height: 15vw;
object-fit: cover;
}
#imagegallery-list .card {
margin-top: 30px;
margin-bottom: 15px;
}
.imagegallery-listentry .card-title {
font-size: larger;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
/***** Single View CSS *****/
.imagegallery-single-body .col {
padding: 10px 15px;
}
.imagegallery-single img.list_picture {
max-width: 100%;
height: auto;
}
/***** Add entry CSS *****/
.imagegallery-addentry .form-group label,
.imagegallery-asearch .form-group label {
font-weight: bold;
padding-top: 20px;
}
@@ -0,0 +1,29 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'datapreset_imagegallery', language 'en', branch 'MOODLE_20_STABLE'
*
* @package datapreset_imagegallery
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['modulename'] = 'Image gallery';
$string['modulename_help'] = 'Use this preset to collect images.';
$string['pluginname'] = 'Image gallery';
$string['privacy:metadata'] = 'The Image gallery plugin does not store any personal data.';
@@ -0,0 +1,19 @@
<div class="col mb-4">
<div class="imagegallery-listentry card">
<div class="img-wrapper">
[[image]]
</div>
<div class="card-body">
<div class="card-title" style="transform: rotate(0);">
[[title]]
<a href="##moreurl##" class="stretched-link"></a>
</div>
<div class="d-flex align-items-start">
<div class="card-footer border-0 bg-white ml-auto d-flex" style="position: relative;">
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div>##actionsmenu##</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1 @@
</div>
@@ -0,0 +1 @@
<div id="imagegallery-list" class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4" role="list">
+45
View File
@@ -0,0 +1,45 @@
<preset>
<settings>
<intro></intro>
<comments>0</comments>
<ratings>0</ratings>
<participants>3</participants>
<requiredentries>0</requiredentries>
<requiredentriestoview>0</requiredentriestoview>
<maxentries>0</maxentries>
<rssarticles>0</rssarticles>
<approval>0</approval>
<scale>0</scale>
<assessed>0</assessed>
<assessedpublic></assessedpublic>
<defaultsort>0</defaultsort>
<defaultsortdir>0</defaultsortdir>
<editany>0</editany>
</settings>
<field>
<type>picture</type>
<name>image</name>
<param1></param1>
<param2></param2>
<param3>2097152</param3>
<param4></param4>
</field>
<field>
<type>text</type>
<name>title</name>
</field>
<field>
<type>textarea</type>
<name>description</name>
<required>0</required>
<param2>60</param2>
<param3>10</param3>
<param4>1</param4>
<param5>0</param5>
</field>
</preset>
@@ -0,0 +1,30 @@
<div class="imagegallery-rss">
<div class="row my-4">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-4 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">Last edited:</span> ##timemodified##
</div>
<div class="col-4 col-md-3 ml-auto align-self-center d-flex flex-row-reverse">
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
</div>
</div>
<hr/>
<h2 class="card-title mt-4">[[title]]</h2>
<div class="imagegallery-single-body">
<div class="row singleentry-caption">
<div class="col">[[description]]</div>
</div>
<div class="row singleentry-image">
<div class="col">[[image]]</div>
</div>
</div>
</div>
@@ -0,0 +1 @@
[[title]]
@@ -0,0 +1,32 @@
<div class="imagegallery-single">
<div class="row my-4">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-4 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">Last edited:</span> ##timemodified##
</div>
<div class="col-4 col-md-3 ml-auto align-self-center d-flex flex-row-reverse">
<div>##actionsmenu##</div>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
</div>
</div>
<hr/>
<h2 class="card-title mt-4">[[title]]</h2>
<div class="imagegallery-single-body">
<div class="row singleentry-caption">
<div class="col">[[description]]</div>
</div>
<div class="row singleentry-image">
<div class="col">[[image]]</div>
</div>
##otherfields##
</div>
</div>
@@ -0,0 +1,118 @@
@mod @mod_data @datapreset @data_preset_imagegallery
Feature: Users can use the Image gallery preset
In order to create an Image gallery database
As a user
I need to apply and use the Image gallery preset
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Alice | Student | student1@example.com |
| teacher1 | Pau | Teacher | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| data | Mountain landscapes | Database intro | C1 | data1 |
And I am on the "Mountain landscapes" "data activity" page logged in as teacher1
And I follow "Presets"
And I click on "fullname" "radio" in the "Image gallery" "table_row"
And I click on "Use this preset" "button"
And the following "mod_data > entries" exist:
| database | user | title | description | image |
| data1 | student1 | First image | This is the description text for image 1 | first.png |
| data1 | teacher1 | Second image | And this is the description text for image 2 | second.png |
@javascript
Scenario: Users view entries
When I am on the "Mountain landscapes" "data activity" page logged in as student1
Then I should see "First image"
And I should not see "This is the description text for image 1"
And I should not see "first.png"
And I should not see "Alice Student" in the "#imagegallery-list" "css_element"
And "//a/child::img[contains(@src, 'first.png')]" "xpath_element" should exist
And "Actions" "icon" should exist in the "#imagegallery-list" "css_element"
And I should see "Second image"
And I should not see "And this is the description text for image 2"
And I should not see "second.png"
And I should not see "Pau Teacher"
And "//a/child::img[contains(@src, 'second.png')]" "xpath_element" should exist
# Single view.
And I select "Single view" from the "jump" singleselect
And I should see "First image"
And I should see "Alice Student" in the ".imagegallery-single" "css_element"
And I should see "This is the description text for image 1"
And "//a/child::img[contains(@src, 'first.png')]" "xpath_element" should exist
And "Actions" "icon" should exist in the ".imagegallery-single" "css_element"
And I should not see "Second image"
And I should not see "And this is the description text for image 2"
And I should not see "Pau Teacher"
And "//a/child::img[contains(@src, 'second.png')]" "xpath_element" should not exist
And I follow "Next"
And I should see "Second image"
And I should see "Pau Teacher"
And I should see "And this is the description text for image 2"
And "//a/child::img[contains(@src, 'second.png')]" "xpath_element" should exist
# This student can't edit or delete this entry, so the Actions menu shouldn't be displayed.
And "Actions" "icon" should not exist in the ".imagegallery-single" "css_element"
And I should not see "First image"
And I should not see "Alice Student" in the ".imagegallery-single" "css_element"
And I should not see "This is the description text for image 1"
And "//a/child::img[contains(@src, 'first.png')]" "xpath_element" should not exist
@javascript
Scenario: Users can search entries
Given I am on the "Mountain landscapes" "data activity" page logged in as student1
And "First image" "text" should appear before "Second image" "text"
When I click on "Advanced search" "checkbox"
And I should see "First name"
And I should see "Last name"
And I set the field "title" to "First image"
And I click on "Save settings" "button" in the "data_adv_form" "region"
Then I should see "First image"
And I should not see "Second image"
But I set the field "title" to "image"
And I set the field "Order" to "Descending"
And I click on "Save settings" "button" in the "data_adv_form" "region"
And "Second image" "text" should appear before "First image" "text"
@javascript
Scenario: Users can add entries
Given I am on the "Mountain landscapes" "data activity" page logged in as student1
When I press "Add entry"
And I set the field "title" to "New image"
And I set the field "description" to "This is the description for the new image."
And I press "Save"
Then I should see "New image"
And I should see "This is the description for the new image."
@javascript
Scenario: Image gallery. Renaming a field should affect the template
Given I am on the "Mountain landscapes" "data activity" page logged in as teacher1
And I navigate to "Fields" in current page administration
And I open the action menu in "title" "table_row"
And I choose "Edit" in the open action menu
And I set the field "Field name" to "Edited field name"
And I press "Save"
And I should see "Field updated"
When I navigate to "Database" in current page administration
Then I click on "Advanced search" "checkbox"
And I should see "Edited field name"
And I click on "Add entry" "button"
And I should see "Edited field name"
@javascript
Scenario: Image gallery. Has otherfields tag
Given the following "mod_data > fields" exist:
| database | type | name | description |
| data1 | text | Extra field | Test field description |
And I am on the "Mountain landscapes" "data activity" page logged in as teacher1
When I select "Single view" from the "jump" singleselect
Then I should see "Extra field"
And I click on "Add entry" "button"
And I should see "Extra field"
+28
View File
@@ -0,0 +1,28 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package datapreset
* @subpackage imagegallery
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2024042200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2024041600; // Requires this Moodle version.
$plugin->component = 'datapreset_imagegallery'; // Full name of the plugin (used for diagnostics)