Commit Graph

809 Commits

Author SHA1 Message Date
Peter Fogg
ad09236c82 Merge pull request #242 from edx/peter-fogg/advanced-backbone-notifications
Refactor Advanced Settings page to use Backbone notifications.
2013-06-24 12:37:26 -07:00
Peter Fogg
fb573a1db6 Hide "success" alert as soon as we start editing another field. 2013-06-24 13:59:14 -04:00
David Baumgold
72ffe2d8f2 Backbone notifications secondary actions
Handle secondary actions on notifications either specified as a single object,
or as a list of objects. Under the hood, the initialize method converts a single
object to a list containing a single object.
2013-06-24 13:44:50 -04:00
Peter Fogg
3e376bd780 Prevent "saved" and "error" views from showing at the same time.
Previously the "saved" view was never hidden, even after more data was
edited. So if one field was saved successfully and then another was
not, we would find ourselves in the unfortunate situation of seeing
both views at once, leading to much confusion.
2013-06-24 11:06:53 -04:00
Peter Fogg
72e08456a8 Refactor Advanced Settings page to use Backbone notifications. 2013-06-24 09:48:37 -04:00
David Baumgold
687779ba34 Clean up assets page notifications
Remove hack to work around multiple notification click issues -- and actually resolve
the issue so that the hack isn't necessary
2013-06-19 12:01:44 -04:00
David Baumgold
b6e3b0ee03 Refactor Backbone Notifications
Models are extraneous for something as temporary as a notifaction -- this change
moves all the configuration into the views, and removes the models entirely.
2013-06-18 10:20:31 -04:00
Chris Dodge
16e476e8e4 refactored asset page related JS into it's own page 2013-06-17 11:10:36 -04:00
cahrens
4d311f44cd Code review feedback. 2013-06-01 18:46:09 -04:00
cahrens
a82daf0710 Change to Backbone collection. 2013-05-31 15:59:53 -04:00
cahrens
8fd15ce45d Review feedback. 2013-05-30 14:13:10 -04:00
cahrens
5d41e2a952 Updates from code review. 2013-05-30 12:26:01 -04:00
cahrens
24707f8f85 Jasmine test for views. 2013-05-29 12:09:42 -04:00
cahrens
625c6b518c Cleanup, change how we load templates. 2013-05-28 14:07:35 -04:00
cahrens
c95b44d851 Merge branch 'master' into feature/christina/metadata-ui
Conflicts:
	cms/envs/common.py
	cms/templates/base.html
	common/lib/xmodule/xmodule/combined_open_ended_module.py
2013-05-23 11:41:12 -04:00
cahrens
c8d6d5d283 Selenium tests. 2013-05-23 11:34:02 -04:00
David Baumgold
3cfadb8ae8 Migrated internationalization text into template for section name 2013-05-22 15:55:55 -04:00
Frances Botsford
fa330784d3 removed symbolset, replaced with fontawesome for gradable status; added transform-origin for saving notification animation to remove wobble 2013-05-22 15:55:55 -04:00
David Baumgold
f3523d805f Escape section name in Backbone to prevent XSS 2013-05-22 15:55:55 -04:00
Frances Botsford
4e79d064a0 removed symbolset, replaced with fontawesome for alerts, notifications, and all references in js files 2013-05-22 15:55:55 -04:00
David Baumgold
9e864834bd Unify system feedback templates
Also, a SystemFeedback model no longer has a `type`, it has an `intent`. This is
because SystemFeedback views have `type`, as well, and this prevents a naming
collision.
2013-05-22 15:55:55 -04:00
David Baumgold
1e7e38824a Shorten secondary action detection code 2013-05-22 15:55:54 -04:00
David Baumgold
0052eaacbc Backbone section: don't save name on validation error 2013-05-22 15:55:54 -04:00
Brian Talbot
7ae534799b studio - revises error message copy when section name is left blank on outline view 2013-05-22 15:55:54 -04:00
David Baumgold
a0a71c0df2 Internationalization for JS 2013-05-22 15:55:53 -04:00
David Baumgold
9cbfee9894 Fix Jasmine tests related to invalid messages for section model 2013-05-22 15:55:53 -04:00
David Baumgold
2b01273f7f Added some Jasmine tests for section views in Backbone 2013-05-22 15:55:52 -04:00
David Baumgold
56d8a467c8 Add tests for minShown and maxShown in views 2013-05-22 15:55:52 -04:00
David Baumgold
09a8075355 If a Backbone view can't find its template, I want to know 2013-05-22 15:55:52 -04:00
David Baumgold
fcf4cdc75e Implement minShown and maxShown for notification views 2013-05-22 15:55:51 -04:00
David Baumgold
91c2594c8d Fix section name validation alerting 2013-05-22 15:55:51 -04:00
David Baumgold
4af3325976 Move display logic into view
Model shouldn't know about things like close buttons, visibility, and so on
2013-05-22 15:55:51 -04:00
David Baumgold
fedfe8627f Add tests for click events on views 2013-05-22 15:55:51 -04:00
David Baumgold
070d24cf61 Jasmine doesn't like asserting on the <body> element :( 2013-05-22 15:55:51 -04:00
David Baumgold
0c368011da Move underscore templates into separate files, included in Mako templates 2013-05-22 15:55:50 -04:00
David Baumgold
69a6ec0c97 Don't fall over if a model doesn't have actions defined
It appears that one notification stealing focus from another causes some weirdness:
both clicking on a button on one view triggers the event on both views (the original
and the new view that stole the div). As long as the first view does *not* define
any click events, everything is fine -- this is the case for the saving notification.
I'll worry about the reason for this later; it has something to do with views
listening to models even after they no longer should be.
2013-05-22 15:55:50 -04:00
David Baumgold
1333717871 Message action callbacks have model set to this 2013-05-22 15:55:50 -04:00
David Baumgold
c6c5e50d86 Hook up notification framework to default AJAX error callback
And delete `CMS.ServerError`
2013-05-22 15:55:49 -04:00
David Baumgold
cd2f67afa4 Clone the attributes object
So that modifications don't affect the model
2013-05-22 15:55:49 -04:00
David Baumgold
5746121f5c Set up Notification and Prompt 2013-05-22 15:55:49 -04:00
David Baumgold
5c2116a4b3 Make abstract view, make Alert inherit from it 2013-05-22 15:55:49 -04:00
David Baumgold
5ff2adb882 Rename alert model to SystemFeedback 2013-05-22 15:55:48 -04:00
David Baumgold
56a92bff51 Hook up CMS.ServerError to new alerting system 2013-05-22 15:55:48 -04:00
David Baumgold
40000a3ac5 Make close tab on alerts close the alert 2013-05-22 15:55:48 -04:00
David Baumgold
c0d69022cb Set up Backbone model/view for alerts 2013-05-22 15:55:48 -04:00
cahrens
4facd262bd Jasmine test for metadata model. 2013-05-20 16:26:48 -04:00
cahrens
25388dec96 Minor cleanup. 2013-05-20 13:31:55 -04:00
cahrens
2020923f2d Prevent invalid numeric entries. 2013-05-20 13:26:27 -04:00
cahrens
3229aaf503 Call polyfill at right time. 2013-05-20 11:16:20 -04:00
cahrens
b16e17a250 Some i18n work and other minor cleanup. 2013-05-17 14:57:25 -04:00