Commit c74214fc authored by Nigel McNie's avatar Nigel McNie
Browse files

Fix for bug #1604 - improved the layout of the view access page somewhat.

Now the items are layed out in a grid to the right of the searcher, which saves some vertical space and has more fluidity to the layout.

Also, the calendar elements have from/to text, which is a small violation of the language text freeze but makes the purpose of the calendar items for each element much clearer.

I'd like to add more text to this page as an explanation, though that would be a larger violation.
parent 31658246
......@@ -116,4 +116,7 @@ $string['blocktypecategory.multimedia'] = 'Multimedia';
$string['notitle'] = 'No title';
$string['clickformoreinformation'] = 'Click for more information and to place feedback';
$string['From'] = 'From';
$string['To'] = 'To';
?>
......@@ -32,7 +32,7 @@
* @return string The HTML for the element
*/
function pieform_element_viewacl(Pieform $form, $element) {
$smarty = smarty();
$smarty = smarty_core();
$smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}';
......
......@@ -1175,16 +1175,20 @@ a.folderhover {
}
#accesslistitems {
padding: 5px;
float: right;
margin-left: 35em;
}
#accesslistitems table {
#accesslistitems table.ai-container {
background-color: #e5e8da;
padding: 5px 7px 1px 7px;
color: #000000;
margin: 0 0 5px 0;
margin: 5px;
line-height: 20px;
font-weight: normal;
width: 230px;
width: auto;
float: left;
}
#accesslistitems table.preset {
background-color: #f5f8da;
}
#accesslistitems div div {
background: none;
......
......@@ -33,6 +33,7 @@ var count = 0;
function renderPotentialPresetItem(item) {
var addButton = BUTTON({'type': 'button'}, '{{str tag=add}}');
var row = DIV(null, addButton, ' ', item.name);
item.preset = true;
connect(addButton, 'onclick', function() {
appendChildNodes('accesslist', renderAccessListItem(item));
......@@ -45,13 +46,21 @@ function renderPotentialPresetItem(item) {
// Given a row, render it on the right hand side
function renderAccessListItem(item) {
var removeButton = BUTTON({'type': 'button'}, '{{str tag=remove}}');
var dateDiv = DIV(null,
makeCalendarInput(item, 'start'),
makeCalendarLink(item, 'start'),
makeCalendarInput(item, 'stop'),
makeCalendarLink(item, 'stop')
var dateInfo = TABLE(null,
TR(null,
TH(null, get_string('From') + ':'),
TD(null, makeCalendarInput(item, 'start'), makeCalendarLink(item, 'start'))
),
TR(null,
TH(null, get_string('To') + ':'),
TD(null, makeCalendarInput(item, 'stop'), makeCalendarLink(item, 'stop'))
)
);
var row = TABLE(null,
var cssClass = 'ai-container';
if (item.preset) {
cssClass += ' preset';
}
var row = TABLE({'class': cssClass},
TBODY(null,
TR(null,
TH(null, item.name + (item.tutoronly ? ' ' + '{{str tag=tutors}}' : '')),
......@@ -59,7 +68,7 @@ function renderAccessListItem(item) {
),
TR(null,
TD({'colspan': 2},
dateDiv,
dateInfo,
INPUT({
'type': 'hidden',
'name': 'accesslist[' + count + '][type]',
......
......@@ -35,7 +35,7 @@ define('TITLE', get_string('editaccess', 'view'));
require_once('pieforms/pieform.php');
require_once('pieforms/pieform/elements/calendar.php');
require_once(get_config('docroot') . 'lib/view.php');
$smarty = smarty(array('tablerenderer'), pieform_element_calendar_get_headdata(pieform_element_calendar_configure(array())));
$smarty = smarty(array('tablerenderer'), pieform_element_calendar_get_headdata(pieform_element_calendar_configure(array())), array('view' => array('From', 'To')));
$view = new View(param_integer('id'));
$new = param_boolean('new');
......
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