def home(self, view: View): # latest 5 added packages last_packages = Package.order_by("created_at", "desc").limit(5).get() # best rated packages: TODO: add rate column and order_by best_rated_packages = Package.limit(5).get() return view.render( "home", { "last_packages": last_packages, "best_rated_packages": best_rated_packages })
def show(self, view: View, request: Request): """Show the welcome page. Arguments: view {masonite.view.View} -- The Masonite view class. request {masonite.request.Request} -- The Masonite request class. Returns: masonite.view.View -- The Masonite view class. """ return view.render('welcome')
def show(self, view: View): return view.render("base")
def faq(self, view: View): return view.render("faq")
def create(self, view: View): return view.render("")
def index(self, view: View): return view.render("")
def show(self, view: View): posts = Post.all() return view.render("posts/list", {"posts": posts})
def details(self, request: Request, view: View): package = Package.where("disabled", False).where("name", request.param('slug')).first() return view.render("package_details", {"package": package})
def edit(self, view: View): return view.render("")
def store(self, view: View): return view.render("")
def show(self, view: View): return view.render("auth.login")
def edit(self, view: View, request: Request): post = Post.find(request.params.get('id')) return view.render("posts/edit", { "categories": Category.get().all(), "post": post })
def detail(self, view: View, request: Request): post = Post.where('slug', request.params.get('slug')).first() return view.render('posts/detail', {'post': post})
def new(self, view: View): return view.render("posts/new", {"categories": Category.get().all()})
def show(self, view: View): # Show register page return view.render("auth.register")
def show(self, view: View): return view.render("home")
def update(self, view: View): return view.render("")
def index(self, view: View): packages = Package.where("disabled", False).order_by( "is_official", "desc").order_by("stars", "desc").all() return view.render("packages", {"packages": packages})
def destroy(self, view: View): return view.render("")