# URT

module Couchdb::CouchdbMeta::ScanFireRatedDoor

  @@form = {
    name: "Fire Rated Door",
    detail: {
      tabs: [
	{ # detail.tabs[0]
	  "title": "Record",
	  "icon-on": "ion-ios-paper",
	  "icon-off": "ion-ios-paper-outline",
	  "fields": [
	    { name: "tag_id", template: "tag_id" },
	    { name: "form_" },
	    { name: "created_by" },
            { name: "reference_number" },
            { name: "reinspection" }, 
            { name: "functional_test" }, 
            { name: "visual_inspection" }, 
            { name: "glazing" }, 
            { name: "door_frames_and_assembly" }, 
            { name: "nothing_missing_broken" }, 
            { name: "door_clearances" }, 
            { name: "self_closing_operational" }, 
            { name: "coordinator" }, 
            { name: "latching_hardware" }, 
            { name: "auxiliary_hardware" }, 
            { name: "no_field_modifications" }, 
            { name: "gaskets_and_edge_seals" }, 
            { name: "door_label" }, 
            { name: "comments" }, 
	    { name: "risk_level" },
	    { name: "status" },
	    { name: ["created_at", "updated_at"], template: "at" },
	  ]
	},
	{ # detail.tabs[1]
	  "title": "GPS Point",
	  "icon-on": "ion-ios-location",
	  "icon-off": "ion-ios-location-outline",
	  "fields": [
	    { name: "latitude"  },
	    { name: "longitude" },
	    { name: "altitude"  },
	    { name: "accuracy"  }
	  ]
	}
      ],
      templates: { # detail.templates
      }
    },
    form: {
      tabs: [
	{ # form.tabs[0]
	  "title": "Record",
	  "icon-on": "ion-ios-paper",
	  "icon-off": "ion-ios-paper-outline",
	  "fields": [

	    { name: "form_" },

            { name: "reference_number" },
	    { name: "reinspection" },
            { name: "functional_test" }, 
            { name: "visual_inspection" }, 
            { name: "glazing" }, 
            { name: "door_frames_and_assembly" }, 
            { name: "nothing_missing_broken" }, 
            { name: "door_clearances" }, 
            { name: "self_closing_operational" }, 
            { name: "coordinator" }, 
            { name: "latching_hardware" }, 
            { name: "auxiliary_hardware" }, 
            { name: "no_field_modifications" }, 
            { name: "gaskets_and_edge_seals" }, 
            { name: "door_label" }, 
            { name: "comments" }, 
	    { name: "risk_level" },
	    { name: "status" }

	  ]
	},
	{ # form.tabs[1]
	  "title": "GPS Location",
	  "icon-on": "ion-ios-location",
	  "icon-off": "ion-ios-location-outline",
	  "fields": [
	    { name: "latitude"  },
	    { name: "longitude" },
	    { name: "altitude"  },
	    { name: "accuracy"  }
	  ]
	}
      ],
      "templates": { # form.templates
      }
    },
    list: {
      fields: [ # list.fields
	{ name: ["_id", "tag_id"], template: "scan_id" },
	{ name: ["_id", "form_", "created_at", "updated_at", "risk_level", "status"], template: "data" }
      ],
      "templates": { # list.templates
	data:    "<div class=\"row\">"+
		   "<div class=\"col\"><b>"+
		     "Date</br>"+
		     "{{l_form_}}</br>"+
		     "{{l_risk_level}}</br>"+
		     "{{l_status}}</br>"+
		     "Photos</br></b>"+
		   "</div>"+
		   "<div class=\"col\">"+
		     "{{updated_at|date:'yyyy-MM-dd HH:mm:ss'}}</br>"+
		     "{{form_}}</br>"+
		     "{{risk_level}}</br>"+
		     "{{status}}</br>"+
		     "<div ng-bind=\"numberOfPhotos[scan._id]\"></div>"+
		   "</div>"+
		 "</div>"
      }
    }
  }
  def self.getForm
    return @@form
  end
end
