diff --git a/front/current/assets/styles/components/_project.scss b/front/current/assets/styles/components/_project.scss index ebff1e9362d6f3fff07f4d6ad54374e1823f0ddf..7863b3ba51450ae1632b0d365e703a81a02377e5 100644 --- a/front/current/assets/styles/components/_project.scss +++ b/front/current/assets/styles/components/_project.scss @@ -62,10 +62,62 @@ project { } document-slots { - display: block; - flex-grow: 1; - overflow: auto; - padding: 10px; + overflow-x: auto; + overflow-y: auto; + white-space: nowrap; + + .timeline-track { + width: 100%; + height: 10px; + background: $light-gray; + position: relative; + top: 45px; + } + + state { + display: inline-block; + vertical-align: top; + width: 600px; + + .content_padding { + padding-left : 10px; + padding-right: 10px; + padding-bottom: 10px; + } + + h3 { + color: gray; + padding-bottom:10px; + margin-top: 15px; + } + + p { + color: #838383; + white-space: normal; + } + + .oval{ + position: relative; + width: auto; + display: table; + height: 80px; + background: $light-gray; + border-radius: 40px; + + padding: 20px; + + margin-left: 20px; + margin-right: 40px; + + h3 { + display: table-cell; + padding: 0; + text-align: center; + vertical-align: middle; + color: $white; + } + } + } document-slot { display: block; @@ -81,23 +133,4 @@ project { } } } - - .c_states{ - white-space: nowrap; - overflow-x:scroll; - } - - states{ - border-top: 5px solid black; - - state { - display: inline-block; - padding: 10px; - width: auto; - - h4 { - color: $light-gray; - } - } - } } diff --git a/front/current/components/project/detail.component.html b/front/current/components/project/detail.component.html index 9d19eef192146ffaae520744bf727de12c096cd3..6a44d20b5546cabc2eee46880a3655834b3e40c4 100644 --- a/front/current/components/project/detail.component.html +++ b/front/current/components/project/detail.component.html @@ -36,4 +36,3 @@ [(document_slots)]="document_slots" [(documents)]="documents" > - diff --git a/front/current/components/project/detail.component.ts b/front/current/components/project/detail.component.ts index 4a44f63dd4a7450850f215c0aacdeaca823605aa..14adba223ca639984a06807893dec439a65437d8 100644 --- a/front/current/components/project/detail.component.ts +++ b/front/current/components/project/detail.component.ts @@ -15,13 +15,11 @@ import { DocumentService } from '../../services/document/document.service'; import { AddressComponent } from './address.component'; import { ContactsComponent } from './contacts.component'; import { SlotsComponent } from './slots.component'; -import { StateComponent } from './state.component'; -import { StatesComponent } from './states.component'; @Component({ selector: 'project', templateUrl: config.static_url + '/components/project/detail.component.html', - directives: [ROUTER_DIRECTIVES, AddressComponent, ContactsComponent, SlotsComponent, StateComponent, StatesComponent] + directives: [ROUTER_DIRECTIVES, AddressComponent, ContactsComponent, SlotsComponent] }) export class ProjectDetailComponent implements OnInit { constructor( diff --git a/front/current/components/project/slot.component.html b/front/current/components/project/slot.component.html index 4bd89997b8842d2eb7d1328054e2befb7a26ab24..583df8d9d51180b02cd8d7927919a33e3b75a6dc 100644 --- a/front/current/components/project/slot.component.html +++ b/front/current/components/project/slot.component.html @@ -1,6 +1,14 @@
{{ slot.title }}
diff --git a/front/current/components/project/slot.component.ts b/front/current/components/project/slot.component.ts index 8652b0b6985f9e0ae5ed0091c17d7511ca4ab3e7..fb5e270cdda5243fb91e45703c3a8b1f9fdf709a 100644 --- a/front/current/components/project/slot.component.ts +++ b/front/current/components/project/slot.component.ts @@ -11,7 +11,7 @@ declare var moment:any; selector: 'document-slot', templateUrl: config.static_url + '/components/project/slot.component.html', inputs: [ - 'project', 'slot', 'document_slots', 'documents', 'parent_documents', + 'project', 'slot', 'documents', 'parent_documents', 'parent_document_slots'], directives: [NewDocumentSlotComponent] }) diff --git a/front/current/components/project/slots.component.html b/front/current/components/project/slots.component.html index e851a9b0dcbd0921cbb62fbb411be2d9afedb6ea..28149d2fd4f597fddb459d7495d1adf6b0e6d79e 100644 --- a/front/current/components/project/slots.component.html +++ b/front/current/components/project/slots.component.html @@ -1,16 +1,13 @@ -

Documents

-

- +
diff --git a/front/current/components/project/slots.component.ts b/front/current/components/project/slots.component.ts index 566a592380a70edb6125340194afe3aa4a1ba4c8..489b06e1ff68c47ce7030a14484fa56632282980 100644 --- a/front/current/components/project/slots.component.ts +++ b/front/current/components/project/slots.component.ts @@ -1,91 +1,59 @@ import { Component } from 'angular2/core'; - import { config } from '../../config'; - -import { RestService, Model, Collection } from '../../services/rest.service'; -import { DocumentSlotService } from '../../services/project/document-slot.service'; -import { DocumentService } from '../../services/document/document.service'; - -import { SlotComponent } from './slot.component'; +import { Model, Collection } from '../../services/rest.service'; +import { ProjectService } from '../../services/project/project.service'; +import { StateComponent } from './state.component'; @Component({ selector: 'document-slots', templateUrl: config.static_url + '/components/project/slots.component.html', inputs: ['project', 'document_slots', 'documents'], - directives: [SlotComponent] + directives: [StateComponent] }) export class SlotsComponent { constructor( - private _restService:RestService, - public documentSlotService:DocumentSlotService, - public documentService:DocumentService + public projectService:ProjectService ) {}; slots:any[] = [ - {name: 'utility-bills', title: 'Utility Bills'}, - {name: 'breakdown-of-bills', title: 'Breakdown of Bills'}, - {name: 'canvas', title: 'Canvas'}, - {name: 'pns', title: 'PNS Form'}, - {name: 'pictures', title: 'Pictures'}, - {name: 'sketches', title: 'Sketches'}, - {name: 'heat-load', title: 'Heat Load'}, - {name: 'cooling-load', title: 'Cooling Load'}, - {name: 'diagnostic-report', title: 'Diagnostic Report'}, - {name: 'sceep-forms', title: 'SCEEP Forms'}, - {name: 'pea-reports', title: 'PEA Reports'}, - {name: 'balance-sheets', title: 'Balance Sheets'}, - {name: 'income-statements', title: 'Income Statements'}, - {name: 'financial-reports', title: 'Financial Reports'}, - {name: 'taxes', title: 'Taxes'}, - {name: 'credit-reports', title: 'Credit Reports'}, - {name: 'certificate-of-incorporation', title: 'Certificate of Incorporation'}, - {name: 'bank-statements', title: 'Bank Statements'}, - {name: '501(c)3-confirmation', title: '501(c)3 Confirmation'}, - {name: 'proof-of-insurance', title: 'Proof of Property and Liability Insurance'}, - {name: 'property-appraisal', title: 'Property Appraisal'}, - {name: 'title-of-location', title: 'Title of Location'}, - {name: 'nyserda', title: 'NYSERDA Request for Financing Form'}, - {name: 'loan-application', title: 'Loan Application'}, - {name: 'contractor-quotes', title: 'Contractor Quotes'}, - {name: 'misc', title: 'Miscellaneous'} - ] - project:Model + {name: 'utility-bills', title: 'Utility Bills', state_id: 3}, + {name: 'breakdown-of-bills', title: 'Breakdown of Bills', state_id: 8}, + {name: 'canvas', title: 'Canvas', state_id: 9}, + {name: 'pns', title: 'PNS Form', state_id: 4}, /*Contains multiple PNS Forms for each department, 10, 11*/ + {name: 'pictures', title: 'Pictures', state_id: 9}, + {name: 'sketches', title: 'Sketches', state_id: 9}, + {name: 'heat-load', title: 'Heat Load', state_id: 8}, /* Also in state 12*/ + {name: 'cooling-load', title: 'Cooling Load', state_id: 12}, + {name: 'diagnostic-report', title: 'Diagnostic Report', state_id: 13}, + {name: 'sceep-forms', title: 'SCEEP Forms', state_id: 3}, + {name: 'pea-reports', title: 'PEA Reports', state_id: 3}, + {name: 'balance-sheets', title: 'Balance Sheets', state_id: 6}, + {name: 'income-statements', title: 'Income Statements', state_id: 3}, + {name: 'financial-reports', title: 'Financial Reports', state_id: 6}, /*Is it 4 or 6*/ + {name: 'taxes', title: 'Taxes', state_id: 3}, + {name: 'credit-reports', title: 'Credit Reports', state_id: 3}, + {name: 'certificate-of-incorporation', title: 'Certificate of Incorporation', state_id: 3}, + {name: 'bank-statements', title: 'Bank Statements', state_id: 3}, + {name: '501(c)3-confirmation', title: '501(c)3 Confirmation', state_id: 3}, + {name: 'proof-of-insurance', title: 'Proof of Property and Liability Insurance', state_id: 3}, + {name: 'property-appraisal', title: 'Property Appraisal', state_id: 3}, + {name: 'title-of-location', title: 'Title of Location', state_id: 3}, + {name: 'nyserda', title: 'NYSERDA Request for Financing Form', state_id: 40}, + {name: 'loan-application', title: 'Loan Application', state_id: 40}, + {name: 'contractor-quotes', title: 'Contractor Quotes', state_id: 30}, + {name: 'misc', title: 'Miscellaneous', state_id: 1} + ]; + project:Model; document_slots:Collection; documents:Collection; - public getDocumentSlots(slot:any) { - // Gets a subset of document slots for the given slot description. - let documentSlots = []; - let collection = this._restService.Collection(this.documentSlotService, []); - - for (let documentSlot of this.document_slots.models) { - if (documentSlot.data['role'] == slot.name) - documentSlots.push(documentSlot); + public getDocumentSlotsForState(state_id: number) { + let state_slots = []; + for (let slot of this.slots) { + if(slot.state_id == state_id) + state_slots.push(slot); } - - collection.models = documentSlots; - return collection; + return state_slots; }; - - public getDocuments(slot:any) { - // Gets a subset of documents for the given slot description. - let documents = []; - let collection = this._restService.Collection(this.documentService, []); - let document_slots = this.getDocumentSlots(slot); - let keys = []; - - for (let document_slot of document_slots.models) { - let key = document_slot.data['document_key']; - keys.push(key); - } - - for (let document_ of this.documents.models) { - if (keys.indexOf(document_.data['key']) > -1) - documents.push(document_); - } - - collection.models = documents; - return collection; - } }; diff --git a/front/current/components/project/state.component.html b/front/current/components/project/state.component.html index deeec4150d60562fa910d4b1ea3f103332cd49f7..08181ebd942eaee75103d427232a5970a582338f 100644 --- a/front/current/components/project/state.component.html +++ b/front/current/components/project/state.component.html @@ -1,7 +1,18 @@ -

{{state.name}}

-
-
-

{{state.description}}

-
- +
+
+

{{state.name}}

+
+
+

{{state.description}}

+ +

Documents:

+ +
diff --git a/front/current/components/project/state.component.ts b/front/current/components/project/state.component.ts index 179761e17b30419e623264d4d6432a5a058eaa49..14b86f12929f61aef9fb4f37c506e39d4d4a932a 100644 --- a/front/current/components/project/state.component.ts +++ b/front/current/components/project/state.component.ts @@ -1,12 +1,64 @@ import { Component } from 'angular2/core'; import { config } from '../../config'; +import { SlotComponent } from './slot.component'; +import { Collection, Model, RestService } from '../../services/rest.service'; +import { DocumentSlotService } from '../../services/project/document-slot.service'; +import { DocumentService } from '../../services/document/document.service'; @Component({ - selector: 'state', - templateUrl: config.static_url + '/components/project/state.component.html', - inputs: ['state'] + selector: 'state', + templateUrl: config.static_url + '/components/project/state.component.html', + inputs: ['state', 'state_slots','project','document_slots','documents'], + directives: [SlotComponent] }) + export class StateComponent{ - public state: any; + public state: any; + public state_slots: any[]; + public project:Model; + public document_slots:Collection; + public documents:Collection; + + constructor( + private _restService:RestService, + public documentSlotService:DocumentSlotService, + public documentService:DocumentService + ){ + } + + public getDocumentSlots(slot:any) { + // Gets a subset of document slots for the given slot description. + let documentSlots = []; + let collection = this._restService.Collection(this.documentSlotService, []); + + for (let documentSlot of this.document_slots.models) { + if (documentSlot.data['role'] == slot.name) + documentSlots.push(documentSlot); + } + + collection.models = documentSlots; + return collection; + }; + + public getDocuments(slot:any) { + // Gets a subset of documents for the given slot description. + let documents = []; + let collection = this._restService.Collection(this.documentService, []); + let document_slots = this.getDocumentSlots(slot); + let keys = []; + + for (let document_slot of document_slots.models) { + let key = document_slot.data['document_key']; + keys.push(key); + } + + for (let document_ of this.documents.models) { + if (keys.indexOf(document_.data['key']) > -1) + documents.push(document_); + } + + collection.models = documents; + return collection; + } }; diff --git a/front/current/components/project/states.component.html b/front/current/components/project/states.component.html deleted file mode 100644 index 160b4a36fcd353d660579aa526f2cf81fa18cb21..0000000000000000000000000000000000000000 --- a/front/current/components/project/states.component.html +++ /dev/null @@ -1,6 +0,0 @@ -
- -
diff --git a/front/current/components/project/states.component.ts b/front/current/components/project/states.component.ts deleted file mode 100644 index 1b48ade5d24abb3bd11697c90163932df427f9c5..0000000000000000000000000000000000000000 --- a/front/current/components/project/states.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component } from 'angular2/core'; -import { config } from '../../config'; -import { StateComponent } from './state.component'; -import { ProjectService } from '../../services/project/project.service'; - - -@Component({ - selector: 'states', - templateUrl: config.static_url + '/components/project/states.component.html', - inputs: ['currentState'], - directives: [StateComponent] -}) -export class StatesComponent{ - public currentState: any; /*Points to current state*/ - - constructor( - public projectService:ProjectService - ){}; -};