Commit Graph

4 Commits

Author SHA1 Message Date
Ryan Shaw cfaa154759 changes to allow using more things as AMD modules
* all Handlebars templates now register as AMD
   modules. this makes using the Template class
   unnecessary.  by requiring it in your module
   you will have a variable is the precompiled
   function that you can call to interpolate the
   template.
 * register I18n as an AMD module.
 * switch from using curl.js to require.js

Change-Id: I84193c7f8e99072fe8b4766982a2a612a85065d7
Reviewed-on: https://gerrit.instructure.com/6720
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2011-11-08 14:45:33 -07:00
Jon Jensen 395b0fdb07 only load course list when menu first opens
previously it did the ajax query on every page load, and always
regardless of whether anything could be customized. this seems like
a reasonable compromise to ensure there is no noticeable wait when
clicking on the customize link.

also fixed a display issue where the custom list editor got clipped
if you had no accounts or groups.

test plan:

1. regression test of menu customization
 1. add courses
 2. remove courses
 3. reset list
2. ensure menu works as expected for users w/ <= 8 courses
3. ensure menu customization ui works for teachers w/ > 8 courses
   and who are not account admins (i.e. no managed accounts)

Change-Id: I390806e6a05211fae9a7375490ca2036774edc7c
Reviewed-on: https://gerrit.instructure.com/6607
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-11-03 09:14:59 -06:00
Ryan Florence cc4522fc04 incorporated AMD into the main application
- added AMD support for Template, but it still
  exports to window.Template until we convert all
  recent stuff into modules

- converted objectCollection, CustomList, and
  courseList to modules

- added specs for objectCollection

Change-Id: Ib4ca4e25374c656b7b583ec7284c37672c117d2a
Reviewed-on: https://gerrit.instructure.com/6545
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-01 10:33:49 -06:00
Ryan Florence 8e3067e44b added favorite courses option to main menu
Features
--------

- The course menu shows the top 12 courses in
  alphabetical order

- Users with > 12 courses will get a button to
  edit the courses in their menu.  Any courses
  they add become favorites and will remain
  in the course menu, and visa versa for those
  they remove

- Users can reset the menu to the default 12

Noteworthy Ruby changes:
------------------------

- Added Favorites model
  Favorites are polymorphic so we can save other
  contexts as favorites in the future.

- Added FavoritesController

- Added User#menu_courses
  This opens up some room to remove lots of code
  that's used to build the main menu, but that
  isn't in this commit.  Gives a list of all the
  courses that show up in the user's menu.

- Added User#favorites

- Added User#favorite_courses

- Refactored Enrollment::readable_type to cache


Noteworthy JavaScript changes:
------------------------------

- Jasmine specs are totally working

- Added CustomList constructor

- Added courseList (CustomList instance)

- Added objectCollection
  Utility function that extends an array with
  methods useful for collections of objects.
  Used to manage the data state in CustomList

Fixes #4827

Change-Id: I59468e517ad07678741402bf9cf479cba1dfeaa1
Reviewed-on: https://gerrit.instructure.com/5982
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-10-24 15:50:34 -06:00