Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions client/src/pages/members/Members.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <count> 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 <checked> attributes for each user; used for checkbox tracking
while in editing mode */
users.forEach(user => {
Expand Down
19 changes: 18 additions & 1 deletion client/src/pages/proposalManagement/ProposalManagement.css
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -136,6 +148,11 @@ textarea {
resize: none;
}

.PMsponsor:focus {
outline: none;
resize: none;
}

.bottomThree:focus {
outline: none;
resize: none;
Expand Down
6 changes: 6 additions & 0 deletions client/src/pages/proposalManagement/ProposalManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down Expand Up @@ -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
Expand All @@ -94,6 +96,7 @@ function ProposalManagement(props) {
console.log(error.stack);
}
setTextboxValueTitle('');
setTextboxValueSponsor('');
setTextboxValueDescript('');
setTextboxValueLink('');
setTextboxValueMoney('');
Expand Down Expand Up @@ -196,6 +199,9 @@ function ProposalManagement(props) {
<div className = "PMtextboxes">
<textarea value={textboxValueTitle} onChange={(event) => {setTextboxValueTitle(event.target.value)}} className= 'titleNewProposal' id='titleNewProposal' type='textarea' placeholder='Title'/>
</div>
<div className = "PMsponsor">
<textarea value={textboxValueSponsor} onChange={(event) => {setTextboxValueSponsor(event.target.value)}} className= 'sponsorNewProposal' id='sponsorNewProposal' type='textarea' placeholder='Sponsor'/>
</div>
<textarea value={textboxValueDescript} onChange={(event) => {setTextboxValueDescript(event.target.value)}} className= 'descriptionNewProposal' id='descriptionNewProposal' type='textarea' placeholder='Project description'/>
<div className = "bottomThree">
<textarea value={textboxValueLink} onChange={(event) => {setTextboxValueLink(event.target.value)}} className= 'linkNewDescription' id='linkNewDescription' type='textarea' placeholder='Link'/>
Expand Down
31 changes: 16 additions & 15 deletions db/tgif.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CREATE TABLE proposals
(
id SERIAL PRIMARY KEY,
title VARCHAR,
sponsor VARCHAR,
organization VARCHAR,
amount_requested FLOAT,
link VARCHAR,
Expand Down Expand Up @@ -96,34 +97,34 @@ VALUES
('Non-Voting Member', 'Samantha Deng', '[email protected]', 'Committee on Student Fees Representative'),
('Non-Voting Member', 'Judy Chess', '[email protected]', 'Capital Planning Representative');

INSERT INTO proposals(title, organization, amount_requested, link, description_text)
INSERT INTO proposals(title, sponsor, organization, amount_requested, link, description_text)
VALUES
('Mapping for Environmental Justice', 'MEJ Team', 63000.00,
('Mapping for Environmental Justice', 'Sponsor1', 'MEJ Team', 63000.00,
'https://drive.google.com/file/d/1zZOT5lvYHwAacLNttcJ4K1_IzjZOvN2Z/view', 'Mapping for Environmental Justice (MEJ) is an
initiative to create interactive and publicly-accessible maps displaying
environmental justice data for individual states.'),
('Earth Action Initiative', 'Earth Action Initiative', 16000,
('Earth Action Initiative', 'Sponsor1', 'Earth Action Initiative', 16000,
'https://drive.google.com/file/d/1FiIFzVHEkDH9kJQFeAFPZoZHOJQ6ehFa/view',
'The Earth Action Initiative will organize a variety of events and actions that build community,
leverage existing efforts, inspire new plans, and find innovative ways to execute these actions through effective communication.'),
('Berkeley Student Farms Seed Library', 'Berkeley Seed Library', 3652.12,
('Berkeley Student Farms Seed Library', 'Sponsor1', 'Berkeley Seed Library', 3652.12,
'https://drive.google.com/file/d/14svG4x5BfSu6Qdul0mCe6heZqcBQgFfV/view', 'The seed library
will address a foundational barrier of access to the start-up resources necessary
for expanding and sustaining the many gardens across campus that help grow food security.'),
('#OurEnvironmentalism', 'Grad Student Assembly', 5000, 'https://drive.google.com/file/d/1oCsX9tHY_Y6BbVF1X4-n07HM3PgrBidb/view',
('#OurEnvironmentalism', 'Sponsor1', 'Grad Student Assembly', 5000, 'https://drive.google.com/file/d/1oCsX9tHY_Y6BbVF1X4-n07HM3PgrBidb/view',
'The #OurEnvironmentalism campaign seeks to reclaim the legacies of environmentalism
and sustainability for communities of color and challenge the white-dominated, inaccessible
narrative of modern environmentalism by sharing personal stories of sustainability, highlighting
EJ-focused students and activists of color on Cal’s campus'),
('Planting native milkweed habitat for monarch butterflies', 'Global Environment Theme House (GETH)', 500.00,
('Planting native milkweed habitat for monarch butterflies', 'Sponsor1', 'Global Environment Theme House (GETH)', 500.00,
'https://drive.google.com/file/d/1rKuWMsG0C95efVuNm8VU7edWnzsl2dkP/view', 'This proposal seeks to
plant native California milkweed plants in demonstration plots on Clark Kerr campus as an educational project as part
of the Global Environment Theme House (GETH).'),
('BerkeleyMoves! Carsharing Pilot', 'UC Berkeley Parking & Transportation', 15000, 'https://drive.google.com/file/d/1oJ_PjD6vheiUPqUP2jkMAjPg7NEhzU08/view',
('BerkeleyMoves! Carsharing Pilot', 'Sponsor1', 'UC Berkeley Parking & Transportation', 15000, 'https://drive.google.com/file/d/1oJ_PjD6vheiUPqUP2jkMAjPg7NEhzU08/view',
'The UC Berkeley Parking & Transportation Berkeley Moves! Alternative Transportation Unit provides active and alternative
transportation solutions to the entire Cal community. P&T will be testing the use and need for carsharing to the students, primarily
those who are in need, through the use of subsidizing memberships and/or driving credits.'),
('Biofuels Technology R&D and Procurement', 'Biofuels Technology Club (BTC)', 7055.53,
('Biofuels Technology R&D and Procurement', 'Sponsor1', 'Biofuels Technology Club (BTC)', 7055.53,
'https://drive.google.com/file/d/1wGtKrvS1JvxmjJELkGeTe0cMOdf8uSao/view',
'Biofuels Technology Club (BTC) seeks to create a sustainable loop on campus by converting the dining hall waste cooking oil into biodiesel
for use in campus vehicles. Combustion of biodiesel produces 78% less carbon dioxide than the combustion of ordinary diesel fuel. In addition,
Expand All @@ -135,35 +136,35 @@ VALUES
production of quality biodiesel. The Finance and Logistics Teams enable biodiesel production by acquiring funding, ensuring safety, and managing waste
removal. In addition to production of high quality biodiesel, BTC seeks to educate the campus community on green technology through a Sustainability Seminar
Series, as managed by the Outreach Team.'),
('Climate Fix Radio and Podcast', 'UC Berkeley Schools of Law and Journalism', 32911, 'https://drive.google.com/file/d/185XJR0ZIPWab5M4KYItz6rn5f7zaGOI9/view',
('Climate Fix Radio and Podcast', 'Sponsor1', 'UC Berkeley Schools of Law and Journalism', 32911, 'https://drive.google.com/file/d/185XJR0ZIPWab5M4KYItz6rn5f7zaGOI9/view',
'Climate Fix is a 90 second “bite-sized” audio clip produced by a partnership between the UC Berkeley Schools of Law and Journalism, featuring timely climate interviews with compelling
scientists, innovators, organizers, and leaders offering climate solutions and other examples of progress on climate change.'),
('Capturing Energy Savings from VAV Box Minimums', 'CEDR, Paul Raftery', 49937, 'https://drive.google.com/file/d/1VMYoFiws1LDQrRO6IsL0u1DQoA4nJlHq/view',
('Capturing Energy Savings from VAV Box Minimums', 'Sponsor1', 'CEDR, Paul Raftery', 49937, 'https://drive.google.com/file/d/1VMYoFiws1LDQrRO6IsL0u1DQoA4nJlHq/view',
'This project will move the campus towards carbon neutrality by reducing campus energy waste and the associated emissions, by reducing minimum airflows without changing the amount of ventilation (fresh) air entering the building.'),
('Cal Enviro Water Treatment', 'Cal Environmental Team (Cal Enviro)', 19010, 'https://drive.google.com/file/d/1KucszcV2JDSzYNXfafnTitJgPoBb4Hj6/view',
('Cal Enviro Water Treatment', 'Sponsor1', 'Cal Environmental Team (Cal Enviro)', 19010, 'https://drive.google.com/file/d/1KucszcV2JDSzYNXfafnTitJgPoBb4Hj6/view',
'Cal Environmental Team (Cal Enviro) is a Civil and Environmental Engineering (CEE) competition team and DeCal. Our mission is to impart the fundamentals
of wastewater treatment and sustainable engineering design, provide hands-on laboratory and construction experience, and opportunities for students to
improve their public speaking and technical writing skills.'),
('Reducing the Impact of Chemical Education', 'Laura Fredriksen', 6000, 'https://drive.google.com/file/d/1ZjACJY8FlArOKL4veg4t5CZNX0A9FGXC/view',
('Reducing the Impact of Chemical Education', 'Sponsor1', 'Laura Fredriksen', 6000, 'https://drive.google.com/file/d/1ZjACJY8FlArOKL4veg4t5CZNX0A9FGXC/view',
'The nature of chemical instruction can often produce unintended adverse environmental results. In 2016, our General Chemistry course series underwent an unprecedented
redesign. In addition to fully integrating green chemistry learning goals into both the majors and non-majors series, we also made steps toward reducing the environmental impact of
the course through lower student preparation volumes, elimination of hazardous chemicals, and using renewable resources where possible. As a next step, we are now turning toward our instruction of
Organic Chemistry courses. we will 1) measure the baseline environmental impact of solvent release from Organic Chemistry laboratory instruction of at least one course, 2) measure the harm reduction by
the purchase and implementation of an upgraded solvent-evaporation system, 3) identify major environmental concerns that the Instructional Unit can prioritize, and 4) identify key learning goals that can
be introduced as part of an Organic Chemistry curriculum redesign. This study will be lead by a team of undergraduates, and their work will be paid by this award. These students will also be empowered by staff
and faculty to engage the larger class of chemistry students in the discussion and study of green chemistry concepts while they undertake this study.'),
('The Team Writers Program at the Leaflet', 'The Student Environmental Resource Center (SERC)', 10102.32, 'https://drive.google.com/file/d/1PSPFeoJNlyQwGlQD3pCbI5q9HQh8TQc9/view',
('The Team Writers Program at the Leaflet', 'Sponsor1', 'The Student Environmental Resource Center (SERC)', 10102.32, 'https://drive.google.com/file/d/1PSPFeoJNlyQwGlQD3pCbI5q9HQh8TQc9/view',
'As the only undergraduate student-run environmental publication in the University of California system, The Leaflet has broadened its mission to cover a wider array of environmental
subjects that pertain to both local, regional, and global communities. This funding will allow The Leaflet to financially support its writers and, as a result, benefit both the publication and the
Berkeley community. By hiring committed writers through a funded Staff Writer Program, the Leaflet will be able to increase the quality and number of written pieces, increase the publication’s operational
capacity, and provide a space for professional development. This grant would also allow students from low-income or non-traditional backgrounds to gain experience writing for a campus publication, strengthen
their understanding of environmental communications, and allow for a more diverse group of writers who may not have the capacity or the financial background to write for the publication as a part-time volunteer.'),
('Zero Waste Fellow', 'Kira Stoll, Office of Sustainability', 11725.92, 'https://drive.google.com/file/d/17GNLxN5t29AizKR__X93Cs_EvEIhgU3t/view',
('Zero Waste Fellow', 'Sponsor1', 'Kira Stoll, Office of Sustainability', 11725.92, 'https://drive.google.com/file/d/17GNLxN5t29AizKR__X93Cs_EvEIhgU3t/view',
'At UC Berkeley, over a dozen organizations (both departmental and student-led) work on waste-related issues. Until 2019, collaboration and communication among them was minimal
and ineffective. The Zero Waste Coalition was established in Fall 2019 to allow for successful collaboration among organizations and to mobilize educational campaigns reaching over 5,000 students. Strong leadership within
the zero waste community is vital to its continued progress, and the creation of the Zero Waste Fellow position (similar to Carbon Neutrality or Engagement Fellows) will allow for institutionalized leadership that will
continue to build upon and expand zero waste work. This position will effectively institutionalize the Zero Waste Coalition, Zero Waste October, Compost Week, and Move Out programming.'),
('Resilient Sustainability Community Fellows', 'SERC, RSSP, OS', 46893, 'https://drive.google.com/file/d/1s2wyV1nAgPlBsFFQLbkUnnLXuO1vBwMi/view',
('Resilient Sustainability Community Fellows', 'Sponsor1', 'SERC, RSSP, OS', 46893, 'https://drive.google.com/file/d/1s2wyV1nAgPlBsFFQLbkUnnLXuO1vBwMi/view',
'This Spring, the COVID- 19 global pandemic has radically shifted seniors’ last semesters at UC Berkeley and will most likely affect the career opportunities and job availability after
graduation in the sustainability community. This project hopes to provide up to seven (7) post-baccalaureate fellowships; with priority given to graduating seniors, but all students who may
have been impacted by COVID-19 will be eligible. These fellowships will offer graduating seniors the ability to continue their environmental work on campus for three additional months and to advance a variety
Expand Down
7 changes: 6 additions & 1 deletion server/db-connection.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require('dotenv').config();

const { Pool } = require('pg');
const poolConfig = process.env.DATABASE_URL
? { connectionString: process.env.DATABASE_URL }
: { database: 'tgif' };

console.log("DATABASE_URL: ")
console.log(process.env.DATABASE_URL)

const pool = new Pool(poolConfig);

require('dotenv').config();


module.exports = pool;

Expand Down