Commit 2c7aca7d authored by Nigel McNie's avatar Nigel McNie
Browse files

A few improvements to create view step three:

* Now usernames/group names are linked to profile pages/group pages respectively.
* 'Add tutors' button is not displayed for groups that aren't controlled.
* start/stop date/time inputs are now in their own fieldset with a (hopefully!) helpful description. The fieldset also helps explain the page layout when many access rules are added.
parent cc46194a
......@@ -136,8 +136,9 @@ $string['deleteviewconfirm'] = 'Do you really want to delete this view? It canno
$string['editaccesspagedescription'] = '<p>You can control who can see your view, and when they can do so. By default, only you can see your views.</p>
<p>You can grant access to your view to your friends, all logged in users, or only to the certain users and groups you choose.</p>
<p>All dates are optional. If you wish, you can use them to restrict the time in which people can see your view.</p>';
$string['startdatedescription'] = 'If set, no one can access your view before this time, even if you have given them access to your view in some other way.';
$string['stopdatedescription'] = 'If set, no one can access your view after this time, even if you have given them access to your view in some other way.';
$string['overridingstartstopdate'] = 'Overriding Start/Stop Dates';
$string['overridingstartstopdatesdescription'] = 'If you want, you can set an overriding start and/or stop date. Other people will not be able to see your view before the start date and after the end date, regardless of any other access you have granted.';
$string['emptylabel'] = 'Click here to enter text for this label';
$string['empty_block'] = 'Select an artefact from the tree on the left to place here';
......
......@@ -12,7 +12,7 @@
<thead>
<tr>
<th></th>
<th>{{str tag=name}}</th>
<th class="fullwidth">{{str tag=name}}</th>
<th></th>
</tr>
</thead>
......@@ -204,22 +204,26 @@ searchTable.rowfunction = function(rowdata, rownumber, globaldata) {
});
appendChildNodes(buttonTD, addButton);
var profileIcon, tutorAddButton = null;
var identityNodes = [], profileIcon = null, tutorAddButton = null;
if (rowdata.type == 'user') {
profileIcon = IMG({'src': config.wwwroot + 'thumb.php?type=profileicon&maxwidth=40&maxheight=40&id=' + rowdata.id});
identityNodes.push(A({'href': config.wwwroot + 'user/view.php?id=' + rowdata.id}, rowdata.name));
}
else if (rowdata.type == 'group') {
tutorAddButton = BUTTON({'type': 'button', 'class': 'button'}, '{{str tag=addtutors section=view}}');
connect(tutorAddButton, 'onclick', function() {
rowdata.tutoronly = 1;
appendChildNodes('accesslist', renderAccessListItem(rowdata));
});
appendChildNodes(buttonTD, tutorAddButton);
if (rowdata.jointype == 'controlled') {
tutorAddButton = BUTTON({'type': 'button', 'class': 'button'}, '{{str tag=addtutors section=view}}');
connect(tutorAddButton, 'onclick', function() {
rowdata.tutoronly = 1;
appendChildNodes('accesslist', renderAccessListItem(rowdata));
});
appendChildNodes(buttonTD, tutorAddButton);
}
identityNodes.push(A({'href': config.wwwroot + 'group/view.php?id=' + rowdata.id}, rowdata.name));
}
return TR({'class': 'r' + (rownumber % 2)},
buttonTD,
TD({'class': 'fullwidth'}, rowdata.name),
TD({'class': 'fullwidth', 'style': 'vertical-align: middle;'}, identityNodes),
TD({'class': 'center', 'style': 'width:40px'}, profileIcon)
);
}
......
......@@ -81,27 +81,35 @@ $form = array(
'type' => 'viewacl',
'defaultvalue' => isset($view) ? $view->get_access() : null
),
'startdate' => array(
'type' => 'calendar',
'title' => get_string('startdate','view'),
'description' => get_string('startdatedescription', 'view'),
'defaultvalue' => isset($view) ? strtotime($view->get('startdate')) : null,
'caloptions' => array(
'showsTime' => true,
'ifFormat' => '%Y/%m/%d %H:%M'
'overrides' => array(
'type' => 'fieldset',
'legend' => get_string('overridingstartstopdate', 'view'),
'elements' => array(
'description' => array(
'type' => 'html',
'value' => get_string('overridingstartstopdatesdescription', 'view'),
),
'startdate' => array(
'type' => 'calendar',
'title' => get_string('startdate','view'),
'defaultvalue' => isset($view) ? strtotime($view->get('startdate')) : null,
'caloptions' => array(
'showsTime' => true,
'ifFormat' => '%Y/%m/%d %H:%M'
),
'help' => true,
),
'stopdate' => array(
'type' => 'calendar',
'title' => get_string('stopdate','view'),
'defaultvalue' => isset($view) ? strtotime($view->get('stopdate')) : null,
'caloptions' => array(
'showsTime' => true,
'ifFormat' => '%Y/%m/%d %H:%M'
),
'help' => true,
),
),
'help' => true,
),
'stopdate' => array(
'type' => 'calendar',
'title' => get_string('stopdate','view'),
'description' => get_string('stopdatedescription', 'view'),
'defaultvalue' => isset($view) ? strtotime($view->get('stopdate')) : null,
'caloptions' => array(
'showsTime' => true,
'ifFormat' => '%Y/%m/%d %H:%M'
),
'help' => true,
),
'submit' => array(
'type' => !empty($new) ? 'cancelbackcreate' : 'submitcancel',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment