Commit a34518b7
Changed files (7)
app
assets
javascripts
backbone
controllers
templates
cakes
photos
views
photos
app/assets/javascripts/backbone/controllers/photos_controller.js.coffee
@@ -1,16 +0,0 @@
-class CakeSide.Controllers.PhotosController extends Marionette.Controller
- initialize: (options) ->
- @cakes = CakeSide.Application.request('CakesRepository')
- @content_region = CakeSide.Application.content_region
-
- show: (cake_id, id) ->
- @photos = CakeSide.Application.request('PhotosRepository', cake_id)
- photo = new CakeSide.Models.Photo({cake_id: cake_id, id: id})
- photo.fetch()
- @content_region.show(new CakeSide.Views.Photos.ShowView(model: photo, collection: @photos))
- cake = @cakes.get(cake_id)
- CakeSide.Application.request('CommentView').render
- identifier: "c-#{cake_id}"
- title: cake.get('name')
- url: cake.public_url()
-
app/assets/javascripts/backbone/routers/cakes_router.js.coffee
@@ -3,5 +3,5 @@ class CakeSide.Routers.CakesRouter extends Marionette.AppRouter
"cakes/new": "newCake"
"cakes/:id/edit": "edit"
"cakes/:id": "show"
- "cakes/:id/:photo_id": "show"
+ "cakes/:id/photos/:photo_id": "show"
"cakes": "index"
app/assets/javascripts/backbone/routers/photos_router.js.coffee
@@ -1,3 +0,0 @@
-class CakeSide.Routers.PhotosRouter extends Marionette.AppRouter
- appRoutes:
- "cakes/:cake_id/photos/:id": "show"
app/assets/javascripts/backbone/templates/cakes/thumbnail.jst.ejs
@@ -4,8 +4,7 @@
<div class="bar" style="width: <%= percentComplete %>%;"></div>
</div>
<% } else { %>
- <!-- <a href="#cakes/<%= cake_id %>/photos/<%= id %>"> -->
- <a href="#cakes/<%= cake_id %>/<%= id %>">
+ <a href="#cakes/<%= cake_id %>/photos/<%= id %>">
<img src="<%= thumb_url %>" />
</a>
<% } %>
app/assets/javascripts/backbone/templates/photos/show.jst.ejs
@@ -1,14 +0,0 @@
-<div class="row-fluid">
- <div class="span12">
- <p><a href="#cakes/<%= cake_id %>">back</a></p>
- <a href="#cakes/<%= cake_id %>/photos/<%= id %>">
- <img src="<%= original_url %>" class="thumbnail" />
- </a>
- </div>
-</div>
-<div class="row-fluid">
- <div class="span12">
- <ul class="thumbnails">
- </ul>
- </div>
-</div>
app/assets/javascripts/backbone/views/photos/show_view.js.coffee
@@ -1,9 +0,0 @@
-#= require backbone/views/cakes/thumbnail_view
-CakeSide.Views.Photos ||= {}
-
-class CakeSide.Views.Photos.ShowView extends Marionette.CompositeView
- template: JST["backbone/templates/photos/show"]
- childView: CakeSide.Views.Cakes.ThumbnailView
- childViewContainer: '.thumbnails'
- modelEvents:
- 'sync': 'render'
app/assets/javascripts/backbone/cakeside.js.coffee
@@ -24,8 +24,6 @@ window.CakeSide =
CakeSide.Application.addInitializer (options) ->
new CakeSide.Routers.CakesRouter
controller: new CakeSide.Controllers.CakesController()
- new CakeSide.Routers.PhotosRouter
- controller: new CakeSide.Controllers.PhotosController()
new CakeSide.Routers.TutorialsRouter
controller: new CakeSide.Controllers.TutorialsController()
new CakeSide.Routers.DashboardRouter