Skip to content

Commit

Permalink
Final Push with landing page, dashboard page and github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Somraj-234 committed Aug 14, 2024
1 parent 7a4c4cb commit d2e7225
Show file tree
Hide file tree
Showing 32 changed files with 1,606 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/checkouts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def checkout_finalize_view(request):
subscription_data = {**checkout_data}

price_qs = SubscriptionPrice.objects.filter(stripe_id=plan_id)
print(price_qs)
# print(price_qs)
# django's related look ups
try:
sub_obj = Subscription.objects.get(subscriptionprice__stripe_id=plan_id)
Expand Down
1 change: 1 addition & 0 deletions src/commando/management/commands/vendor_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
STATICFILES_VENDOR_DIR = getattr(settings,'STATICFILES_VENDOR_DIR')

VENDOR_STATICFILES = {
"saas-theme.min.css":"https://raw.githubusercontent.com/codingforentrepreneurs/SaaS-Foundations/main/src/staticfiles/theme/saas-theme.min.css",
"flowbite.min.css":"https://cdn.jsdelivr.net/npm/[email protected]/dist/flowbite.min.css",
"flowbite.min.js":"https://cdn.jsdelivr.net/npm/[email protected]/dist/flowbite.min.js",
"flowbite.min.js.map":"https://cdn.jsdelivr.net/npm/[email protected]/dist/flowbite.min.js.map"
Expand Down
Empty file added src/dashboard/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions src/dashboard/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions src/dashboard/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class DashboardConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'dashboard'
Empty file.
3 changes: 3 additions & 0 deletions src/dashboard/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions src/dashboard/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
6 changes: 6 additions & 0 deletions src/dashboard/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib.auth.decorators import login_required
from django.shortcuts import render

@login_required
def dashboard_view(request):
return render(request, "dashboard/main.html", {})
Empty file added src/landing/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions src/landing/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions src/landing/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class LandingConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'landing'
Empty file.
3 changes: 3 additions & 0 deletions src/landing/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions src/landing/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
10 changes: 10 additions & 0 deletions src/landing/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.shortcuts import render
from visits.models import PageVisits
from dashboard.views import dashboard_view

def landing_dashboard_page_view(request):
if request.user.is_authenticated:
return dashboard_view(request)
qs = PageVisits.objects.all()
PageVisits.objects.create(path=request.path)
return render(request,"landing/main.html", {"page_view_count":qs.count()})
6 changes: 2 additions & 4 deletions src/sjhome/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from django.contrib import admin
from django.urls import path, include
from auth import views as auth_views
from landing import views as landing_views
from checkouts import views as checkout_views
from subscriptions import views as subscriptions_views

Expand All @@ -29,10 +30,7 @@
)

urlpatterns = [
path("", home_view, name="home"),
path("hello-world/", home_view),
# path("login/", auth_views.login_view),
# path("register/", auth_views.register_view),
path("", landing_views.landing_dashboard_page_view, name="home"),
path("checkout/sub-price/<int:price_id>/",
checkout_views.product_price_redirect_view,
name="sub-price-checkout"
Expand Down
Binary file added src/staticfiles/images/flowbite-phone-mockup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/subscriptions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ def subscription_price_view(request, interval="month"):




23 changes: 22 additions & 1 deletion src/templates/base/css.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
{% load static %}
<link href="{% static 'vendors/flowbite.min.css' %}" rel="stylesheet" />
<link href="{% static 'vendors/saas-theme.min.css' %}" rel="stylesheet" />

<!-- Custom CSS Overrides -->
<style>
a[href="{% url 'account_login' %}"], a[href="/accounts/signup/"]"{
background-color: transparent !important;
color: blue !important;
border: none !important;
padding: 0 !important;
}

a[href="{% url 'home' %}"] {
background-color: transparent !important;
color: gray !important;
border: none !important;
padding: 0 !important;
}

a[href="{% url 'home' %}"]:hover {
color: blue !important;
}
</style>
31 changes: 31 additions & 0 deletions src/templates/dashboard/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
{% block head_title %}
saas
{% endblock head_title%}
</title>
{% include "base/css.html" %}
</head>
<body>
<div class="antialiased bg-gray-50 dark:bg-gray-900">
{% include "dashboard/nav.html" %}
<!-- Sidebar -->
{% include "dashboard/sidebar.html" %}

<main class="p-4 md:ml-64 h-auto pt-20">



{% include 'base/messages.html' with messages=messages%}
{% block content %}
{% endblock content %}

</main>
</div>
{% include "base/js.html" %}
</body>
</html>
59 changes: 59 additions & 0 deletions src/templates/dashboard/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% extends "dashboard/base.html" %}

{% block head_title %}
Build Your SAAS Now - {{block.super}}
{% endblock head_title %}

{% block content %}

<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-4">
<div
class="border-2 border-dashed border-gray-300 rounded-lg dark:border-gray-600 h-32 md:h-64"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-32 md:h-64"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-32 md:h-64"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-32 md:h-64"
></div>
</div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-96 mb-4"
></div>
<div class="grid grid-cols-2 gap-4 mb-4">
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
</div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-96 mb-4"
></div>
<div class="grid grid-cols-2 gap-4">
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
<div
class="border-2 border-dashed rounded-lg border-gray-300 dark:border-gray-600 h-48 md:h-72"
></div>
</div>


{% endblock content %}
Loading

0 comments on commit d2e7225

Please sign in to comment.