'use strict'

define(['angular', 'underscore'], function (angular, _) {
  var controller = function ($rootScope, $scope, $log, group, $parse, $location) {
    $parse('current.group').assign($scope, group)

    $scope.$watch('current.group._id.$oid', function (id) {
      if (!id) {
        $scope.focus = 0
        return
      }

      var s = $location.search().s
      if (!isNaN(s) && s > 0) {
        $scope.focus = s
        return
      }

      $scope.focus = 2
    })

    $scope.$watch('focus', function (focus) {
      $location.search('s', focus)
    })

    $scope.$on('$routeUpdate', function () {
      $scope.focus = $location.search().s
    })
  }

  controller.resolve = {
    group: function ($rootScope, Restangular) {
      var id = $rootScope.$eval('session.username')
      if (id) {
        return Restangular.one('groups', id).get()
      }
    }
  }

  return controller
})

@@ -235,17 +235,8 @@
 roup
-._id.$oid
 ', f
@@ -244,18 +244,21 @@
 nction (
-id
+group
 ) %7B%0A    
@@ -264,18 +264,21 @@
    if (!
-id
+group
 ) %7B%0A    
@@ -448,30 +448,99 @@
     
-$scope.focus = 2%0A    %7D
+if (group.responded) %7B%0A        $scope.focus = 2%0A      %7D%0A%0A      $scope.focus = 1%0A    %7D, true
 )%0A%0A 

Fix routing logic.