Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.9.11
-
MOODLE_19_STABLE
Description
Currently there are 5 distinct view templates (list, single, asearch, add, rss) however users may want to omit some of these templates (e.g. omit single or asearch) or have more than one view of a certain type (e.g. two types of list). The current templates approach makes this practically impossible for the average user.
Suggested improvement:
A generic templates structure which will allow the user to determine and design the activity's available views according to one's own preferences. So, for instance, one may want to offer students to select from 3 different list views and omit the single and search views. The template placeholders may be defaulted to the list, single, search etc. but the single and search could be override and redefined as lists. Views could be switch to by a dropdown list in the main view tab.
Template Settings:
- View mode: yes/no
- Edit mode: yes/no
- Max entries per page: n
- Search: yes/no
- RSS: yes/no
- RSS title: string
- Name: string
- Entry template: string
- List header template: string
- List footer template: string
View mode - determines whether the view can be displayed in view (non-edit) mode. An advanced option could limit to certain roles. With this option set to 'no' the template won't be available in view mode (and if edit mode is set to 'no' the template won't be available at all. Possible scenario: I design a list view for students which displays the entries without a delete option and another list view for myself with the delete option. The latter is set disable view mode (and disable edit mode) so that students cannot use it. If I want to delete certain entries I can switch to templates, enable the view mode of this list view, view the list and delete the entries and then deactivate the view mode.
Edit mode - determines whether the view can be displayed in edit mode. The main motivation here is to allow quick editing of many records in a list view. Another motivation is using only one template for adding/editing/viewing of a single entry which is what an average user who works simply with default templates will need anyway.
The other options are self explanatory.
The current templates could be mapped to the proposed scheme in the following way.
List view template:
- View mode: yes
- Edit mode: no
- Max entries per page:
- Advanced Search: no
- RSS: no
- Name: 'List view'
- Entry template: '...'
- List header template: ''
- List footer template: ''
Single view template:
- View mode: yes
- Edit mode: no
- Max entries per page: 1
- Advanced Search: no
- RSS: no
- Name: 'Single view'
- Entry template: '...'
- List header template: null
- List footer template: null
Add entry view template:
- View mode: no
- Edit mode: yes
- Max entries per page: 1
- Advanced Search: no
- RSS: no
- Name: 'Add/Edit entry'
- Entry template: '...'
- List header template: null
- List footer template: null
And so on.
Comments are welcome.