51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
|
import tkinter as tk
|
||
|
|
||
|
from constants import PROJECT_VIEW_NAME
|
||
|
from views.abstract_view import AbstractView
|
||
|
|
||
|
|
||
|
class ProjectView(tk.Frame, AbstractView):
|
||
|
|
||
|
def __init__(self, parent, controller, main_view_controller):
|
||
|
tk.Frame.__init__(self, parent)
|
||
|
self.token = ''
|
||
|
|
||
|
# label0 = tk.Label(self, text='Project name:', font=FONT)
|
||
|
# label0.pack()
|
||
|
#
|
||
|
# input0 = tk.Entry(self)
|
||
|
# input0.pack()
|
||
|
#
|
||
|
# button_add = tk.Button(self, text="Confirm and add", font=FONT,
|
||
|
# command=lambda: self.add_project(main_view_controller, input0.get()))
|
||
|
# button_add.pack()
|
||
|
#
|
||
|
# button_back = tk.Button(self, text="Back", font=FONT,
|
||
|
# command=lambda: main_view_controller.show_frame(ProjectsView))
|
||
|
# button_back.pack()
|
||
|
|
||
|
@staticmethod
|
||
|
def get_view_name() -> str:
|
||
|
return PROJECT_VIEW_NAME
|
||
|
|
||
|
def start(self):
|
||
|
# tutaj pobieranie info o projekcie
|
||
|
print("ok")
|
||
|
|
||
|
# def add_project(self, controller, project_name):
|
||
|
# headers = {'Authorization': 'Bearer ' + self.token}
|
||
|
# data = {
|
||
|
# "name": str(project_name)
|
||
|
# }
|
||
|
# print(data)
|
||
|
# response = requests.post(URL_PROJECTS, json=data, headers=headers)
|
||
|
# print(response)
|
||
|
# if response.status_code == 201:
|
||
|
# response = response.json()
|
||
|
# controller.show_frame(ProjectsView)
|
||
|
# else:
|
||
|
# print("sth wrong")
|
||
|
# bad_pass_label = tk.Label(self, text='Something went wrong!', font=FONT)
|
||
|
# bad_pass_label.pack()
|
||
|
# return ()
|