// Generated by CoffeeScript 1.6.3
var __hasProp = {}.hasOwnProperty,
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

define(["backbone", "views/TableView"], function(Backbone) {
  var HITView, _ref;
  return HITView = (function(_super) {
    __extends(HITView, _super);

    function HITView() {
      _ref = HITView.__super__.constructor.apply(this, arguments);
      return _ref;
    }

    HITView.prototype.title = " ";

    HITView.prototype.columns = {
      title: {
        header: "Title"
      },
      hitid: {
        header: "Id"
      },
      max_assignments: {
        header: "Progress",
        draw: function(model) {
          var completed;
          completed = model.get("number_assignments_completed") / model.get("number_assignments_available");
          return "<div class='progress progress-mini progress-striped'> <div class='bar' style='width: " + completed + "%'></div> </div>";
        }
      },
      expiration: {
        header: "Expires",
        draw: function(model) {
          return new Date(model.get("expiration"));
        }
      },
      expire: {
        header: " ",
        draw: function(model) {
          var button, id;
          id = model.get("hitid");
          button = "<button id=" + id + " class='btn btn-small expire'>Expire</button>";
          return button;
        }
      },
      extend: {
        header: " ",
        draw: function(model) {
          var button, id;
          id = model.get("hitid");
          button = "<button id=" + id + " class='btn btn-small extend'>Extend</button>";
          return button;
        }
      }
    };

    HITView.prototype.pagination = false;

    HITView.prototype.size = 5;

    return HITView;

  })(Backbone.TableView);
});
