Merge branch 'MDL-75684-master' of https://github.com/sarjona/moodle

This commit is contained in:
Andrew Nicols 2022-10-24 21:50:45 +08:00
commit bc5252d8bf
39 changed files with 395 additions and 207 deletions

View File

@ -167,9 +167,8 @@ class user_picture implements renderable {
public $link = true;
/**
* @var int Size in pixels. Special values are (true/1 = 100px) and
* (false/0 = 35px)
* for backward compatibility.
* @var int Size in pixels. Special values are (true/1 = 100px) and (false/0 = 35px) for backward compatibility.
* Recommended values (supporting user initials too): 16, 35, 64 and 100.
*/
public $size = 35;

View File

@ -240,9 +240,9 @@ class template {
* @return pix_icon[] icon name => pix_icon
*/
protected function get_icons() {
$attrs = ['class' => 'iconsmall'];
$attrs = ['class' => 'iconsmall dataicon'];
return [
'edit' => new pix_icon('t/edit', get_string('edit'), '', $attrs),
'edit' => new pix_icon('t/editinline', get_string('edit'), '', $attrs),
'delete' => new pix_icon('t/delete', get_string('delete'), '', $attrs),
'more' => new pix_icon('t/preview', get_string('more', 'data'), '', $attrs),
'approve' => new pix_icon('t/approve', get_string('approve', 'data'), '', $attrs),
@ -503,7 +503,7 @@ class template {
if (!isset($user->picture)) {
$user = core_user::get_user($entry->userid);
}
return $OUTPUT->user_picture($user, ['courseid' => $cm->course]);
return $OUTPUT->user_picture($user, ['courseid' => $cm->course, 'size' => 64]);
}
/**
@ -551,7 +551,11 @@ class template {
* @return string the tag replacement
*/
protected function get_tag_timeadded_replacement(stdClass $entry, bool $canmanageentry): string {
return userdate($entry->timecreated);
return html_writer::tag(
'span',
userdate($entry->timecreated, get_string('strftimedatemonthabbr', 'langconfig')),
['title' => userdate($entry->timecreated)]
);
}
/**
@ -562,7 +566,11 @@ class template {
* @return string the tag replacement
*/
protected function get_tag_timemodified_replacement(stdClass $entry, bool $canmanageentry): string {
return userdate($entry->timemodified);
return html_writer::tag(
'span',
userdate($entry->timemodified, get_string('strftimedatemonthabbr', 'langconfig')),
['title' => userdate($entry->timecreated)]
);
}
/**

View File

@ -27,7 +27,6 @@ $string['action'] = 'Action';
$string['actionsmenu'] = 'Actions menu';
$string['add'] = 'Add entry';
$string['addcomment'] = 'Add comment';
$string['addedby'] = 'Added by';
$string['addentries'] = 'Add entries';
$string['addtemplate'] = 'Add entry template';
$string['advancedsearch'] = 'Advanced search';
@ -40,8 +39,8 @@ $string['areacontent'] = 'Fields';
$string['ascending'] = 'Ascending';
$string['asearchtemplate'] = 'Advanced search template';
$string['atmaxentry'] = 'You have entered the maximum number of entries allowed!';
$string['authorfirstname'] = 'Author first name';
$string['authorlastname'] = 'Author surname';
$string['authorfirstname'] = 'First name';
$string['authorlastname'] = 'Last name';
$string['autogenallforms'] = 'Generate all default templates';
$string['autolinkurl'] = 'Autolink the URL';
$string['availablefromdate'] = 'Available from';
@ -107,9 +106,8 @@ $string['data:viewrating'] = 'View the total rating you received';
$string['data:writeentry'] = 'Write entries';
$string['data:view'] = 'View database activity';
$string['date'] = 'Date';
$string['dateadded'] = 'Date added';
$string['dateentered'] = 'Date entered';
$string['datemodified'] = 'Date modified';
$string['datemodified'] = 'Last modified: ';
$string['defaultfielddelimiter'] = '(default is the comma character)';
$string['defaultfieldenclosure'] = '(default is none)';
$string['defaultsortfield'] = 'Default sort field';
@ -459,3 +457,4 @@ $string['nolisttemplate'] = 'List template is not yet defined';
$string['nosingletemplate'] = 'Single template is not yet defined';
$string['blank'] = 'Blank';
$string['savetemplate'] = 'Save template';
$string['addedby'] = 'Added by';

View File

@ -4,3 +4,4 @@ nosingletemplate,mod_data
nolisttemplate,mod_data
blank,mod_data
savetemplate,mod_data
addedby,mod_data

View File

@ -1,14 +1,14 @@
<div class="imagegallery-addentry">
<div class="form-group">
<label for="[[title#id]]">Title</label><br/>
<div class="font-weight-bold">Title</div>
[[title]]
</div>
<div class="form-group">
<label for="[[image#id]]">Image</label><br/>
<div class="font-weight-bold">Image</div>
[[image]]
</div>
<div class="form-group">
<label for="[[description#id]]">Description</label><br/>
<div class="font-weight-bold">Description</div>
[[description]]
</div>
</div>

View File

@ -1,11 +1,20 @@
<div class="imagegallery-asearch container">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
<div class="form-group col">
<label for="[[title#id]]">Title</label><br/>
<div class="font-weight-bold mb-2">First name</div>
##firstname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Last name</div>
##lastname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Title</div>
[[title]]
</div>
<div class="form-group col">
<label for="[[description#id]]">Description</label><br/>
<div class="font-weight-bold mb-2">Description</div>
[[description]]
</div>
</div>

View File

@ -1,13 +1,30 @@
<div class="imagegallery-rss">
<div class="d-flex">
<h3 class="card-title">[[title]]</h3>
</div>
<div class="imagegallery-single-body">
<div class="row singleentry-image">
<div class="col">[[image]]</div>
<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>

View File

@ -1,27 +1,31 @@
<div class="imagegallery-single">
<div class="d-flex">
<h3 class="card-title">[[title]]</h3>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div class="my-auto">##actionsmenu##</div>
<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">
<div class="col col-3 col-md-1"><strong>Author</strong></div>
<div class="col">##userpicture## ##user##</div>
</div>
<div class="row">
<div class="col col-3 col-md-1"><strong>Date added</strong></div>
<div class="col">##timeadded##</div>
</div>
<div class="row">
<div class="col col-3 col-md-1"><strong>Date modified</strong></div>
<div class="col">##timemodified##</div>
<div class="row singleentry-caption">
<div class="col">[[description]]</div>
</div>
<div class="row singleentry-image">
<div class="col">[[image]]</div>
</div>
<div class="row singleentry-caption">
<div class="col">[[description]]</div>
</div>
</div>
</div>

View File

@ -70,6 +70,8 @@ Feature: Users can use the Image gallery preset
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 press "Save settings"
Then I should see "First image"

View File

@ -1,10 +1,10 @@
<div class="journal-addentry">
<div class="form-group">
<label for="[[Title#id]]">Title</label><br/>
<div class="font-weight-bold">Title</div>
[[Title]]
</div>
<div class="form-group">
<label for="[[Content#id]]">Content</label><br/>
<div class="font-weight-bold">Content</div>
[[Content]]
</div>
</div>

View File

@ -1,11 +1,20 @@
<div class="journal-asearch container">
<div class="row row-cols-3">
<div class="form-group col">
<label for="[[title#id]]">Title</label><br/>
<div class="font-weight-bold mb-2">First name</div>
##firstname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Last name</div>
##lastname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Title</div>
[[title]]
</div>
<div class="form-group col">
<label for="[[content#id]]">Content</label><br/>
<div class="font-weight-bold mb-2">Content</div>
[[content]]
</div>
</div>

View File

@ -1,12 +1,28 @@
<div class="card my-3">
<div class="card-body">
<div class="d-flex">
<h3 class="card-title">[[Title]]</h3>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div class="my-auto">##actionsmenu##</div>
<div class="row">
<div class="col-4 col-sm-8 my-auto">
<h2 class="card-title"><a href="##moreurl##">[[Title]]</a></h2>
</div>
<div class="col-auto ml-auto d-flex flex-row-reverse">
<div>##actionsmenu##</div>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
<div class="card-text truncate-overflow mb-4">[[Content]]</div>
<p class="card-text">##userpicture## ##user##</p>
<p class="card-text">##timeadded##</p>
<div class="row my-4 mr-1">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-4 col-md-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-8 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">Last edited:</span> ##timemodified##
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,21 +1,27 @@
<div class="journal-single">
<div class="d-flex">
<h3 class="card-title">[[Title]]</h3>
</div>
<div class="journal-single-body">
<div class="row">
<div class="col col-3 col-md-1"><strong>Author</strong></div>
<div class="col">##userpicture## ##user##</div>
</div>
<div class="row">
<div class="col col-3 col-md-1"><strong>Status</strong></div>
<div class="col">[[Content status]]</div>
</div>
<div class="row singleentry-content">
<div class="col">
<h4>Description</h4>
[[Content]]
<div class="journal-rss my-5">
<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="journal-single-body my-5">
<div class="singleentry-content">
[[Content]]
</div>
</div>
</div>

View File

@ -1,23 +1,28 @@
<div class="journal-single my-5">
<div class="d-flex">
<h3 class="card-title">[[Title]]</h3>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div class="my-auto">##actionsmenu##</div>
</div>
<div class="journal-single-body my-5">
<div class="row">
<div class="col-3 col-md-1"><strong>Author</strong></div>
<div class="col">##userpicture## ##user##</div>
</div>
<div class="row">
<div class="col-3 col-md-1"><strong>Date</strong></div>
<div class="col">##timeadded##</div>
</div>
<div class="row singleentry-content">
<div class="col">
<h4 class="my-5">Reflections</h4>
[[Content]]
<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="journal-single-body my-5">
<div class="singleentry-content">
[[Content]]
</div>
</div>
</div>

View File

@ -56,6 +56,8 @@ Feature: Users can use the Journal preset
Given I am on the "Student reflections" "data activity" page logged in as student1
And "Reflection created by student" "text" should appear before "Reflection created by teacher" "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 "student"
And I press "Save settings"
Then I should see "Reflection created by student"

View File

@ -1,18 +1,18 @@
<div class="proposals-addentry">
<div class="form-group">
<label for="[[Title#id]]">Title</label><br/>
<div class="font-weight-bold">Title</div>
[[Title]]
</div>
<div class="form-group">
<label for="[[Status#id]]">Status</label><br/>
<div class="font-weight-bold">Status</div>
[[Status]]
</div>
<div class="form-group">
<label for="[[Summary#id]]">Summary</label><br/>
<div class="font-weight-bold">Summary</div>
[[Summary]]
</div>
<div class="form-group">
<label for="[[Content#id]]">Content</label><br/>
<div class="font-weight-bold">Content</div>
[[Content]]
</div>
</div>

View File

@ -1,19 +1,28 @@
<div class="proposals-asearch container">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
<div class="form-group col">
<label for="[[Title#id]]">Title</label><br/>
<div class="font-weight-bold mb-2">First name</div>
##firstname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Last name</div>
##lastname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Title</div>
[[Title]]
</div>
<div class="form-group col">
<label for="[[Status#id]]">Status</label><br/>
<div class="font-weight-bold mb-2">Status</div>
[[Status]]
</div>
<div class="form-group col">
<label for="[[Summary#id]]">Summary</label><br/>
<div class="font-weight-bold mb-2">Summary</div>
[[Summary]]
</div>
<div class="form-group col">
<label for="[[Content#id]]">Content</label><br/>
<div class="font-weight-bold mb-2">Content</div>
[[Content]]
</div>
</div>

View File

@ -2,16 +2,15 @@
<div class="card-header" role="tab" id="entry-##id##">
<div>
<div class="row align-middle">
<div class="col-4 my-auto">
<div class="col-4 col-sm-8 my-auto">
<a data-toggle="collapse" data-parent="#proposals-list" href="#collapseentry-##id##" aria-expanded="true" aria-controls="collapseentry-##id##" class="d-block">
<i class="fa fa-chevron-down"></i> [[Title]]
</a>
</div>
<div class="col-3 push my-auto">[[Status]]</div>
<div class="col-2 my-auto">##userpicture## ##user##</div>
<div class="col-3 d-flex justify-content-end">
<div class="my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div class="ml-auto my-auto">##actionsmenu##</div>
<div class="col-4 col-sm-2 ml-auto my-auto">##userpicture## ##user##</div>
<div class="col-4 col-sm-2 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>

View File

@ -1,24 +1,38 @@
<div class="proposals-single">
<div class="d-flex">
<h3 class="card-title">[[Title]]</h3>
</div>
<div class="proposals-single-body">
<div class="row">
<div class="col col-3 col-md-1"><strong>Author</strong></div>
<div class="col">##userpicture## ##user##</div>
<div class="proposals-rss my-5">
<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 class="row">
<div class="col col-3 col-md-1"><strong>Status</strong></div>
</div>
<hr/>
<h2 class="card-title mt-4">[[Title]]</h2>
<div class="proposals-single-body">
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Status</strong></div>
<div class="col">[[Status]]</div>
</div>
<div class="row singleentry-summary">
<div class="col">
<h4>Summary</h4>
<h3 class="my-5">Summary</h3>
[[Summary]]
</div>
</div> <div class="row singleentry-content">
</div>
<div class="row singleentry-content">
<div class="col">
<h4>Description</h4>
<h3 class="my-5">Content</h3>
[[Content]]
</div>
</div>

View File

@ -1,35 +1,41 @@
<div class="proposals-single my-5">
<div class="d-flex">
<h3 class="card-title">[[Title]]</h3>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div class="my-auto">##actionsmenu##</div>
<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="proposals-single-body">
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Author</strong></div>
<div class="col">##userpicture## ##user##</div>
</div>
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Status</strong></div>
<div class="col">[[Status]]</div>
</div>
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Date added</strong></div>
<div class="col">##timeadded##</div>
</div>
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Date modified</strong></div>
<div class="col">##timemodified##</div>
<div class="row singleentry-status">
<div class="col">
<h3 class="my-5">Status</h3>
[[Status]]
</div>
</div>
<div class="row singleentry-summary">
<div class="col">
<h4 class="my-5">Summary</h4>
<h3 class="my-5">Summary</h3>
[[Summary]]
</div>
</div>
<div class="row singleentry-content">
<div class="col">
<h4 class="my-5">Content</h4>
<h3 class="my-5">Content</h3>
[[Content]]
</div>
</div>

View File

@ -32,11 +32,9 @@ Feature: Users can use the Proposals preset
Scenario: Proposals. Users view entries
When I am on the "Student projects" "data activity" page logged in as student1
Then I should see "Project created by student"
And I should see "Pending"
And "Summary 1" "text" should exist
And "Actions" "icon" should exist in the "#proposals-list" "css_element"
And I should see "Project created by teacher"
And I should see "Rejected"
And "Summary 2" "text" should exist
And I click on "Project created by student" "link"
And I click on "Project created by teacher" "link"
@ -72,6 +70,8 @@ Feature: Users can use the Proposals preset
Given I am on the "Student projects" "data activity" page logged in as student1
And "Project created by student" "text" should appear before "Project created by teacher" "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 "student"
And I press "Save settings"
Then I should see "Project created by student"

View File

@ -1,26 +1,26 @@
<div class="resources-addentry">
<div class="form-group">
<label for="[[Title#id]]">Title</label><br/>
<div class="font-weight-bold">Title</div>
[[Title]]
</div>
<div class="form-group">
<label for="[[Author#id]]">Author</label><br/>
<div class="font-weight-bold">Author of resource</div>
[[Author]]
</div>
<div class="form-group">
<label for="[[Cover#id]]">Cover</label><br/>
<div class="font-weight-bold">Cover</div>
[[Cover]]
</div>
<div class="form-group">
<label for="[[Description#id]]">Description</label><br/>
<div class="font-weight-bold">Content</div>
[[Description]]
</div>
<div class="form-group">
<label for="[[Web link#id]]">Web link</label><br/>
<div class="font-weight-bold">Web link</div>
[[Web link]]
</div>
<div class="form-group">
<label for="[[Type#id]]">Type</label><br/>
<div class="font-weight-bold">Type</div>
[[Type]]
</div>
</div>

View File

@ -1,23 +1,32 @@
<div class="resources-asearch container">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
<div class="form-group col">
<label for="[[Title#id]]">Title</label><br/>
<div class="font-weight-bold mb-2">First name</div>
##firstname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Last name</div>
##lastname##
</div>
<div class="form-group col">
<div class="font-weight-bold mb-2">Title</div>
[[Title]]
</div>
<div class="form-group col">
<label for="[[Author#id]]">Author</label><br/>
<div class="font-weight-bold mb-2">Author of resource</div>
[[Author]]
</div>
<div class="form-group col">
<label for="[[Description#id]]">Description</label><br/>
<div class="font-weight-bold mb-2">Content</div>
[[Description]]
</div>
<div class="form-group col">
<label for="[[Web link#id]]">Link</label><br/>
<div class="font-weight-bold mb-2">Link</div>
[[Web link]]
</div>
<div class="form-group col">
<label for="[[Type#id]]">Type</label><br/>
<div class="font-weight-bold mb-2">Type</div>
[[Type]]
</div>
</div>

View File

@ -1,7 +1,8 @@
<tr>
<th scope="row"><a href="##moreurl##">[[Title]]</a></th>
<td>[[Type]]</td>
<td>[[Author]]</td>
<td class="d-none d-md-table-cell">[[Type]]</td>
<td class="d-none d-md-table-cell">[[Author]]</td>
<td>[[Web link]]</td>
<td><div class="##approvalstatusclass##">##approvalstatus##</div></td>
<td>##actionsmenu##</td>
</tr>

View File

@ -2,10 +2,11 @@
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Type</th>
<th scope="col">Author</th>
<th class="d-none d-md-table-cell" scope="col">Type</th>
<th class="d-none d-md-table-cell" scope="col">Author of resource</th>
<th scope="col">Link</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>

View File

@ -1,10 +1,29 @@
<div class="resources-single my-5">
<h3 class="card-title">[[Title]]</h3>
<div class="resources-rss my-5">
<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="resources-single-body my-5">
<div class="d-flex">
<div class="single-entry-header w-100">
<div class="d-flex flex-column flex-md-row">
<div class="single-entry-header w-100 pr-2">
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Author</strong></div>
<div class="col-3 col-md-1"><strong>Author of resource</strong></div>
<div class="col-9 col-md-11">[[Author]]</div>
</div>
<div class="row my-3">
@ -21,7 +40,7 @@
<div class="row singleentry-content">
<div class="col">
<h4 class="my-5">Description</h4>
<h3 class="my-5">Content</h3>
[[Description]]
</div>
</div>

View File

@ -1,22 +1,39 @@
<div class="resources-single my-5">
<div class="d-flex">
<h3 class="card-title">[[Title]]</h3>
<div class="ml-auto">##actionsmenu##</div>
<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="resources-single-body my-5">
<div class="d-flex flex-column flex-md-row">
<div class="single-entry-header w-100 pr-2">
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Author</strong></div>
<div class="col-9 col-md-11">[[Author]]</div>
<div class="col-3 col-md-2 font-weight-bold">Author of resource</div>
<div class="col-9 col-md-auto">[[Author]]</div>
</div>
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Type</strong></div>
<div class="col-9 col-md-11">[[Type]]</div>
<div class="col-3 col-md-2 font-weight-bold">Type</div>
<div class="col-9 col-md-auto">[[Type]]</div>
</div>
<div class="row my-3">
<div class="col-3 col-md-1"><strong>Link</strong></div>
<div class="col-9 col-md-11">[[Web link]]</div>
<div class="col-3 col-md-2 font-weight-bold">Link</div>
<div class="col-9 col-md-auto">[[Web link]]</div>
</div>
</div>
<div class="img-wrapper">[[Cover]]</div>
@ -24,7 +41,7 @@
<div class="row singleentry-content">
<div class="col">
<h4 class="my-5">Description</h4>
<h3 class="my-5">Content</h3>
[[Description]]
</div>
</div>

View File

@ -74,6 +74,8 @@ Feature: Users can use the Resources preset
Given I am on the "Student resources" "data activity" page logged in as student1
And "My favourite book" "text" should appear before "My favourite podcast" "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 "book"
And I press "Save settings"
Then I should see "My favourite book"

View File

@ -162,6 +162,17 @@
max-width: 100%;
}
/* Date information displayed in templates/presets */
.data-timeinfo {
color: var(gray);
}
/* Legacy icons */
.dataicon,
.portfolio-add-icon {
color: var(--dark);
}
/* Preset preview styles */
#page-mod-data-preset .nopreview {
border: 1px solid var(--secondary);

View File

@ -36,13 +36,13 @@
<div id="defaulttemplate-addentry">
{{#fields}}
<div class="form-group pt-3">
<span class="font-weight-bold"><label for="[[{{fieldname}}#id]]">{{fieldname}}</label><br/></span>
<div class="font-weight-bold">{{fieldname}}</div>
{{{fieldcontent}}}
</div>
{{/fields}}
{{#tags}}
<div class="form-group pt-3">
<span class="font-weight-bold">{{#str}}tags{{/str}}<br/></span>
<div class="font-weight-bold">{{#str}}tags{{/str}}</div>
{{{.}}}
</div>
{{/tags}}

View File

@ -36,24 +36,24 @@
<div class="defaulttemplate-asearch container">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
<div class="form-group col">
<span class="font-weight-bold">{{#str}}authorfirstname, mod_data{{/str}}<br/></span>
<div class="font-weight-bold mb-2">{{#str}}authorfirstname, mod_data{{/str}}</div>
##firstname##
</div>
<div class="form-group col">
<span class="font-weight-bold">{{#str}}authorlastname, mod_data{{/str}}<br/></span>
<div class="font-weight-bold mb-2">{{#str}}authorlastname, mod_data{{/str}}</div>
##lastname##
</div>
{{#fields}}
<div class="form-group col">
<span class="font-weight-bold"><label for="[[{{fieldname}}#id]]">{{fieldname}}</label><br/></span>
<div class="font-weight-bold mb-2">{{fieldname}}</div>
{{fieldcontent}}
</div>
{{/fields}}
{{#tags}}
<div class="form-group col">
<span class="font-weight-bold">{{#str}}tags{{/str}}<br/></span>
<div class="font-weight-bold mb-2">{{#str}}tags{{/str}}</div>
{{.}}
</div>
{{/tags}}

View File

@ -34,10 +34,25 @@
}
}}
<div class="defaulttemplate-listentry my-5 p-5 card">
<div class="d-flex">
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div>##actionsmenu##</div>
<div class="row my-6">
<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 ">{{#str}}datemodified, mod_data{{/str}}</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/>
<div class="defaulttemplate-list-body">
{{#fields}}
<div class="row my-3 align-items-start justify-content-start">

View File

@ -34,24 +34,27 @@
}
}}
<div id="defaulttemplate-single" class="my-5">
<div class="d-flex mt-n6">
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
<div>##actionsmenu##</div>
</div>
<div class="defaulttemplate-single-body my-5">
<div class="mt-4">
<span class="font-weight-bold">{{#str}}addedby, mod_data{{/str}}</span>
<p class="mt-2">##userpicture## ##user##</p>
</div>
<div class="mt-4">
<span class="font-weight-bold">{{#str}}dateadded, mod_data{{/str}}</span>
<p class="mt-2">##timeadded##</p>
</div>
<div class="mt-4">
<span class="font-weight-bold">{{#str}}datemodified, mod_data{{/str}}</span>
<p class="mt-2">##timemodified##</p>
<div class="row my-6">
<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 ">{{#str}}datemodified, mod_data{{/str}}</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/>
<div class="my-6">
{{#fields}}
<div class="mt-4">
<span class="font-weight-bold">{{fieldname}}</span>
@ -64,5 +67,6 @@
<p class="mt-2">{{.}}</p>
</div>
{{/tags}}
</div>
</div>
</div>

View File

@ -121,12 +121,12 @@ Feature: Users can view and search database entries
And I log out
When I am on the "Test database name" "data activity" page logged in as teacher1
And I click on "Advanced search" "checkbox"
And I set the field "Author first name" to "Bob"
And I set the field "First name" to "Bob"
And I press "Save settings"
Then I should see "Student entry 1"
And I should not see "Student entry 2"
And I set the field "Author first name" to ""
And I set the field "Author surname" to "2"
And I set the field "First name" to ""
And I set the field "Last name" to "2"
And I press "Save settings"
And I should not see "Student entry 1"
And I should see "Student entry 2"

View File

@ -146,8 +146,8 @@ class template_test extends \advanced_testcase {
// Some cooked variables for the regular expression.
$replace = [
'{authorfullname}' => fullname($author),
'{timeadded}' => userdate($entry->timecreated),
'{timemodified}' => userdate($entry->timemodified),
'{timeadded}' => userdate($entry->timecreated, get_string('strftimedatemonthabbr', 'langconfig')),
'{timemodified}' => userdate($entry->timemodified, get_string('strftimedatemonthabbr', 'langconfig')),
'{fieldid}' => $field->field->id,
'{entryid}' => $entry->id,
'{cmid}' => $cm->id,
@ -256,12 +256,12 @@ class template_test extends \advanced_testcase {
],
'Teacher timeadded tag' => [
'templatecontent' => 'Some ##timeadded## tag',
'expected' => '|Some {timeadded} tag|',
'expected' => '|Some <span.*>{timeadded}</span> tag|',
'rolename' => 'editingteacher',
],
'Teacher timemodified tag' => [
'templatecontent' => 'Some ##timemodified## tag',
'expected' => '|Some {timemodified} tag|',
'expected' => '|Some <span.*>{timemodified}</span> tag|',
'rolename' => 'editingteacher',
],
'Teacher approve tag approved entry' => [
@ -552,12 +552,12 @@ class template_test extends \advanced_testcase {
],
'Student timeadded tag' => [
'templatecontent' => 'Some ##timeadded## tag',
'expected' => '|Some {timeadded} tag|',
'expected' => '|Some <span.*>{timeadded}</span> tag|',
'rolename' => 'student',
],
'Student timemodified tag' => [
'templatecontent' => 'Some ##timemodified## tag',
'expected' => '|Some {timemodified} tag|',
'expected' => '|Some <span.*>{timemodified}</span> tag|',
'rolename' => 'student',
],
'Student approve tag approved entry' => [

View File

@ -397,12 +397,6 @@ if ($showactivity) {
$actionbar = new \mod_data\output\action_bar($data->id, $pageurl);
echo $actionbar->get_view_action_bar($hasrecords);
if ($mode === 'single') {
echo $OUTPUT->heading(get_string('singleview', 'mod_data'), 2, 'mb-4');
} else {
echo $OUTPUT->heading(get_string('listview', 'mod_data'), 2, 'mb-4');
}
if ($groupmode) {
$returnurl = new moodle_url('/mod/data/view.php', ['d' => $data->id, 'mode' => $mode, 'search' => s($search),
'sort' => s($sort), 'order' => s($order)]);

View File

@ -1177,6 +1177,10 @@ div#dock {
width: 35px;
height: 35px;
}
&.size-64 {
width: 64px;
height: 64px;
}
&.size-100 {
width: 100px;
height: 100px;

View File

@ -18595,6 +18595,9 @@ div#dock {
.userinitials.size-35 {
width: 35px;
height: 35px; }
.userinitials.size-64 {
width: 64px;
height: 64px; }
.userinitials.size-100 {
width: 100px;
height: 100px;

View File

@ -18595,6 +18595,9 @@ div#dock {
.userinitials.size-35 {
width: 35px;
height: 35px; }
.userinitials.size-64 {
width: 64px;
height: 64px; }
.userinitials.size-100 {
width: 100px;
height: 100px;