diff options
| author | mo <mo.khan@gmail.com> | 2017-09-02 22:46:07 +0000 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2017-09-02 22:46:07 +0000 |
| commit | 4d6fd17c8f1d7ee0ecb46e8323b61e4006bf39a4 (patch) | |
| tree | e9d098503da331c6b50c339166d1dd8f4a7c3c5f /app/assets/javascripts/controllers/my/tutorials_controller.js.coffee | |
| parent | 85b4e006052f51dfb7fb02ee1fe7d6914cb6b17c (diff) | |
| parent | 6a6daa8c8d9223d6f3b29897bc23df386f28428b (diff) | |
Merge branch 'bootstrap' into 'master'
Bootstrap
Closes #10
See merge request !2
Diffstat (limited to 'app/assets/javascripts/controllers/my/tutorials_controller.js.coffee')
| -rw-r--r-- | app/assets/javascripts/controllers/my/tutorials_controller.js.coffee | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/assets/javascripts/controllers/my/tutorials_controller.js.coffee b/app/assets/javascripts/controllers/my/tutorials_controller.js.coffee new file mode 100644 index 00000000..dcee92d5 --- /dev/null +++ b/app/assets/javascripts/controllers/my/tutorials_controller.js.coffee @@ -0,0 +1,29 @@ +class CakeSide.Controllers.My.TutorialsController extends Marionette.Controller + views: CakeSide.Views.My.Tutorials + initialize: (options) -> + @content_region = CakeSide.Application.content_region + @tutorials = CakeSide.Application.request('TutorialsRepository') + #@comment_view = CakeSide.Application.request('CommentView') + + index: -> + @selectTab() + #@comment_view.hide() + @content_region.show(new @views.IndexView(collection: @tutorials)) + + new: -> + @selectTab() + #@comment_view.hide() + @content_region.show(new @views.NewView(collection: @tutorials)) + + show: (id) -> + @selectTab() + tutorial = @tutorials.get(id) + @content_region.show(new @views.ShowView(model: tutorial)) + #@comment_view.render + #identifier: "t-#{tutorial.id}" + #title: tutorial.get('heading') + #url: tutorial.get('url') + + selectTab: -> + $('.nav-link').removeClass('active') + $('a[href="/my#tutorials/new"]').addClass('active') |
