Issue Details (XML | Word | Printable)

Key: MDL-9306
Type: Bug Bug
Status: Reopened Reopened
Priority: Blocker Blocker
Assignee: moodle.com
Reporter: Martin Dougiamas
Votes: 7
Watchers: 17
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Main course formats need to have tables removed but keep AJAX working

Created: 12/Apr/07 12:43 PM   Updated: 13/Nov/09 04:08 PM
Return to search
Component/s: Accessibility, AJAX
Affects Version/s: 1.8
Fix Version/s: 2.0

File Attachments: 1. File courseformats.tar (43 kB)
2. Text File csscourseformatpatch.txt (7 kB)
3. Text File cssformatpatch.txt (5 kB)
4. File cssformats.tar (38 kB)
5. Microsoft Word Musik WDH 2CB.doc (26 kB)

Image Attachments:

1. moodle2_tableless_course.png
(116 kB)
Issue Links:
Blockers
 
Dependency
 
Duplicate
 
Relates
 

Participants: AjnabiZ, Ann Adamcik, John Ryan, Martin Dougiamas, Matthew Cannings, moodle.com, NateBaxley, Nick Freear, Nicolas Connault, Petr Skoda, Urs Hunkler and Wen Hao Chuang
Security Level: None
Resolved date: 06/Nov/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
The current main course formats currently use tables for layout

    course/format/topics
    course/format/weeks

which the AJAX course editing functionality (eg Turn Editing on) relies upon (because of the DOM).

These formats need to to be changed to use a DIV+CSS only structure exactly like
 
    course/format/weekscss

And since weekscss will be deprecated it needs to be deleted and all courses using it can be changed to simply "weeks".

The main issue though is that AJAX will no longer work because of the changed DOM.

Someone needs to fix the AJAX so that it will work on these formats exactly as it does now.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Martin Dougiamas added a comment - 12/Apr/07 02:30 PM
Don Pinto is keen to work on this.

John Ryan added a comment - 06/May/07 03:21 AM
I have just downloaded the latest 1.9dev version from moodle.org.

I have found that the right hand blocks disappear when I turn Editing on if the format is set to topics or weeks but stay if the format is set to weekscss.

Is this a new bug or simply a work in progress?

I also find that AJAX no longer works even though it is turned at the site level.


Martin Dougiamas added a comment - 13/Aug/07 02:41 PM
Don Pinto, did you have any success with this?

AjnabiZ added a comment - 05/Sep/07 02:54 PM
Any news on this ?

Ann Adamcik added a comment - 13/Oct/07 06:55 AM
It doesn't look like this is being worked on, so I'm willing to jump in. I've modified lib/ajax/section_classes.js to work with the weekscss format. I need to do some more testing on it, and then I'll work on creating a css version of the topic format. More next week, I hope...

Ann Adamcik added a comment - 23/Oct/07 06:20 AM
Attached are new weekscss and topicscss course formats. The second attachment contains patches for lib/ajax/section_classes.js, lang/en_utf8/moodle.php, theme/standard/styles_layout.css, and theme/custom_corners/user_styles.css.

If the intent is to completely replace the table-based weeks and topics formats with these, then the lang and standard theme changes won't have to be applied. Let me know if this is the case and I will attach new files.


Martin Dougiamas added a comment - 29/Oct/07 10:47 PM
Oo cool, thanks! Let's get these into HEAD so it gets some thorough testing and if it works well then maybe we can backport to 1.9.1 or something later.

Martin Dougiamas added a comment - 29/Oct/07 10:47 PM
Yu, can you review these patches and, if good, apply them to HEAD?

Martin Dougiamas added a comment - 06/Nov/07 04:34 PM
Another patch from Ann Nicolas, can you please review and put in HEAD only please (for now)

Nicolas Connault added a comment - 06/Nov/07 10:03 PM
Applied Ann's patches: all seems to work very well, the output is entirely XHTML compliant, and displays really nicely. The AJAX works very well too.

Nick Freear added a comment - 07/Nov/07 02:06 AM
Hi Ann,
Thank you for your work on this - it's moving us forward, which is a big help!

A question, once these CSS formats have been thoroughly tested and replace the old ones, is the plan to replace layout tables in index.php (and tag/index.php) too? (Probably a new bug.)

(Just fixed 2 minor bugs: MDL-7878, MDL-11439).
Regards, Nick Freear (OU)


Martin Dougiamas added a comment - 07/Nov/07 08:19 PM - edited
Nicolas, can you please fix this checkin so that the formats replace weeks and topics (and get rid of weekscss and topicscss).

You'll also need an upgrade like:

UPDATE course SET format = 'weeks' WHERE format = 'weekscss'

to clear up any older courses that might be using the defunct format.

(note also that the changes to lib/ajax probably broke AJAX for the table-based layouts ... check that nothing else was affected).


Martin Dougiamas added a comment - 07/Nov/07 08:24 PM
Nick F, yes indeed, we should lose the tables in those places as well as My Moodle and Admin pages. But I remain to be convinced that we are free from ugly text-overflowing-out-of-divs problems.

Ann Adamcik added a comment - 08/Nov/07 02:14 AM
Nick & Martin -

I've attached new css weeks and topics formats that can replace the old weeks and topics directories. For consistency, I changed class names from weekscss* and topicscss* to weeks* and topics*.

I did attempt to make the ajax changes in such a way that the topics formats would continue to work, but more testing is always a good thing.

-Ann


Nicolas Connault added a comment - 08/Nov/07 01:54 PM
Finished all these tasks, seems to be working OK.

Urs Hunkler added a comment - 16/Nov/07 09:43 PM
Ann and Nick,

the custom_corners theme is a Chameleon engine enabled theme. You must not write hooks as comma separated lists of elements like "td#middle-column div.bt, div#middle-column div.bt" in Chameleon themes because the Chameleon engine can't handle these comma lists.

Please write two declarations instead. I correct those properties now.


Petr Skoda added a comment - 23/Nov/07 04:10 PM
This is not good - if you compare the course page and any blocks you will see that the size and color is different

Martin Dougiamas added a comment - 26/Nov/07 08:45 AM
Urs, can that be documented please in the Chameleon themes?

Petr Skoda added a comment - 16/Dec/07 12:55 AM
Another big problem is the code in upgrade.php - we must not make HEAD specific upgrades yet because we still have the same version numbers in 19 and head.
The upgrade code will NOT be executed during upgrade from MOODLE_19_STABLE to HEAD!
This can not be fixed now, we must wait untill we separate the versions - please no HEAD specific changes in upgrade.php yet

Urs Hunkler added a comment - 10/Jan/08 01:23 AM
Another issue: When for example the left column contains no blocks the column does show up empty. Should behave like the table version.

Urs Hunkler added a comment - 10/Jan/08 01:33 AM
Seeing all these issues I urgently recommend not to replace the table course formats but to add the table-less formats and let people change the course format by hand. I expect several courses breaking when the table-less format automatically replaces the table format.

Urs Hunkler added a comment - 13/Jan/08 01:34 AM
Explanation added for hooks as comma separated lists in Chameleon in README.html

Matthew Cannings added a comment - 19/Jun/08 06:49 AM
The blocks_have_content function can be used to adjust the width of the middle column when left or right column is empty

echo '<div id="middle-column" style="';
if (!blocks_have_content($pageblocks, BLOCK_POS_LEFT) && !$editing) { echo 'margin-left:0;'; }
if (!blocks_have_content($pageblocks, BLOCK_POS_RIGHT) && !$editing) { echo 'margin-right:0;'; }
echo '">';


NateBaxley added a comment - 10/Oct/08 10:49 PM
What is the current status of this issue? I would like to turn on the AJAX drag and drop for our new format that is based on the Weekly CSS/No Tables format. Is this currently possible? I have enabled all the admin AJAX settings and in the user profile as well. It appears that moving the course from Weekly format to Weekly CSS format disables the AJAX drag and drop. What is the planned version for adding drag and drop to the CSS formats?

Wen Hao Chuang added a comment - 11/Mar/09 06:38 AM
Sorry for the quick question, we are evaluating the course area AJAX feature right now in 1.9.4. Is this issue (MDL-9306) only affect moodle 1.8.x or does it also affect 1.9.x? Thanks!