Ejemplo n.º 1
0
def home_page_config(request):
    PersonProvider = person_operations()
    Current_Person = PersonProvider.GetPerson(current_user.email)
    store_worklogs = work_log_operations()
    store_projects = project_operations()
    TeamProvider = team_operations()
    FollowedProjectProvider = followed_project_operations()
    active_projects = store_projects.get_the_projects_of_a_person(
        person_operations.GetPerson(current_user, current_user.email)[0])
    count = 0
    while (count < len(active_projects)):
        temp = list(active_projects[count])
        temp.append(
            list(
                TeamProvider.GetAllMembersByProjectId(
                    active_projects[count][3])))
        temp.append(
            len(
                FollowedProjectProvider.
                GetFollowerPersonListByFollowedProjectId(
                    active_projects[count][3])))
        active_projects[count] = tuple(temp)
        count = count + 1
    worklogs = store_worklogs.GetFollowedProjectsWorkLogs(Current_Person[0])
    return render_template('dashboard.html',
                           worklogs=worklogs,
                           active_projects=active_projects)
Ejemplo n.º 2
0
def team_edit_page(key=None):
    store = team_operations()
    storeCourt = court_operations()
    storeCountry = country_operations()
    team = store.get_team(key) if key is not None else None
    courts = storeCourt.get_courts()
    countries = storeCountry.get_countries()
    now = datetime.datetime.now()
    return render_template('team_edit.html', team=team, courts=courts, countries=countries, current_time=now.ctime())
Ejemplo n.º 3
0
def transfer_edit_page(key=None):
    store = transfer_operations()
    storeTeam = team_operations()
    storeSeason = season_operations()
    storePlayer = player_operations()
    transfer = store.get_transfer(key) if key is not None else None
    teams = storeTeam.get_teams()
    seasons = storeSeason.get_seasons()
    players = storePlayer.get_players()
    now = datetime.datetime.now()
    return render_template('transfer_edit.html', transfer=transfer, teams=teams,seasons=seasons,players=players, current_time=now.ctime())
Ejemplo n.º 4
0
def coach_edit_page(key=None):
    store = coach_operations()
    storeTeam = team_operations()
    storeCountry = country_operations()
    storeGenders = gender_operations()
    coach = store.get_coach(key) if key is not None else None
    teams = storeTeam.get_teams()
    countries = storeCountry.get_countries()
    genders = storeGenders.get_genders()
    now = datetime.datetime.now()
    return render_template('coach_edit.html', coach=coach, teams=teams, countries=countries, genders=genders, current_time=now.ctime())
Ejemplo n.º 5
0
def match_edit_page(key=None):
    store = match_operations()
    storeTeam = team_operations()
    storeCourt = court_operations()

    match = store.get_match(key) if key is not None else None
    teams = storeTeam.get_teams()
    courts = storeCourt.get_courts()

    now = datetime.datetime.now()
    return render_template('match_edit.html', match=match, teams=teams, courts=courts, current_time=now.ctime())
Ejemplo n.º 6
0
def team_page(key=None,operation=None,error=None):
    if request.method == 'GET':
        if request.args.get('operation') == 'delete':
            store = team_operations()
            result=store.delete_team(request.args.get('key'))
            return redirect(url_for('admin.team_page', error=result))
        else:
            store = team_operations()
            teams=store.get_teams()
            now = datetime.datetime.now()
            error = request.args.get('error')
            return render_template('admin_teams.html', teams=teams, error=error, current_time=now.ctime())
    else:
        if request.form['submit']=='cancel':
            return redirect(url_for('admin.team_page'))

        else:
            if request.form['key_value']=='':
                name = request.form['name']
                color = request.form['color']
                date = request.form['date']
                countryid = request.form['countryid']
                courtid = request.form['courtid']
                team = Team(None,name, color, date, countryid, None, courtid, None, 0)
                store = team_operations()
                result=store.add_team(team)
                return redirect(url_for('admin.team_page', error=result))
            else:
                name = request.form['name']
                color = request.form['color']
                key = request.form['key_value']
                date = request.form['date']
                countryid = request.form['countryid']
                courtid = request.form['courtid']
                store = team_operations()
                result=store.update_team(key,name,color,date,countryid,courtid)
                return redirect(url_for('admin.team_page', error=result))
Ejemplo n.º 7
0
def player_edit_page(key=None):
    store = player_operations()
    storeCountry = country_operations()
    storeTeam = team_operations()
    storeGender = gender_operations()
    storePosition = position_operations()
    storeHand = hand_operations()

    player = store.get_player(key) if key is not None else None
    teams = storeTeam.get_teams()
    countries = storeCountry.get_countries()
    genders = storeGender.get_genders()
    positions = storePosition.get_positions()
    hands = storeHand.get_hands()

    now = datetime.datetime.now()
    return render_template('player_edit.html', player=player, teams=teams, countries=countries, genders=genders, positions=positions, hands=hands, current_time=now.ctime())
Ejemplo n.º 8
0
def project_create_page_config(submit_type):
    if submit_type == 'GET':
        listProjectType = GetProjectType()
        listProjectThesisType = GetProjectThesisType()
        listDepartment = GetDepartment()
        listProjectStatusType = GetProjectStatusType()
        listManager = GetManagerList()
        return render_template('projects/create_project.html',
                               listProjectType=listProjectType,
                               listProjectThesisType=listProjectThesisType,
                               listDepartment=listDepartment,
                               listProjectStatusType=listProjectStatusType,
                               listManager=listManager)
    else:
        if 'Add' in request.form.values():
            store = project_operations()
            title = request.form['project_name']
            project_description = request.form['project_description']
            project_type = request.form['project_type']
            project_thesis_type = request.form['project_thesis_type']
            department = request.form['department']
            start_date = request.form['start']
            #start_date = None
            end_date = request.form['end_date']
            if end_date > str(
                    datetime.datetime.now()):  #ileri tarihte bitecekse
                project_status_type = 2
            else:  #süre bitmişse
                project_status_type = 3
            member_limit = request.form['limit']
            created_by = person_operations.GetPerson(
                current_user,
                current_user.email)[0]  #current_user proje oluşturuyor
            manager = request.form['project_manager']
            project = Project(None, title, project_description, project_type,
                              project_thesis_type, department,
                              project_status_type, start_date, end_date,
                              member_limit, None, created_by, manager)
            store.add_project(project)
            id = store.get_last()
            TeamProvider = team_operations()
            TeamProvider.AddTeam(id, manager, 'Manager')
            return redirect(url_for('site.home_page'))
Ejemplo n.º 9
0
 def get_transfer(self, key):
     global connection
     storeTeam = team_operations()
     storeSeason = season_operations()
     storePlayer = player_operations()
     try:
         connection = dbapi2.connect(dsn)
         cursor = connection.cursor()
         statement = """SELECT objectid, playerid, oldteamid, newteamid, seasonid FROM transfer where (objectid=%s and deleted=0)"""
         cursor.execute(statement, (key,))
         id,playerid,oldteamid,newteamid,seasonid=cursor.fetchone()
         cursor.close()
     except dbapi2.DatabaseError:
         if connection:
             connection.rollback()
     finally:
         if connection:
             connection.close()
     return Transfer(id, playerid,storePlayer.get_player(playerid), oldteamid, storeTeam.get_team(oldteamid), newteamid, storeTeam.get_team(newteamid), seasonid, storeSeason.get_season(seasonid), 0)
Ejemplo n.º 10
0
    def get_match(self, key):
        global connection
        storeCourt = court_operations()
        storeTeam = team_operations()
        try:
            connection = dbapi2.connect(dsn)
            cursor = connection.cursor()
            statement = """SELECT objectid, hometeamid, awayteamid, courtid, matchdate FROM match WHERE (objectid=%s and deleted=0)"""
            cursor.execute(statement, (key,))
            id,hometeamid,awayteamid,courtid,matchdate=cursor.fetchone()
            cursor.close()
        except dbapi2.DatabaseError:
            if connection:
                connection.rollback()
        finally:
            if connection:
                connection.close()

        return Match(id, hometeamid, storeTeam.get_team(hometeamid), awayteamid, storeTeam.get_team(awayteamid), courtid, storeCourt.get_court(courtid), matchdate, 0)
Ejemplo n.º 11
0
 def get_matches(self):
     matches=[]
     global connection
     storeCourt = court_operations()
     storeTeam = team_operations()
     try:
         connection = dbapi2.connect(dsn)
         cursor = connection.cursor()
         statement = """SELECT objectid, hometeamid, awayteamid, courtid, matchdate FROM match WHERE deleted = 0 ORDER BY objectid"""
         cursor.execute(statement)
         matches = [(key, Match(key, hometeamid, storeTeam.get_team(hometeamid), awayteamid, storeTeam.get_team(awayteamid), courtid, storeCourt.get_court(courtid), matchdate, 0)) for key, hometeamid, awayteamid, courtid, matchdate in cursor]
         cursor.close()
     except dbapi2.DatabaseError:
         if connection:
             connection.rollback()
     finally:
         if connection:
             connection.close()
     return matches
Ejemplo n.º 12
0
    def get_coach(self, key):
        global connection
        storeCountry = country_operations()
        storeTeam = team_operations()
        storeGender = gender_operations()
        try:
            connection = dbapi2.connect(dsn)
            cursor = connection.cursor()
            statement = """SELECT objectid, name, surname,  countryid, teamid, birthday, genderid FROM coach where (objectid=%s and deleted=0)"""
            cursor.execute(statement, (key,))
            id,name,surname,countryid,teamid,birthyear,genderid=cursor.fetchone()
            cursor.close()
        except dbapi2.DatabaseError:
            if connection:
                connection.rollback()
        finally:
            if connection:
                connection.close()

        return Coach(id,name,surname,countryid, storeCountry.get_country(countryid), teamid, storeTeam.get_team(teamid), birthyear, genderid, storeGender.get_gender(genderid), 0)
Ejemplo n.º 13
0
 def get_coaches(self):
     coachs=[]
     global connection
     storeCountry = country_operations()
     storeTeam = team_operations()
     storeGender = gender_operations()
     try:
         connection = dbapi2.connect(dsn)
         cursor = connection.cursor()
         statement = """SELECT coach.objectid, coach.name, coach.surname, coach.countryid, coach.teamid, coach.birthday, coach.genderid FROM coach WHERE coach.deleted = 0 ORDER BY objectid"""
         cursor.execute(statement)
         coachs = [(key, Coach(key,name,surname,countryid, storeCountry.get_country(countryid), teamid, storeTeam.get_team(teamid), birthyear, genderid, storeGender.get_gender(genderid), 0)) for key, name,surname, countryid, teamid, birthyear, genderid in cursor]
         cursor.close()
     except dbapi2.DatabaseError:
         if connection:
             connection.rollback()
     finally:
         if connection:
             connection.close()
     return coachs
Ejemplo n.º 14
0
    def get_transfers(self):
        global connection
        storeTeam = team_operations()
        storeSeason = season_operations()
        storePlayer = player_operations()
        transfers=[]
        try:
            connection = dbapi2.connect(dsn)
            cursor = connection.cursor()
            statement = """SELECT transfer.objectid, transfer.playerid, transfer.oldteamid, transfer.newteamid, transfer.seasonid FROM transfer where transfer.deleted=0 ORDER BY objectid"""
            cursor.execute(statement)
            transfers = [(key, Transfer(key, playerid,storePlayer.get_player(playerid), oldteamid,storeTeam.get_team(oldteamid), newteamid, storeTeam.get_team(newteamid), seasonid, storeSeason.get_season(seasonid), 0)) for key, playerid, oldteamid, newteamid, seasonid in cursor]
            cursor.close()
        except dbapi2.DatabaseError:
            if connection:
                connection.rollback()
        finally:
            if connection:
                connection.close()

        return transfers
Ejemplo n.º 15
0
 def get_players(self):
     players=[]
     global connection
     storeCountry = country_operations()
     storeTeam = team_operations()
     storeGender = gender_operations()
     storePosition = position_operations()
     storeHand = hand_operations()
     try:
         connection = dbapi2.connect(dsn)
         cursor = connection.cursor()
         statement = """SELECT objectid, name, surname, birthdate, height, weight, startdate, teamid, countryid, genderid, positionid, handid, number FROM player WHERE deleted = 0 ORDER BY objectid"""
         cursor.execute(statement)
         players = [(key, Player(key, name, surname, birthdate, height, weight, startdate, teamid, storeTeam.get_team(teamid),countryid, storeCountry.get_country(countryid), genderid, storeGender.get_gender(genderid), positionid, storePosition.get_position(positionid), handid, storeHand.get_hand(handid), number, 0)) for key, name, surname, birthdate, height, weight, startdate, teamid, countryid, genderid, positionid, handid, number in cursor]
         cursor.close()
     except dbapi2.DatabaseError:
         if connection:
             connection.rollback()
     finally:
         if connection:
             connection.close()
     return players
Ejemplo n.º 16
0
    def get_player(self, key):
        global connection
        storeCountry = country_operations()
        storeTeam = team_operations()
        storeGender = gender_operations()
        storePosition = position_operations()
        storeHand = hand_operations()
        try:
            connection = dbapi2.connect(dsn)
            cursor = connection.cursor()
            statement = """SELECT objectid,name, surname, birthdate, height, weight, startdate, teamid, countryid, genderid, positionid, handid, number FROM player WHERE (objectid=%s and deleted=0)"""
            cursor.execute(statement, (key,))
            id,name,surname,birthdate,height,weight,startdate,teamid,countryid,genderid,positionid,handid,number=cursor.fetchone()
            cursor.close()
        except dbapi2.DatabaseError:
            if connection:
                connection.rollback()
        finally:
            if connection:
                connection.close()

        return Player(id, name, surname, birthdate, height, weight, startdate, teamid, storeTeam.get_team(teamid), countryid, storeCountry.get_country(countryid), genderid, storeGender.get_gender(genderid), positionid, storePosition.get_position(positionid), handid, storeHand.get_hand(handid), number, 0)
Ejemplo n.º 17
0
def personal_default_page_config(request):
    PersonProvider = person_operations()
    Current_Person = PersonProvider.GetPerson(current_user.email)
    comments = personComment_operations()
    store_followed_projects = followed_project_operations()
    EducationProvider = education_operations()
    SkillProvider = skill_operations()
    InformationProvider = information_operations()
    LanguageProvider = language_operations()
    TeamProvider = team_operations()
    if request and 'delete' in request.form and request.method == 'POST':
        p = PersonProvider.GetPersonByObjectId(request.form['delete'])
        PersonProvider.DeletePerson(request.form['delete'])
    if request and 'deleteComment' in request.form and request.method == 'POST':
        comments.DeleteTeam(request.form['deleteComment'])
    elif request and 'updateComment' in request.form and request.method == 'POST':
        selectedComment = request.form['updateId']
        updatedComment = request.form['updateComment']
        comments.UpdatePersonComment(selectedComment, updatedComment)
    elif request and 'addComment' in request.form and request.method == 'POST':
        personId = Current_Person[0]
        commentedPersonId = Current_Person[0]
        newComment = request.form['addComment']
        comments.AddPersonComment(personId, commentedPersonId, newComment)
    elif 'unfollowProject' in request.form:
        project_id = request.form['unfollowProject']
        store_followed_projects.DeleteFollowedProject(project_id)
    elif request and 'searchPeoplePage' in request.form and request.method == 'POST':
        return redirect(url_for('site.people_search_person_page'))
    elif request and 'searchProjectPage' in request.form and request.method == 'POST':
        return redirect(url_for('site.projects_search_page'))
    elif request and 'saveProfileSettings' in request.form and request.method == 'POST':
        FollowedPersonProvider = followed_person_operations()
        listFollowing = FollowedPersonProvider.GetFollowedPersonListByPersonId(
            Current_Person[0])
        listFollowers = FollowedPersonProvider.GetFollowedPersonListByFollowedPersonId(
            Current_Person[0])
        personComments = comments.GetPersonCommentsByCommentedPersonId(
            Current_Person[0])
        listTitle = GetTitleList()
        listAccount = GetAccountTypeList()
        first_name = request.form['firstName']
        last_name = request.form['lastName']
        pswd = request.form['pswd']
        accountType = request.form['account']
        title = request.form['title']
        file = request.files['file']
        gender = request.form['r1']
        if gender == 'male':
            gender = False
        elif gender == 'female':
            gender = True
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            if filename != Current_Person[7]:
                file.save(os.path.join('static/user_images', filename))
            else:
                filename = Current_Person[7]
        elif Current_Person[7] is None:
            if gender:
                filename = 'noimage_female.jpg'
            else:
                filename = 'noimage_male.jpg'
        else:
            filename = Current_Person[7]
        if pswd != "":
            pswd = pwd_context.encrypt(request.form['pswd'])
            UpdateUser(pswd, current_user.email)
        PersonProvider.UpdatePerson(Current_Person[0], first_name, last_name,
                                    accountType, ' ', gender, title, filename,
                                    False)
        return redirect(
            url_for('site.personal_default_page',
                    Current_Person=Current_Person,
                    listFollowing=listFollowing,
                    listFollowers=listFollowers,
                    personComments=personComments,
                    listAccount=listAccount,
                    listTitle=listTitle))
    FollowedPersonProvider = followed_person_operations()
    listFollowing = FollowedPersonProvider.GetFollowedPersonListByPersonId(
        Current_Person[0])
    listFollowers = FollowedPersonProvider.GetFollowedPersonListByFollowedPersonId(
        Current_Person[0])
    personComments = comments.GetPersonCommentsByCommentedPersonId(
        Current_Person[0])
    followed_projects = store_followed_projects.GetFollowedProjectListByPersonId(
        Current_Person[0])
    count = 0
    while (count < len(followed_projects)):
        temp = list(followed_projects[count])
        temp.append(
            list(
                TeamProvider.GetAllMembersByProjectId(
                    followed_projects[count][8])))
        temp.append(
            len(
                store_followed_projects.
                GetFollowerPersonListByFollowedProjectId(
                    followed_projects[count][8])))
        followed_projects[count] = tuple(temp)
        count = count + 1
    now = datetime.datetime.now()
    listTitle = GetTitleList()
    listAccount = GetAccountTypeList()
    store_projects = project_operations()
    active_projects = store_projects.get_the_projects_of_a_person(
        Current_Person[0])
    count = 0
    while (count < len(active_projects)):
        temp = list(active_projects[count])
        temp.append(
            list(
                TeamProvider.GetAllMembersByProjectId(
                    active_projects[count][3])))
        temp.append(
            len(
                store_followed_projects.
                GetFollowerPersonListByFollowedProjectId(
                    active_projects[count][3])))
        active_projects[count] = tuple(temp)
        count = count + 1
    active_project_number = len(active_projects)
    listEducation = EducationProvider.GetEducationListByActiveCVAndByPersonId(
        Current_Person[0])
    listSkill = SkillProvider.GetSkillByActiveCVAndByPersonId(
        Current_Person[0])
    listLanguage = LanguageProvider.GetAllLanguagesByActiveCVAndByPersonId(
        Current_Person[0])
    listInformation = InformationProvider.get_all_information_by_ActiveCV_And_PersonId(
        Current_Person[0])
    CvProvider = cv_operations()
    activeCv = CvProvider.get_active_cv(Current_Person[0])
    ExperienceProvider = experience_operations()
    if activeCv:
        listExperience = ExperienceProvider.get_experiences_with_key(
            activeCv[0])
    else:
        listExperience = 'none'
    return render_template('personal/default.html',
                           current_time=now.ctime(),
                           Current_Person=Current_Person,
                           listFollowing=listFollowing,
                           listFollowers=listFollowers,
                           followed_projects=followed_projects,
                           personComments=personComments,
                           listAccount=listAccount,
                           listTitle=listTitle,
                           active_projects=active_projects,
                           active_project_number=active_project_number,
                           listEducation=listEducation,
                           listSkill=listSkill,
                           listExperience=listExperience,
                           listLanguage=listLanguage,
                           listInformation=listInformation)
Ejemplo n.º 18
0
def teams_page():
    if request.method == 'GET':
        store = team_operations()
        teams=store.get_teams()
        now = datetime.datetime.now()
        return render_template('team.html', teams=teams, current_time=now.ctime())
Ejemplo n.º 19
0
def people_person_detail_page_config(request, key):
    PersonProvider = person_operations()
    CommentProvider = personComment_operations()
    Current_Person = PersonProvider.GetPerson(current_user.email)
    FollowedPersonProvider = followed_person_operations()
    CvProvider = cv_operations()
    ExperienceProvider = experience_operations()
    FollowedProjectProvider = followed_project_operations()
    EducationProvider = education_operations()
    SkillProvider = skill_operations()
    InformationProvider = information_operations()
    LanguageProvider = language_operations()
    TeamProvider = team_operations()
    if request and 'deleteComment' in request.form and request.method == 'POST':
        CommentProvider.DeleteTeam(request.form['deleteComment'])
    elif request and 'updateComment' in request.form and request.method == 'POST':
        selectedComment = request.form['updateId']
        updatedComment = request.form['updateComment']
        CommentProvider.UpdatePersonComment(selectedComment, updatedComment)
    elif request and 'addComment' in request.form and request.method == 'POST':
        newComment = request.form['addComment']
        CommentProvider.AddPersonComment(Current_Person[0], key, newComment)
    elif request and 'follow' in request.form and request.method == 'POST':
        toAdd = FollowedPerson(None, Current_Person[0], key, None, None)
        FollowedPersonProvider.AddFollowedPerson(toAdd)
    elif request and 'unfollow' in request.form and request.method == 'POST':
        toDeletedFollowedPerson = FollowedPersonProvider.GetFollowedPersonByPersonIdAndFollowedPersonId(
            Current_Person[0], key)
        FollowedPersonProvider.DeletePerson(toDeletedFollowedPerson[0])
    FollowedPersonProvider = followed_person_operations()
    Active_Person = PersonProvider.GetPersonByObjectId(key)
    listFollowing = FollowedPersonProvider.GetFollowedPersonListByPersonId(key)
    listFollowers = FollowedPersonProvider.GetFollowedPersonListByFollowedPersonId(
        key)
    personComments = CommentProvider.GetPersonCommentsByCommentedPersonId(key)
    IsFollow = FollowedPersonProvider.GetFollowedPersonByPersonIdAndFollowedPersonId(
        Current_Person[0], Active_Person[0])
    activeCv = CvProvider.get_active_cv(key)
    followed_projects = FollowedProjectProvider.GetFollowedProjectListByPersonId(
        key)
    count = 0
    while (count < len(followed_projects)):
        temp = list(followed_projects[count])
        temp.append(
            list(
                TeamProvider.GetAllMembersByProjectId(
                    followed_projects[count][8])))
        temp.append(
            len(
                FollowedProjectProvider.
                GetFollowerPersonListByFollowedProjectId(
                    followed_projects[count][8])))
        followed_projects[count] = tuple(temp)
        count = count + 1
    store_projects = project_operations()
    active_projects = store_projects.get_the_projects_of_a_person(key)
    count = 0
    while (count < len(active_projects)):
        temp = list(active_projects[count])
        temp.append(
            list(
                TeamProvider.GetAllMembersByProjectId(
                    active_projects[count][3])))
        temp.append(
            len(
                FollowedProjectProvider.
                GetFollowerPersonListByFollowedProjectId(
                    active_projects[count][3])))
        active_projects[count] = tuple(temp)
        count = count + 1
    active_project_number = len(active_projects)
    listEducation = EducationProvider.GetEducationListByActiveCVAndByPersonId(
        Active_Person[0])
    listSkill = SkillProvider.GetSkillByActiveCVAndByPersonId(Active_Person[0])
    listLanguage = LanguageProvider.GetAllLanguagesByActiveCVAndByPersonId(
        Active_Person[0])
    listInformation = InformationProvider.get_all_information_by_ActiveCV_And_PersonId(
        Active_Person[0])
    if activeCv:
        listExperience = ExperienceProvider.get_experiences_with_key(
            activeCv[0])
    else:
        listExperience = 'none'
    now = datetime.now()
    return render_template('people/person_detail.html',
                           current_time=now.ctime(),
                           Current_Person=Current_Person,
                           Active_Person=Active_Person,
                           listFollowing=listFollowing,
                           listFollowers=listFollowers,
                           personComments=personComments,
                           IsFollow=IsFollow,
                           followed_projects=followed_projects,
                           listExperience=listExperience,
                           active_projects=active_projects,
                           active_project_number=active_project_number,
                           listEducation=listEducation,
                           listSkill=listSkill,
                           listLanguage=listLanguage,
                           listInformation=listInformation)
Ejemplo n.º 20
0
def project_details_page_config(submit_type, key):
    store = project_operations()
    store_comments = project_comment_operations()
    store_worklogs = work_log_operations()
    PersonProvider = person_operations()
    teamList = team_operations()
    necessaryProject = store.get_project_member_limit(key)
    memberLimit = necessaryProject[0][0]
    followed_projects = followed_project_operations()
    current_person = PersonProvider.GetPerson(current_user.email)
    isFollow = followed_projects.GetFollowedProjectByPersonIdAndProjectId(
        current_person[0], key)
    if submit_type == 'GET':
        project = store.get_project(key)
        listManager = GetManagerList()
        project_comments = store_comments.get_project_comments(key)
        listPerson = PersonProvider.GetPersonList()
        members = teamList.GetAllMembersByProjectId(key)
        worklogs = store_worklogs.GetWorkLogByProjectId(key)
        current_user_objectid = person_operations.GetPerson(
            current_user, current_user.email)[
                0]  #current_userın person tablosundaki halinin objectidsi
        project_creator = project[8]  #projeyi oluşturan kişi
        return render_template('projects/project_details.html',
                               project=project,
                               project_comments=project_comments,
                               members=members,
                               worklogs=worklogs,
                               listManager=listManager,
                               isFollow=isFollow,
                               current_user_objectid=current_user_objectid,
                               project_creator=project_creator,
                               listPerson=listPerson)
    else:
        if 'addComment' in request.form:
            person_id = person_operations.GetPerson(current_user,
                                                    current_user.email)[0]
            commented_project_id = int(key)
            comment = request.form['project_comment']
            create_date = datetime.datetime.now()
            update_date = datetime.datetime.now()
            project_comment = ProjectComment(None, person_id,
                                             commented_project_id, comment,
                                             create_date, update_date)
            store_comments.add_project_comment(project_comment)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'update' in request.form:
            title = request.form['project_name']
            project_description = request.form['project_description']
            end_date = request.form['updated_date']
            member_limit = request.form['limit']
            manager = request.form['project_manager']
            deleted = '0'
            store.update_project(int(key), title, project_description,
                                 end_date, member_limit, manager, deleted)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'delete_project' in request.form:
            store.delete_project(int(key))
            return redirect(url_for('site.home_page'))
        elif 'delete' in request.form:
            comment_key = request.form['delete']
            store_comments.delete_project_comment(int(comment_key))
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'edit' in request.form:
            comment_key = request.form['edit']
            new_comment = request.form['newComment']
            store_comments.update_project_comment(comment_key, new_comment,
                                                  False)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'addMember' in request.form:
            teamMembers = request.form.getlist('teamMember')
            lengthOfLoop = len(teamMembers)
            howManyMembers = teamList.CountOfTeamsInProject(key)
            projectTeamMembers = howManyMembers[0]
            for x in range(0, lengthOfLoop):
                if projectTeamMembers >= memberLimit:
                    break
                newMemberDuty = request.form['addDuty']
                newMemberMemberId = teamMembers[x]
                newMemberProjectId = key
                triedMember = teamList.GetDutyByMemberId(
                    newMemberMemberId, key)
                lengthOfTried = len(triedMember)
                if lengthOfTried == 0:
                    projectTeamMembers += 1
                    teamList.AddTeam(newMemberProjectId, newMemberMemberId,
                                     newMemberDuty)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'updateMember' in request.form:
            newDuty = request.form['updatedMemberDuty']
            objectId = request.form['updatedMemberId']
            teamList.UpdateMemberDuty(objectId, newDuty)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'deleteMember' in request.form:
            deleteMemberId = request.form['deleteMember']
            teamList.DeleteTeam(deleteMemberId)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'addWorklog' in request.form:
            cretaorPersonId = person_operations.GetPerson(
                current_user, current_user.email)[0]
            projectId = key
            commitMessage = request.form['commitMessage']
            worklog = WorkLog(None, projectId, commitMessage,
                              ' "+str(datetime.datetime.now())+" ',
                              cretaorPersonId, False)
            store_worklogs.AddWorkLog(worklog)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'editWorklog' in request.form:
            worklog_id = request.form['editWorklog']
            new_log = request.form['new_log']
            store_worklogs.UpdateWorkLog(worklog_id, new_log)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'deleteWorklog' in request.form:
            worklog_id = request.form['deleteWorklog']
            store_worklogs.DeleteWorkLog(worklog_id)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'follow' in request.form:
            follow_project = FollowedProject(
                None, current_person[0], key,
                ' "+str(datetime.datetime.now())+" ', False)
            followed_projects.AddFollowedProject(follow_project)
            return redirect(url_for('site.projects_details_page', key=key))
        elif 'unfollow' in request.form:
            unfollow_project_id = followed_projects.GetFollowedProjectByPersonIdAndProjectId(
                current_person[0], key)[0]
            followed_projects.DeleteFollowedProject(unfollow_project_id)
            return redirect(url_for('site.projects_details_page', key=key))