diff --git a/client/src/pages/members/Members.js b/client/src/pages/members/Members.js index c4f4641..47caa0c 100644 --- a/client/src/pages/members/Members.js +++ b/client/src/pages/members/Members.js @@ -41,11 +41,16 @@ function Members(props) { const userCounts = await axios.get('http://localhost:8000/getUserVotes'); const totalProposals = await axios.get('http://localhost:8000/getProposalCount'); let users = response.data; + /* Add a attribute to each user that reflects the # of proposals they have voted on */ - userCounts.data.forEach(user => { - users[user.user_id - 1].count = user.count; + + userCounts.data.forEach(u => { + users.forEach(user => { + if (user.id == u.user_id) { user.count = u.count;} + }) }); + /* Initialize false attributes for each user; used for checkbox tracking while in editing mode */ users.forEach(user => { diff --git a/client/src/pages/proposalManagement/ProposalManagement.css b/client/src/pages/proposalManagement/ProposalManagement.css index f816b5f..b2d6509 100644 --- a/client/src/pages/proposalManagement/ProposalManagement.css +++ b/client/src/pages/proposalManagement/ProposalManagement.css @@ -68,11 +68,23 @@ .PMtextboxes{ width: 100%; height: 7%; + margin-bottom: 2%; +} + +.PMsponsor{ + width: 100%; + /* background-color: red; */ + height: 7%; } .titleNewProposal{ width : 100%; - height:100%; + height: 100%; +} + +.sponsorNewProposal{ + width : 100%; + height: 100%; } .descriptionNewProposal{ @@ -136,6 +148,11 @@ textarea { resize: none; } +.PMsponsor:focus { + outline: none; + resize: none; +} + .bottomThree:focus { outline: none; resize: none; diff --git a/client/src/pages/proposalManagement/ProposalManagement.js b/client/src/pages/proposalManagement/ProposalManagement.js index 40ca826..a5f02d0 100644 --- a/client/src/pages/proposalManagement/ProposalManagement.js +++ b/client/src/pages/proposalManagement/ProposalManagement.js @@ -30,6 +30,7 @@ function ProposalManagement(props) { }, []); const[textboxValueTitle, setTextboxValueTitle] = React.useState(''); + const[textboxValueSponsor, setTextboxValueSponsor] = React.useState(''); const[textboxValueDescript, setTextboxValueDescript] = React.useState(''); const[textboxValueLink, setTextboxValueLink] = React.useState(''); const[textboxValueMoney, setTextboxValueMoney] = React.useState(''); @@ -83,6 +84,7 @@ function ProposalManagement(props) { url: 'http://localhost:8000/submitProposal', data: { title: textboxValueTitle, + organization: textboxValueSponsor, amount_requested: (isNaN(parseFloat(textboxValueMoney)) ? 0 : parseFloat(textboxValueMoney)), link: textboxValueLink, description_text: textboxValueDescript @@ -94,6 +96,7 @@ function ProposalManagement(props) { console.log(error.stack); } setTextboxValueTitle(''); + setTextboxValueSponsor(''); setTextboxValueDescript(''); setTextboxValueLink(''); setTextboxValueMoney(''); @@ -196,6 +199,9 @@ function ProposalManagement(props) {