Example #1
0
def project_signup():
    print 'signup'
    signup_form = ProjectForm()
    if current_user.is_proposer():
        if signup_form.validate_on_submit():
            new_project = Project.create(signup_form.name.data, current_user, signup_form.description.data, 
                        signup_form.time_estimate.data, signup_form.difficulty.data)
            return redirect('/project/%d' % new_project.id)
    else:
        abort(401)
    return render_template('project.signup.html', signup_form = signup_form)
Example #2
0
 def get_suggestions():
     pending_projects = Project.get_all_pending_projects()
     skills = current_user.get_skills()
     suggestions = []
     skills_needed = []
     for p in pending_projects:
         skills_needed = p.get_skills()
         for s in skills:
             if s in skills_needed:
                 suggestions.append(p)
                 break
     return suggestions
Example #3
0
def project_signup():
    print 'signup'
    signup_form = ProjectForm()
    if current_user.is_proposer():
        if signup_form.validate_on_submit():
            new_project = Project.create(signup_form.name.data, current_user,
                                         signup_form.description.data,
                                         signup_form.time_estimate.data,
                                         signup_form.difficulty.data)
            return redirect('/project/%d' % new_project.id)
    else:
        abort(401)
    return render_template('project.signup.html', signup_form=signup_form)
Example #4
0
def project_unapply(id=None):
    if id == None:
        abort(404)         

    project = Project.find(id)
    if project == None:
        abort(404)

    if current_user not in project.developers.all():
        abort(400)

    project.remove_developer(current_user)

    return redirect('/project/%d' % id) 
Example #5
0
def project_apply(id=None):
    if id == None:
        abort(404)         

    project = Project.find(id)
    if project == None:
        abort(404)

    if current_user in project.developers.all():
        abort(400)

    new_thread = MessageThread.create([project.proposer, current_user])
    initial_message = Message.create(new_thread, current_user, 'Hi! I would like to work on your project!')

    project.add_developer(current_user)

    return redirect('/project/%d' % id) 
Example #6
0
def project_page(id=None):
    if id == None:
        abort(404)         
    project = Project.find(id)
    if project == None:
        abort(404)
    
    project_data = { 'name': project.name,
                     'id': project.id,
                     'state': project.state,
                     'proposer': project.proposer,
                     'difficulty': project.difficulty,
                     'time_estimate': project.time_estimate,
                     'description': project.description,
                     'attachments': project.get_attachments(),
                     'skills_needed': project.get_skills(),
                     'currently_working': project.get_current_developers() }

    return render_template('project.html', project=project_data, 
            current_user=current_user)
Example #7
0
Microsoft=User.create("Microsoft", "*****@*****.**", "apple", ROLES.PROPOSER)
Microsoft.set_bio("Whether you are creating new code, algorithms or data structures, you are the link between abstract concepts and the technology products used daily by your friends, family and millions of other people around the world. While working on our projects you will improve your technical skills and develop next-generation software!")

# Create Skills
someSkills = ["Java", "C++","JavaScript", "C", "Python", "Web Dev"]
skillObjects = map(Skill,someSkills);
map(db.session.add, skillObjects)
db.session.commit()

# Add skills to users
map(andrew.add_skill, skillObjects)
map(nic.add_skill, skillObjects)
map(Ilija.add_skill, skillObjects)

# Create Projects
names = ["Project", "Awesome Project", "Even Awesomer Project", "Super Awesome Project", "Super Duper Awesomer Project"]
for name in names:
    project = Project(name, sachin, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend tellus a tortor consequat, sit amet hendrerit massa hendrerit. Mauris nec lacus tortor. Praesent dictum erat at tortor varius gravida. Nulla ac orci eu risus pretium pulvinar. Nam vitae odio orci. Donec elit eros, hendrerit at diam id, eleifend placerat augue. Pellentesque sapien leo, imperdiet eget augue eu, adipiscing placerat urna. Maecenas diam ante, sodales non rhoncus eget, dictum sed libero.", "9000", "0")
    project.add_skill(skillObjects[1])
    if name == "Project":
    	project.add_developer(andrew)
    if name == "Even Awesomer Project":
    	project.add_developer(andrew)
    	project.set_complete()
    db.session.add(project)
db.session.commit()

project = Project("Spreadsheet", Microsoft, "Implement a spreadsheet for entering, modeling and viewing numerical data. Spreadsheet needs to have the ability to represent and evaluate symbolic expressions which are stored in, and can refer to other, cells. Cells are reffered to by a combination of their column and row names. Each cell can contain some text, reffered to as the cell's expression. A user can edit the expression in any cell, and when editing is finished, the expression is interpreted by the cell to produce the value which the cell displays. Feel free to design and structure your classes as you like, however, you may find an attached suggested design useful.", "20", "7")
project.add_skill(skillObjects[0])
db.session.commit()
Example #8
0
def project_list():
    project_list = Project.get_all_current_projects()
    
    return render_template('projects.html', project_list = project_list)
Example #9
0
map(db.session.add, skillObjects)
db.session.commit()

# Add skills to users
map(andrew.add_skill, skillObjects)
map(nic.add_skill, skillObjects)
map(Ilija.add_skill, skillObjects)

# Create Projects
names = [
    "Project", "Awesome Project", "Even Awesomer Project",
    "Super Awesome Project", "Super Duper Awesomer Project"
]
for name in names:
    project = Project(
        name, sachin,
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend tellus a tortor consequat, sit amet hendrerit massa hendrerit. Mauris nec lacus tortor. Praesent dictum erat at tortor varius gravida. Nulla ac orci eu risus pretium pulvinar. Nam vitae odio orci. Donec elit eros, hendrerit at diam id, eleifend placerat augue. Pellentesque sapien leo, imperdiet eget augue eu, adipiscing placerat urna. Maecenas diam ante, sodales non rhoncus eget, dictum sed libero.",
        "9000", "0")
    project.add_skill(skillObjects[1])
    if name == "Project":
        project.add_developer(andrew)
    if name == "Even Awesomer Project":
        project.add_developer(andrew)
        project.set_complete()
    db.session.add(project)
db.session.commit()

project = Project(
    "Spreadsheet", Microsoft,
    "Implement a spreadsheet for entering, modeling and viewing numerical data. Spreadsheet needs to have the ability to represent and evaluate symbolic expressions which are stored in, and can refer to other, cells. Cells are reffered to by a combination of their column and row names. Each cell can contain some text, reffered to as the cell's expression. A user can edit the expression in any cell, and when editing is finished, the expression is interpreted by the cell to produce the value which the cell displays. Feel free to design and structure your classes as you like, however, you may find an attached suggested design useful.",
    "20", "7")
project.add_skill(skillObjects[0])
Example #10
0
def project_list():
    project_list = Project.get_all_current_projects()

    return render_template('projects.html', project_list=project_list)