Ejemplo n.º 1
0
 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
         })
Ejemplo n.º 2
0
    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")
Ejemplo n.º 4
0
 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("")
Ejemplo n.º 7
0
 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("")
Ejemplo n.º 11
0
 def show(self, view: View):
     return view.render("auth.login")
Ejemplo n.º 12
0
 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
     })
Ejemplo n.º 13
0
    def detail(self, view: View, request: Request):
        post = Post.where('slug', request.params.get('slug')).first()

        return view.render('posts/detail', {'post': post})
Ejemplo n.º 14
0
 def new(self, view: View):
     return view.render("posts/new", {"categories": Category.get().all()})
Ejemplo n.º 15
0
 def show(self, view: View):  # Show register page
     return view.render("auth.register")
Ejemplo n.º 16
0
 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("")