Skip to content

Commit c2cf833

Browse files
committed
updated with demolaw firm
1 parent b3bb7d6 commit c2cf833

File tree

4,496 files changed

+119
-497077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,496 files changed

+119
-497077
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
public/nodemodules/*
1+
nodemodules/*
2+
nodemodules

README.rdoc

100644100755
File mode changed.

client/company/company.css

100644100755
File mode changed.

client/company/company.html

100644100755
File mode changed.

client/company/company.jsx

100644100755
+107-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import {mount} from 'react-mounter'
3+
34
var america = [
45
{
56
'name': 'Alabama',
@@ -248,39 +249,84 @@ var countrylist = ['United States','Afghanistan','Albania','Algeria','Andorra','
248249
'Malta','Mauritania','Mauritius','Mexico','Moldova','Monaco','Mongolia','Montenegro','Montserrat','Morocco','Mozambique','Namibia','Nepal','Netherlands','Netherlands Antilles','New Caledonia','New Zealand','Nicaragua','Niger','Nigeria','Norway','Oman','Pakistan','Palestine','Panama',
249250
'Papua New Guinea','Paraguay','Peru','Philippines','Poland','Portugal','Puerto Rico','Qatar','Reunion','Romania','Russia','Rwanda','Saint Pierre & Miquelon','Samoa','San Marino','Satellite','Saudi Arabia','Senegal','Serbia','Seychelles','Sierra Leone','Singapore','Slovakia','Slovenia','South Africa',
250251
'South Korea','Spain','Sri Lanka','St Kitts & Nevis','St Lucia','St Vincent','St. Lucia','Sudan','Suriname','Swaziland','Sweden','Switzerland','Syria','Taiwan','Tajikistan','Tanzania','Thailand','Timor L\'Este','Togo','Tonga','Trinidad & Tobago','Tunisia','Turkey','Turkmenistan','Turks & Caicos','Uganda','Ukraine','United Arab Emirates','United Kingdom','Uruguay','Uzbekistan','Venezuela','Vietnam','Virgin Islands (US)','Yemen','Zambia','Zimbabwe'];
252+
251253
var MemberInfo = React.createClass({
254+
getInitialState: function(){
255+
var data = []
256+
for (var i = 0; i < this.props.companySize; i++) {
257+
data.push({
258+
contactname:'',
259+
contactemail:'',
260+
contactaddress:'',
261+
contactcity:''
262+
})
263+
}
264+
var state = {}
265+
state['data'] = data
266+
return state
267+
},
268+
handleChange: function(key,i){
269+
return function (e){
270+
var data = this.state.data;
271+
data[i][key] = e.target.value;
272+
this.setState({data:data});
273+
}.bind(this);
274+
},
275+
updateCompanySize: function(companySize) {
276+
var data = this.state.data
277+
for (var i = 0; i < companySize-data.length; i++) {
278+
data.push({
279+
contactname:'',
280+
contactemail:'',
281+
contactaddress:'',
282+
contactcity:''
283+
})
284+
}
285+
this.setState({data:data})
286+
},
252287
render: function(){
288+
253289
var repeated=[]
254290
for (var i = 0; i < this.props.companySize; i++) {
255-
256291
repeated.push((
257292
<div>
293+
<input type="text" name="contactname" placeholder="Full Legal Name" onChange={this.handleChange('contactname',i)} value={this.state.data[i].contactname}/>
294+
<input type="text" name="contactemail" placeholder="Email" onChange={this.handleChange('contactemail',i)} value={this.state.data[i].contactemail} />
295+
<textarea name="contactaddress" placeholder="Address" onChange={this.handleChange('contactaddress',i)} value={this.state.data[i].contactaddress}></textarea>
296+
<input type="text" name="contactcity" placeholder="City" onChange={this.handleChange('contactcity',i)} value={this.state.data[i].contactcity} />
297+
</div>
258298

259-
<input type="text" name="contactname" placeholder="Full Legal Name"/>
260-
<input type="text" name="email" placeholder="Email" />
261-
<textarea name="address" placeholder="Address"></textarea>
262-
<input type="text" name="city" placeholder="City" />
263299

264-
</div>
265300
))
266301
}
267302
return (<fieldset>
268303
<h2 className="fs-title">Contact Details</h2>
269304
<h3 className="fs-subtitle">Please enter contact information</h3>
270305
{repeated}
271-
<label><input type="button" name="previous" className="previous action-button" onClick={this.props.previousChange} value="Previous" /></label>
272-
<label><input type="submit" name="submit" className="submit action-button" value="Submit" /></label>
306+
<label><input type="button" name="previous" className="previous action-button" onClick={this.props.previousChange} value="Previous" /></label>
307+
<label><input type="submit" name="submit" className="submit action-button" value="Submit" onClick={this.props.storeDB(this.state)} /></label>
273308
</fieldset>)
274309
}
275310
})
276311
var Company = React.createClass({
277312
getInitialState: function(){
278313
return{
279314
companyType:'',
280-
companySize:1
315+
companySize:1,
316+
city:'',
317+
318+
address:'',
319+
phone:'',
320+
name:'DLA Piper',
321+
llc:'',
322+
corporation:'',
323+
state:'',
324+
country:'',
325+
membersinfo:'',
326+
lawfirm:this.props.lawfirm
281327
}
282328
},
283-
handleChange: function (key) {
329+
handleChange: function (key,type) {
284330
return function (e) {
285331
if(key=='llc' || key=='corporation'){
286332
this.setState({companyType:key})
@@ -289,8 +335,16 @@ var Company = React.createClass({
289335
}
290336

291337
var state = {};
292-
state[key] = e.target.value;
338+
if(type=='select')
339+
state[key]=e.target.options[e.target.selectedIndex].value
340+
else
341+
state[key] = e.target.value;
293342
this.setState(state);
343+
344+
if(key=='companySize') {
345+
this.refs.llcMemberInfo.updateCompanySize(e.target.value)
346+
this.refs.incMemberInfo.updateCompanySize(e.target.value)
347+
}
294348
}.bind(this);
295349
},
296350
previousChange: function(element){
@@ -330,6 +384,15 @@ var Company = React.createClass({
330384
easing: 'easeInOutBack'
331385
});
332386
},
387+
storeDB: function (membersinfo){
388+
return function(e){
389+
e.preventDefault()
390+
this.setState({membersinfo:membersinfo},function() {
391+
console.log(CompanyDb.insert);
392+
CompanyDb.insert(this.state)
393+
})
394+
}.bind(this)
395+
},
333396
nextChange: function (element){
334397
//jQuery time
335398
var current_fs, next_fs, previous_fs; //fieldsets
@@ -373,16 +436,24 @@ var Company = React.createClass({
373436
},
374437
render: function(){
375438
var companyType='';
439+
var self=this
376440
var options=america.map(function (current) {
377-
378-
return(<option value={current.name}> {current.name} </option>)
441+
return(<option value={current.name} selected={current==self.state.state}> {current.name} </option>)
379442
})
380-
var selectelem=React.createElement('select',{children:options})
381-
var countryselect=countrylist.map(function (current){
382-
return(<option value={current}>{current}</option>)
443+
var selectelem=(
444+
<select onChange={this.handleChange("state",'select')}>
445+
{options}
446+
</select>
447+
)
448+
var countryOptions=countrylist.map(function (current){
449+
return(<option value={current} selected={current==self.state.country}>{current}</option>)
383450
})
384451

385-
var selectcountry=React.createElement('select',{children:countryselect})
452+
var selectcountry=(
453+
<select onChange={this.handleChange("country",'select')}>
454+
{countryOptions}
455+
</select>
456+
)
386457

387458
var structure = (
388459
<fieldset>
@@ -403,11 +474,11 @@ var Company = React.createClass({
403474
<fieldset>
404475
<h2 className="fs-title">Company Details</h2>
405476
<h3 className="fs-subtitle">Basic information about your company</h3>
406-
<input type="text" name="name" placeholder="Full Legal Name"/>
407-
<input type="text" name="phone" placeholder="Phone" />
408-
<input type="text" name="email" placeholder="Email" />
409-
<textarea name="address" placeholder="Address"></textarea>
410-
<input type="text" name="city" placeholder="City" />
477+
<input type="text" name="name" placeholder="Full Legal Name" onChange={this.handleChange('name')}/>
478+
<input type="text" name="phone" placeholder="Phone" onChange={this.handleChange('phone')}/>
479+
<input type="text" name="email" placeholder="Email" onChange={this.handleChange('email')} />
480+
<textarea name="address" placeholder="Address" onChange={this.handleChange('address')}></textarea>
481+
<input type="text" name="city" placeholder="City" onChange={this.handleChange('city')} />
411482
State
412483
{selectelem}
413484
Country
@@ -428,6 +499,8 @@ var Company = React.createClass({
428499
)
429500
return (
430501
<div>
502+
<header id="title"><img src="/download.png"/>
503+
</header>
431504
<form id="msform">
432505
<ul id="progressbar">
433506
<li className="active">Incorporated As</li>
@@ -436,17 +509,25 @@ var Company = React.createClass({
436509
</ul>
437510
{structure}
438511
{details}
439-
<MemberInfo class={this.state.companyType==="llc" ? '':"hidden"} companySize={this.state.companySize} totalstock={false} previousChange={this.previousChange} />
440-
<MemberInfo class={this.state.companyType==="inc" ? '':"hidden"} companySize={this.state.companySize} totalstock={true} previousChange={this.previousChange} />
512+
<MemberInfo ref="llcMemberInfo" class={this.state.companyType==="llc" ? '':"hidden"} companySize={this.state.companySize} totalstock={false} storeDB={this.storeDB} previousChange={this.previousChange} />
513+
<MemberInfo ref="incMemberInfo" class={this.state.companyType==="inc" ? '':"hidden"} companySize={this.state.companySize} totalstock={true} storeDB={this.storeDB} previousChange={this.previousChange} />
441514
</form>
442515
</div>
443516
)
444517
}
445518

446519
})
447-
FlowRouter.route('/company',{
520+
521+
FlowRouter.route('/:company',{
448522
name: 'company',
449523
action: function(params, queryParams) {
450-
mount(Company);
524+
var lawprop=LawDb.findOne({name: params.company})
525+
String.prototype.capitalize = function(){
526+
return this.toLowerCase().replace( /\b\w/g, function (m) {
527+
return m.toUpperCase();
528+
});
529+
};
530+
var lawname = params.company.replace("-"," ").capitalize()
531+
mount(Company, {lawfirm: lawname});
451532
}
452533
});

client/company/reset.css

100644100755
File mode changed.

client/company/style.css

100644100755
+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ html {
1313
body {
1414
font-family: montserrat, arial, verdana;
1515
}
16+
header {
17+
text-align: center;
18+
font-size: 20px;
19+
}
20+
1621
/*form styles*/
1722
#msform {
1823
width: 400px;

client/home/home.html

100644100755
File mode changed.

client/home/home.jsx

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var ReactDOM = require('react-dom');
33
import {mount} from 'react-mounter';
44
var Dropzone = require('react-dropzone');
55

6-
LawFirms = new Mongo.Collection('lawfirms');
6+
LawDb = new Mongo.Collection('lawdb');
77

88
var DropzoneDemo = React.createClass({
99
getInitialState: function () {

client/home/reset.css

100644100755
File mode changed.

client/home/style.css

100644100755
File mode changed.

client/lib/lib.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//LawDb = new Mongo.Collection('lawdb');
2+
CompanyDb=new Mongo.Collection('companydb');

node_modules/.bin/envify

-1
This file was deleted.

node_modules/.bin/errno

-1
This file was deleted.

node_modules/.bin/esparse

-1
This file was deleted.

node_modules/.bin/esvalidate

-1
This file was deleted.

node_modules/.bin/json5

-1
This file was deleted.

node_modules/.bin/mkdirp

-1
This file was deleted.

node_modules/.bin/sha.js

-1
This file was deleted.

node_modules/.bin/uglifyjs

-1
This file was deleted.

node_modules/.bin/webpack

-1
This file was deleted.

node_modules/Base64/.npmignore

-2
This file was deleted.

node_modules/Base64/.travis.yml

-7
This file was deleted.

node_modules/Base64/LICENSE

-14
This file was deleted.

node_modules/Base64/Makefile

-42
This file was deleted.

node_modules/Base64/README.md

-34
This file was deleted.

0 commit comments

Comments
 (0)