diff --git a/examples/github_example.py b/examples/github_example.py new file mode 100644 index 0000000..b754157 --- /dev/null +++ b/examples/github_example.py @@ -0,0 +1,16 @@ +from splashgen import launch +from splashgen.components import SplashSite +from splashgen.integrations import GithubSignin + +site = SplashSite(title="Splashgen - Splash Pages Built In Python", + theme="dark") +site.headline = "Build your splash page in python effortlessly" +site.subtext = """ +In less than 20 lines of python, create clean and beautiful splash pages with +Splashgen. Don't waste time with no-code tools when you already know how to +code. +""" +site.call_to_action = GithubSignin( + "https://github.com/true3dco/splashgen", "View on GitHub") + +launch(site) diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..2868b33 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,10 @@ + + + Test Page for the Nginx HTTP Server on Amazon Linux + + + + +

FILES HOSTED ON S3 LEGOOO

+ + diff --git a/python-api/base-page.py b/python-api/base-page.py new file mode 100644 index 0000000..46596e8 --- /dev/null +++ b/python-api/base-page.py @@ -0,0 +1,8 @@ +from zenweb import WebPage + +class BasePage(WebPage): + def branding(self): + return { + "primary_color": "#32CBEA", + "secondary_color": "#063F1B" + } \ No newline at end of file diff --git a/python-api/create-app.py b/python-api/create-app.py new file mode 100644 index 0000000..9c39598 --- /dev/null +++ b/python-api/create-app.py @@ -0,0 +1,35 @@ +from base-page import BasePage + + +class CreateAppPage(BasePage): + + def config(self): + return { + "route": "/apps/{self.full_name}/delete" + } + + def render(self): + if LOCAL_STORAGE.jwt_token != None: + return REDIRECT(LoggedInHomePage.ROUTE) + + + response = Request( + "https://cxpme86mmi.execute-api.us-east-2.amazonaws.com/repos", + body={"jwt_token": LOCAL_STORAGE.jwt_token}) + + repo_list = [] + for repo in response.data: + repo_list.append( + { + "name": repo.name, + "branch": repo.default_branch, + "createButton": Request("https://cxpme86mmi.execute-api.us-east-2.amazonaws.com/zenweb-github-create-webhook", body={"repo": repo.full_name}) # URL Param + } + ) + + + return """ + +

Which repo would you like to deploy?

+ {repo_list} + """ \ No newline at end of file diff --git a/python-api/delete-app-page.py b/python-api/delete-app-page.py new file mode 100644 index 0000000..0e856aa --- /dev/null +++ b/python-api/delete-app-page.py @@ -0,0 +1,31 @@ +from base-page import BasePage + + +class DeleteAppPage(BasePage): + + def config(self): + return { + "route": "/apps/{self.full_name}/delete" + } + + def render(self): + if LOCAL_STORAGE.jwt_token != None: + return REDIRECT(LoggedInHomePage.ROUTE) + + + delete_button = """( + +
+
+
+ + + + {% if logo %} {% endif %} -

- {{ headline }} -

-
+
+

+ {{ headline }} +

+
+

{{ subtext }} @@ -126,6 +198,197 @@ />

{% endif %} +
+
+
+ + + + + + + + + +