The new tabs and single column layout completed at #1379382: Single column session schedule dictates that BoFs should follow suit.
Some work needed to be done to cod_session.module to allow for the BoF view to use the tabs/single-day arguments
A patch should do the following:
- Append /% to the BoFs View page URL to support the single-day pages. (ie: program/bofs/%)
- Add a MENU_CALLBACK for 'program/bofs' that uses the cod_session_schedule_tabs callback function similarly to program/session-schedule.
- Rewrite cod_session_schedule_tabs to accept $view_id and $display_id arguments for the views.
- Provide alternate output (just show the View) if there are no cod_session_days available to invoke the tabs.
| Comment | File | Size | Author |
|---|---|---|---|
| #43 | BoFs COD Dev Demo.png | 56.08 KB | dsdeiz |
| #40 | cod-bof-1699272-40.patch | 66.82 KB | saltednut |
| #39 | cod-bof-1699272-39.patch | 55.09 KB | saltednut |
| #38 | Screen Shot 2012-08-14 at 3.57.52 PM.png | 30.9 KB | twardnw |
| #37 | cod-bof-1699272-37.patch | 66.82 KB | saltednut |
Comments
Comment #1
saltednutpatch for da_drupalcon sandbox
Comment #2
twardnw commentedpatch applies clean, tabs are now showing on the bof schedule/scheduler
Comment #3
primerg commentedpatch applies clean but page schedule for bofs doesn't display for authenticated users only. We need it displayed for authenticated users to allow them to create bof sessions.
Comment #4
primerg commentedand I think "program/bofs" should be moved to cod_bof.module menu instead?
Comment #5
primerg commentedHere is my attempt at this (used patch from comment#1)
- set the program/bofs permission to "access content"
- moved the said menu in cod_bof.module
Comment #6
primerg commentedforgot the status
Comment #7
saltednut#5 applies cleanly to da_drupalcon sandbox.
tabs/single column session schedule working on bofs.
program/bofs inside the cod_bof.module is correct - sorry about that.
permissions look correct.
Comment #8
sheldonkreger commentedLooks like cod_session shows overrides after applying the patch to da_drupalcon sandbox. I'll clean it up . . .
Comment #9
sheldonkreger commentedShould be identical to #5, except cod_session should now appear as default. I tested the BoF scheduler and overlaps are avoided; available (and full) timeslots are listed on a beautiful tabbe program schedule; data is autofilled when a bof is created when a user clicks on an open time slot. Hopefully Features will cooperate this time, because everything else is probably good to go.
Comment #10
sheldonkreger commentedunassign
Comment #11
twardnw commentedPatch applies clean, functions as expected!
Comment #12
saltednut#9 applies clean and shows no overrides!
Comment #13
primerg commentedworks as described.
Comment #14
twardnw commented3 good reviews, I'm going to put this in the sandbox.
Comment #15
primerg commentedthis has changed dramatically with the new implementation of the tabs.
1. The quicktab format used in the session views will only work with pre-defined timeslot and room. the bof page dont have them yet and instead we create links for every available room and timeslot so I don't think this format will work for Bofs.
2. with the recent change in the session tab display, the cod_schedule_display variable was committed (unintentional?). Not sure what the plans is for that. the variable cod_schedule_display is in use in the tpl file too.
Comment #16
ezra-g commentedI marked #1661620: Authenticated Users Cannot Create BoFs Regardless of Permission Settings as a duplicate of this.
Comment #17
saltednutShould we re-introduce the custom hunks (menu item, quicktabs callback) that were removed from cod_session and use them as a part of cod_bof?
This basically includes a menu callback for program/bofs and using a callback function that builds the quicktabs. Also adding a trailing /% to the cod_bof view page is necessary to make this method work.
Comment #18
ezra-g commented@brantwynn Yes, I suggest following that approach.
Comment #19
japerryI've re-rolled from #1661620- to give us a good baseline to start our on single column view
Comment #20
japerryWorking on adding flags and adding back the work done by brantwynn to get the single page done.
Comment #21
japerryHere is some more patch work, starting with a new flag for indiciating if a timeslot or room is able to have a bof in it.
its not complete, but if someone wants to work on it tonight and post an update by the morning -- go ahead!
Comment #22
twardnw commentedone other thing you might want to work into this patch, disabling the room and timeslot fields on the node/add form after the prepopulate values have been entered.
Comment #23
japerryHere is a patch that comes after the first one in #21. must apply 21 first, then this one.
This gives bofs a single column quicktab layout, found at program/bofs
Its not complete but should be a little further along. Dyannenova said she will take a look at making the markup a bit prettier.
Comment #24
twardnw commentedSweet!
Patch applies clean. program/bofs is going straight to the tabbed display :) Time slots that are flagged for BoFs are showing up, those *not* flagged do not show. All rooms are showing at this time though. Fantastic improvement!
Comment #25
ezra-g commentedCOD_BoF already has capacity fields that are used to determine this. Can you clarify whether the new flag would be redundant or not?
Comment #26
twardnw commentedI don't think the capacity field fulfills the need here. Just because a room can only host one session/bof does not necessarily mean that it will only host a session. This flag is definitely needed on the time slot though, as currently the scheduler assumes that all available time slots can be used to schedule a bof.
Comment #27
coltraneI agree that the capacity field doesn't define what type of content can be in that room. Designating allowed content that can occupy a time slot is useful when scheduling controls can be given out to other roles.
For DrupalCon Denver authenticated users could schedule BoFs during limited times a day, instead of all available time slots. This was accomplished by a text select field on the time slot node type that allowed the (unfortunately custom) BoF scheduler to provide only certain time slots for use.
Comment #28
ezra-g commentedThanks for weighing in, coltrane.
I agree that a field makes more sense than a flag, since we're exporting data that describes the timeslot, rather than data that refers to it.
Comment #29
saltednutThis is basically a re-roll of work introduced in 21 and 23 but without the Flag.
I have added a boolean to the time slots. The checkbox asks if a slot Allows BoFs.
Should we also include a boolean on the Room bundle to determine if BoFs can occur in the room?
Comment #30
twardnw commentedI think the room should also have that field.
Comment #31
saltednutRoom also has its own boolean field now. BoF preprocess has to double-check the room nodes are set to 'Allow BoFs' before it displays them.
The default value for Rooms to Allow BoFs is set to 1 (true).
The default value for Time Slots to Allow BoFs is set to 0 (false).
What do people feel the appropriate default values are for these booleans?
Comment #32
twardnw commentedI think both should default to false.
After applying the last patch I'm not seeing any of my rooms or times in the scheduler at program/bofs
Comment #33
saltednutLooks like some files are missing from #21 and #23 in #31 - rerolling now...
Comment #34
saltednutSorry about the bad patch...
Comment #35
twardnw commentedsweet! It works!
patch applies clean, only rooms and times that are set to allow BoFs show in the scheduler :)
Some house-keeping items:
Comment #36
saltednuthouse-keeping recommendations from #35 are addressed in cod-bof-schedule.tpl.php with this patch
Comment #37
saltednutminor fix - should check for
empty($schedule_grid[$day_key][$slot['nid']][$room_key]['availability'])notisset()on the availability check in cod-bof-schedule.tpl.phpComment #38
twardnw commentedAs discussed in IRC, here's what I'm seeing:
The first time slot in Room 1 already has a session assigned to it. While it is not available for scheduling a BoF, we're just trying to indicate that the room has no available slots at that time.
Comment #39
saltednutAdjusted cod-bof-schedule.tpl.php per #38
Comment #40
saltednutfiles were missing again after a rebuild, apologies...
Comment #41
twardnw commentedPatch applies clean, scheduler functions as expected. Can add sessions to available slots, but not to a room/time that has a regular session scheduled. Looks good to me :)
Comment #42
dsdeiz commentedWorks on my end as well. Layout tends to mess up when there's too many time slots though.
Comment #43
dsdeiz commentedOops, miss the screenshot.
Comment #59
twardnw commentedspammer cleanup...
Comment #60
ezra-g commentedjaperry, DyanneNova, mrconnerton and myself discussed this functionality at the Distro sprint at DrupalCamp Asheville. Here's some documentation of the results of that conversation:
1) The re-written COD_BoF feature proposed in #40 adds ~900 lines of code on the schedule tpl.php file versus what was included in the Drupal 6 version. This is mostly business logic that should exist in the module layer if possible, rather than the theme layer.
2) http://drupal.org/project/views_field_view likely makes it possible to configure elements of the vertical scheule which were implemented via the theme in #40.
3) Some conferences (such as LinuxFestNW that has been the motivation for COD contributions by japerry and DyanneNova) have a session scheduling workflow where a higher tiered session organizer first blocks out the schedule to specify which types of sessions can happen during certain parts of the schedule (eg, a room that has a keynote from 9-10 but then should allow only BoFs from 10-4).
4) A proposed UI for implementing #3 would add a control such as "Alllowed in this slot: Bofs" or "Allowed in this slot: Sessions & BoFs" to slots in both the vertical and grid schedule views. When engaged, this control would allow the more permissionsed session organizer to specify which types of scheudulable items are allowed in that room during that timeslot. This information could be stored in a field collection on the room node (such as room_slot_types_allowed) that would contain an entity reference to each timeslot, and a set of checkboxes for each of the schedulable types that can fit in the room during a particular timeslot. So, when editing the room node, you might see something such as:
Comment #61
saltednutThe reason this happened goes back to some decisions that were made when we were getting CODZilla committed: #1668908-69: Replace User reference, Nodereference with References, Vertical session schedule view This was an attempt to subvert the single column session from having to use the views display plugin.
Even after this change, the theme .tpl in cod_session was used by both Sessions and BoFs (per #1 in this thread). Both of these were using the Views display plugin with some custom quicktabs code. Once this was removed from cod_session, we then realized we still needed it for BoFs. Instead of using the code from cod_session and having cod_bof be a dependency of cod_session, a lot of major changes were introduced... (see #23).
Looking at #23, I don't see it that we added ~900 lines - more like copied them in from one module to another and duplicated a lot of code. Also note that the theme preprocess hook was copied and "added" ~500 more lines to cod_bof as well - and created somewhat duplicate functionality.
This isn't so much something I "proposed" in #40 - but sort of just 'lived with' in revisions to #23 for the sake of moving things forward.
Now then, I'm in TOTAL agreement that both cod_bof and cod_session should have their own theme preprocess functions as well as .tpl files.
Ideally, neither of these components of cod_support would use a custom Views formatter either. We should be able to do all of this using contribs proposed and lose much of the custom code. Much of what goes on in both the tpl files and preprocess functions for on both cod_bof and cod_session needs to be refactored quite heavily.
I think committing the work from #40 as it gives us a base to continue on. It also provides those currently using COD7 to have the functionality that they need.
In its current state, yes it's not very pretty... but there are conferences with sites in D7 that need this to work yesterday.
So rather than completely delaying the process of moving things forward, why not commit and close this issue? New issues that address the refactoring can be opened.
The major architectural changes proposed in #60 lean toward a paradigm shift where a near complete rewrite of the inner guts that deliver both Session and BoF schedules needs to happen.
I think we should strongly consider introducing a 7.x-2.x branch of COD that not only solves these problems but many others that we currently face in introducing new UI components (like the one proposed in point 4 of #60) as well as refactoring/rewriting COD into a lighter and faster system that is accommodating to a wider variety of conferences. I believe we should not rush in meeting the needs of point 3 of #60 all within this issue - its a much bigger problem than just fixing the cod_bof module alone. I believe we can finish up a stable version of 7.x-1.x using this work and whatever else is going on. We can deliver to the public a 'ported' version of COD from 6 to 7 that can be used ASAP. Then we can take a step back and consider all the changes needed to 7.x-2.x to make COD much better.
Comment #62
ezra-g commentedHi Brant,
I agree points 3 and 4 from #60 shouldn't delay this issue getting resolved. I've filed #1742806: Ability to designate which types of schedule items fit into a slot for that feature request. The original reason for including it here is that it sounded like japerry and dyannenova were close to filing a patch that both resolves the present issue as well as that new functionality. I'd still accept such a patch and mark #1742806 as a dupe, but until/unless such a patch is produced, I agree that it shouldn't hold up this issue.
With regard 900 additional lines of themeing code, compare the cod_sessino.tpl.php (54 lines in Drupal 6) with what you're proposing in #40.
I can understand that it's frustrating to re-roll a patch that hasn't yet reached RTBC, but separating functionality from presentation is a fundamental programming pattern that Drupal observes, and we'd be doing a disservice to COD and it's user base if we abandon that pattern. I don't see the benefit in the approach of committing something we know is fundamentally not aligned with best practices with the goal of refactoring it "later."
Regarding
, do you have specific suggestions for what that refactoring would look like and areas COD should be more performant?
Comment #63
saltednutEzra, keep in mind that what I'm proposing isn't all code I've written - its code introduced for D7 before I came into the project. So its not just myself proposing these changes, but everyone who has worked on the changes together.
A good chunk of the functional logic in session.tpl.php was there before I started working on it. What I introduced was a simple if/else statement into a file that already hosted a dozen others.
Should there have been these if statements in the tpl to begin with? Definitely not. But the directive, as I understood it, was to make things work with what we had. So it was a paradigm I followed in order to continue this project forward. Probably a mistake - I wish I had time to refactor things more thoroughly.
In any case, one could download cod_support a month ago and see this functional tpl code in COD7. I didn't write the tpl file - I just rewrote parts of it so that it would work in the system. The work I did to the file actually removed ~54 lines of code and replaced them with ~92 lines of new code. So I proposed ~38 new lines of code when I refactored session.tpl.php to work with both BoFs AND Sessions.
Its code that was committed as a part of CODZilla: http://drupalcode.org/project/cod_support.git/blobdiff/4329c3789a9033911...
At this point, before and after the commit, there was functional logic in the tpl file. If you look at your commits into COD from the past, the pattern of committing code that needs to be refactored was par for the course.
In any case, I'm glad to see that you are willing to take a stand here and promote best practices. Theres tons of cruft in COD that needs to be reworked. Its a huge task.
So as far as my suggestion as to what refactoring COD would look like - there are a lot of possibilities. A few that come to mind involve either re-architecting the system to use a different set of content types (so that one doesn't have to create three nodes in order to make one "thing") or just simply cleaning up these tpl files and their preprocess hooks and moving forward.
Comment #64
ezra-g commentedRe-examining #40 I see that I misread the patch and that the code I was including in the 900 lines is actually added in a preprocess function rather than the .tpl.php file. I apologize for misreading #40. I agree that in general a preprocess would preferable to code in the template file, though less preferable than a solution that assembles the schedule in a structured way that happens separately from the theme layer.
japerry has filed an initial patch at #1742806: Ability to designate which types of schedule items fit into a slot that provides an alternative solution for the COD schedule system that would eliminate the need for this preprocess code entirely, and has committed to revising it by Friday.
I recognize the importance of having the COD scheduling system take more definitive shape, and that you've been working on this issue for 3+ weeks. As a result, I'm committing to review the work at #1742806 with the goal of having a commit towards the bof/schedule system by the end of the week.
Comment #65
saltednutSeems this is now a duplicate of #1742806: Ability to designate which types of schedule items fit into a slot :)