<commit_before>/**
 * @license
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
CLASS({
  package: 'foam.tutorials.todo.ui',
  name: 'TodoDetailView',
  extendsModel: 'foam.ui.DetailView',
  requires: [
    'foam.tutorials.todo.model.Todo',
    'foam.ui.md.UpdateDetailView',
  ],

  imports: [
    'stack',
    'todoDAO',
  ],

  exports: [
    'selection$',
  ],

  properties: [
    {
      name: 'model',
      factory: function() { return this.Todo; }
    },
    {
      name: 'className',
      defaultValue: 'todo-detail'
    },
    {
      name: 'selection',
    },
  ],

  listeners: [
    {
      name: 'onChildClick',
      code: function() {
        this.todoDAO.find(this.selection.id, {
          put: function(obj) {
            this.stack.pushView(this.UpdateDetailView.create({
              innerView: this.model_,
              data: obj
            }, this.Y));
          }.bind(this)
        });
      }
    },
  ],

  templates: [
    function CSS() {/*
      .todo-detail {
      }
    */},
    function toHTML() {/*
      <% if( !this.data ) return ''; %>
      <div id="<%= this.id %>" <%= this.cssClassAttr() %>>
        $$completed
        $$description
        $$subtasks{
          model_: 'foam.ui.DAOListView',
          rowView: 'foam.tutorials.todo.ui.TodoCitationView'
        }
        <% this.addInitializer(function() {
          self.subtasksView.subscribe(self.subtasksView.ROW_CLICK, self.onChildClick);
        }); %>
      </div>
    */},
  ]<commit_msg>TodoApp: Switch to using the new foam.browser.ui.DAOController for subtasks<commit_after>/**
 * @license
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
CLASS({
  package: 'foam.tutorials.todo.ui',
  name: 'TodoDetailView',
  extendsModel: 'foam.ui.DetailView',
  requires: [
    'foam.tutorials.todo.model.Todo',
    'foam.ui.md.UpdateDetailView',
  ],

  imports: [
    'stack',
    'todoDAO',
  ],

  exports: [
    'selection$',
  ],

  properties: [
    {
      name: 'model',
      factory: function() { return this.Todo; }
    },
    {
      name: 'className',
      defaultValue: 'todo-detail'
    },
    {
      name: 'selection',
    },
  ],

  listeners: [
    {
      name: 'onChildClick',
      code: function() {
        this.todoDAO.find(this.selection.id, {
          put: function(obj) {
            this.stack.pushView(this.UpdateDetailView.create({
              innerView: this.model_,
              data: obj
            }, this.Y));
          }.bind(this)
        });
      }
    },
  ],

  templates: [
    function CSS() {/*
      .todo-detail {
      }
    */},
    function toHTML() {/*
      <% if( !this.data ) return ''; %>
      <div id="<%= this.id %>" <%= this.cssClassAttr() %>>
        $$completed
        $$description
        $$subtasks{
          model_: 'foam.browser.ui.DAOController',
          rowView: 'foam.tutorials.todo.ui.TodoCitationView',
          innerEditView: 'foam.tutorials.todo.ui.TodoDetailView'
        }
      </div>
    */},
  ]
{'fraction_non_alphanumeric': 0.13910505836575876, 'fraction_numerical': 0.0038910505836575876, 'mean_word_length': 2.2233542319749215, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4369679', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1278, 'n_words': 315}