Esempio n. 1
0
def render_site_center(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        drugs = context.get('drugs', UNDEFINED)
        def site_center():
            return render_site_center(context)
        numresults = context.get('numresults', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n    <div>\r\n        <h1>Drug Search Results</h1>\r\n        <h4>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( numresults ))
        __M_writer(' results found</h4><br>\r\n        <table>\r\n            <tr class="heading-title">\r\n                <th>Drug Name</th>\r\n                <th>Drug Type</th>\r\n            </tr>\r\n')
        for drug in drugs:
            __M_writer('                <tr>\r\n                    <th>')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( drug.name ))
            __M_writer('</th>\r\n')
            if drug.is_opioid == 0:
                __M_writer('                        <th>Non-opioid</th>\r\n')
            else:
                __M_writer('                        <th>Opioid</th>\r\n')
            __M_writer('                </tr>     \r\n')
        __M_writer('        </table>\r\n        \r\n    </div>\r\n  \r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 2
0
def render_site_center(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        prescribers = context.get('prescribers', UNDEFINED)

        def site_center():
            return render_site_center(context)

        __M_writer = context.writer()
        __M_writer(
            '\r\n    <div>\r\n        <h1>Prescriber Detail Page</h1>\r\n        <table>\r\n            <tr style="font-size: 20px;">\r\n                <th>Prescriber First Name</th>\r\n                <th>Prescriber Last Name</th>\r\n                <th>Prescriber Type</th>\r\n            </tr>\r\n'
        )
        for prescriber in prescribers:
            __M_writer('                <tr>\r\n                    <th>')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    prescriber.first_name))
            __M_writer('</th>\r\n                    <th>')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    prescriber.last_name))
            __M_writer('</th>\r\n')
            if prescriber.is_opioid_prescriber == 0:
                __M_writer(
                    '                        <th>Non-opioid Prescriber</th>\r\n'
                )
            else:
                __M_writer(
                    '                        <th>Opioid Prescriber</th>\r\n')
            __M_writer('                </tr>     \r\n')
        __M_writer('        </table>\r\n        \r\n    </div>\r\n  \r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 3
0
def render_main_content(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        drugs = context.get('drugs', UNDEFINED)
        self = context.get('self', UNDEFINED)
        def main_content():
            return render_main_content(context)
        __M_writer = context.writer()
        __M_writer('\n    <section>\n      <div class="container">\n        <div class="row">\n          <div class="col-12">\n            <h2 class="text-secondary pb-2">Drugs</h2>\n            <table class="datatable table table-striped table-bordered no-footer">\n              <thead>\n                <tr>\n                  <th class="nosort" style="width: 30px">\n\n                  </th>\n                  <th>\n                    Drug Name\n                  </th>\n                  <th class="nosort" style="text-align: center">\n                    Action\n                  </th>\n                </tr>\n\n              </thead>\n              <tbody>\n')
        for drug in drugs:
            __M_writer('                  <tr>\n                    <td class="text-center">\n')
            if drug.isOpioid:
                __M_writer('                        <i class="fas fa-capsules" data-toggle="tooltip" title="')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)(drug.DrugName.capitalize()))
                __M_writer(' is an Opioid"></i>\n')
            __M_writer('                    </td>\n                    <td class="text-capitalize">\n                      <a href="/perscriptions/drugs.details/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(drug.id))
            __M_writer('">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(drug.DrugName.lower()))
            __M_writer('</a>\n                    </td>\n                    <td class="actions_cell">\n                      <a href="/perscriptions/drugs.details/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(drug.id))
            __M_writer('" class="btn btn-light btn-sm"><i class="fas fa-eye"></i></a>\n                    </td>\n                  </tr>\n\n')
        __M_writer('              </tbody>\n            </table>\n          </div>\n        </div>\n      </div>\n    </section>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 4
0
def render_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)
        self = context.get('self', UNDEFINED)

        def content():
            return render_content(context)

        product = context.get('product', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n    <a href="/catalog/product/')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(product.id))
        __M_writer(
            '">\r\n        <div class="product-tile">\r\n            <div class="product-image"><img class="tile-image" src="'
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                product.image_url()))
        __M_writer('"></img></div>\r\n            <div class="product-name">')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(product.name))
        __M_writer('</div>\r\n            <div class="product-price">$')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(product.price))
        __M_writer('</div>\r\n        </div>\r\n    </a>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 5
0
def render_main_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)

        def main_content():
            return render_main_content(context)

        form = context.get('form', UNDEFINED)
        csrf_input = context.get('csrf_input', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\n    <section>\n      <div class="container">\n        <div class="row">\n        <div class="col-12">\n          <h1 class="border-bottom mb-4 pb-1" style="border-bottom-style: dotted!important;">\n              Add a New Perscriber\n          </h1>\n        </div>\n\n          <div class="col-12">\n            <div class="well">\n              <form class="oak_contact_form" method="post">\n                '
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(csrf_input))
        __M_writer('\n                <div class="row">\n\n')
        for field in form.visible_fields():
            __M_writer(
                '                        <div class="col-lg-6 col-12 form-group">\n                        <label>'
            )
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(field.label))
            __M_writer('</label>\n                            ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(field))
            __M_writer('\n                        </div>\n')
        __M_writer(
            '                    <div class="col-12 text-center col-lg-4 offset-lg-4">\n                      <button class="btn btn-primary btn-block" type="submit">Add New Prescriber</button>\n                    </div>\n\n\n                </div>\n              </form>\n            </div>\n\n\n          </div>\n\n        </div>\n      </div>\n    </section>\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 6
0
def render_site_menu(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        request = context.get('request', UNDEFINED)

        def site_menu():
            return render_site_menu(context)

        __M_writer = context.writer()
        __M_writer(
            '\r\n    <li class="nav-item">\r\n        <a class="nav-link ')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                'active' if request.dmp.page == 'contact' else ''))
        __M_writer(
            '" href="/contact/">Contact</a>\r\n    </li>\r\n    <li class="nav-item">\r\n        <a class="nav-link '
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                'active' if request.dmp.page == 'about' else ''))
        __M_writer(
            '" href="/about/">About</a>\r\n    </li>\r\n    <li class="nav-item">\r\n        <a class="nav-link" href="/catalog/index/">Catalog</a>\r\n    </li>\r\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 7
0
def render_center_column(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        def top10():
            return render_top10(context)
        instance = context.get('instance', UNDEFINED)
        def center_column():
            return render_center_column(context)
        __M_writer = context.writer()
        __M_writer('\r\n    <div class="content">\r\n        <div class="row">\r\n            <div class="col">\r\n                <div class="druglist">\r\n                    <table>\r\n                        <tr>\r\n                            <td><b>Drug</b></td>\r\n                            <td><b>Opioid?</b></td>\r\n                        </tr>\r\n')
        for item in instance:
            __M_writer('                        <tr class="druginstance">\r\n                            <td class="pointer" onclick="window.location.href=\'/drug/top10/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( item.drugname ))
            __M_writer('\'">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( item.drugname ))
            __M_writer(' <br></td>\r\n                            <td class="center">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( 'Yes' if item.isopioid == 1 else 'No' ))
            __M_writer(' <br></td>\r\n                        </tr>\r\n')
        __M_writer('                    </table>\r\n                </div>\r\n            </div>\r\n\r\n            <div class="col">\r\n                   ')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'top10'):
            context['self'].top10(**pageargs)
        

        __M_writer(' \r\n            </div>\r\n\r\n        </div>\r\n    </div>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 8
0
def render_site_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def site_content():
            return render_site_content(context)

        msg = context.get('msg', UNDEFINED)
        self = context.get('self', UNDEFINED)
        request = context.get('request', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\r\n\r\n<div class="content">\r\n<p class="alert">\r\n    ')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(msg))
        __M_writer(
            '\r\n</p>\r\n\r\n\r\n<form method="POST" id="contactform">\r\n    <table class="content formlabel" style="margin-left:15%; padding-right:25%; width: 50%">\r\n        <tr>\r\n            <td>\r\n                    <p class="formlabel"> Name: </p> \r\n            </td>\r\n            <td>\r\n                    <input type="text" name="yourname" value="'
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)
            (request.user.first_name + ' ' +
             request.user.last_name if request.user.is_authenticated else ''))
        __M_writer(
            '"/> \r\n                </td>\r\n        </tr>\r\n        <tr>\r\n                <td>\r\n                        <p class="formlabel"> Email:  </p>\r\n                </td>\r\n                <td>\r\n                        <input type = "email" name="youremail" value="'
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                request.user.email if request.user.is_authenticated else ''))
        __M_writer(
            '" />\r\n                    </td>\r\n            </tr>\r\n            <tr>\r\n                    <td>\r\n                            <p class="formlabel"> Message:  </p>\r\n                    </td>\r\n                    <td><textarea name="yourmessage" class="forminput"></textarea>\r\n                            \r\n                        </td>\r\n                </tr>     \r\n    </table>\r\n    <p style="margin-left:40%; margin-top:15px;"><input type="submit" class="btn btn-outline-secondary mybtn"/></p>\r\n</form>\r\n<br><br>\r\n</div>\r\n\r\n\r\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 9
0
def render_site_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def site_content():
            return render_site_content(context)

        self = context.get('self', UNDEFINED)
        form2 = context.get('form2', UNDEFINED)
        request = context.get('request', UNDEFINED)
        form = context.get('form', UNDEFINED)
        msg = context.get('msg', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n')
        if request.user.has_perm('account.search') or request.user.has_perm(
                'account.safesearch'):
            __M_writer(
                '   <div class="content">\r\n      <p class="portaltitle">Search</p>\r\n      <p class="message">'
            )
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(msg))
            __M_writer(
                '</p>\r\n      <form action="" method="post">\r\n            <table >\r\n               <tr>\r\n                  <td style="width:2%"></td>\r\n                  <td style="width:50%" >\r\n                     <table class="formlabel">\r\n                           '
            )
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(form))
            __M_writer(
                '\r\n                     </table>\r\n                  </td>\r\n                  <td style="border-right-color:grey;border-right-style:solid;border-width:1px; width: 10px"></td>\r\n                  <td style="width:15px"></td>\r\n                  <td style="width:45%">\r\n                     <table class="formlabel"style="vertical-align:top; margin-bottom:165px;">\r\n                         '
            )
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(form2))
            __M_writer(
                '\r\n                     </table>\r\n                  </td>\r\n                  <td style="width:3px"></td>\r\n               </tr>\r\n            \r\n            </table>\r\n            <hr>\r\n            \r\n            <p style="margin-left:45%; margin-top:15px;"><input type="submit" class="btn mybtn" value="Search"/></p>\r\n          </form>\r\n   </div>\r\n'
            )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 10
0
def render_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)

        def content():
            return render_content(context)

        candidates = context.get('candidates', UNDEFINED)
        poll = context.get('poll', UNDEFINED)
        len = context.get('len', UNDEFINED)
        str = context.get('str', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\n')
        from student_elect import settings

        __M_writer(
            '\n\n<div class="container-fluid">\n    <div class="row">\n')
        if len(candidates) > 0:
            for candidate in candidates:
                __M_writer(
                    '        <div class="col-xl-2 col-lg-3 col-md-3 col-sm-4 col-xs-6 candidate">\n          <div class="card mt-1">\n            <div class="card-img-top" style="padding:1rem;">\n              <div class="cand-image" style="background-image: url(\''
                )
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)
                    (settings.STATIC_URL + settings.MEDIA_URL +
                     str(candidate.imagefile)))
                __M_writer(
                    '\');"></div>\n            </div>\n            <div class="card-body pt-0">\n              <center>\n                <div class="h6 cand-firstname">'
                )
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(
                        candidate.firstname))
                __M_writer(
                    '</div>\n                <div class="h6 cand-lastname">')
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(
                        candidate.lastname))
                __M_writer(
                    '</div>\n                <div class="cand-votes">Votes: ')
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(
                        candidate.vote_set.filter(round=poll.round).count()))
                __M_writer(
                    '</div>\n\n              </center>\n            </div> \n            <div class="close" data-id="'
                )
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(
                        candidate.id))
                __M_writer(
                    '">\n                <i class="material-icons">\n                    close\n                </i>\n            </div>\n          </div>\n        </div>\n'
                )
        else:
            __M_writer(
                '        <div class="col-12">\n          <h5>Add candidates by clicking the "+" button above.</h5>\n        </div>\n'
            )
        __M_writer('  </div>\n</div>\n  \n\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 11
0
def render_site_left(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        categories = context.get('categories', UNDEFINED)

        def site_left():
            return render_site_left(context)

        __M_writer = context.writer()
        __M_writer(
            '\r\n    <ul>            \r\n        <li>\r\n            <a href="/catalog/index/0/">\r\n                All Products\r\n            </a>\r\n        </li>\r\n'
        )
        for category in categories:
            __M_writer(
                '            <li>\r\n                <a href="/catalog/index/')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(category.id))
            __M_writer('">\r\n                    ')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(category.name))
            __M_writer('\r\n                </a>\r\n            </li>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 12
0
def render_site_center(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        form = context.get('form', UNDEFINED)
        cart = context.get('cart', UNDEFINED)

        def site_center():
            return render_site_center(context)

        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\r\n    Checkout\r\n    <form method="POST">\r\n        <table>')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(form.as_table()))
        __M_writer(
            '</table>\r\n        <form action="your-server-side-code" method="POST">\r\n            <script\r\n              src="https://checkout.stripe.com/checkout.js" class="stripe-button"\r\n              data-key=\'pk_test_kBGIrn6ltFl45eOmqMQGrBzW00OtTqJb2y\'\r\n              data-amount= \''
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(cart.total *
                                                           Decimal("100.0")))
        __M_writer(
            '\'\r\n              data-name="Demo Site"\r\n              data-description="Widget"\r\n              data-image="https://stripe.com/img/documentation/checkout/marketplace.png"\r\n              data-locale="auto">\r\n            </script>\r\n          </form>\r\n    </form>\r\n\r\n \r\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 13
0
def render_main_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        csrf_input = context.get('csrf_input', UNDEFINED)
        self = context.get('self', UNDEFINED)
        form = context.get('form', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)

        def main_content():
            return render_main_content(context)

        __M_writer = context.writer()
        __M_writer(
            '\n<!-- BEGIN: CONTENT -->\n<section class="page-title bg-image bg-overlay d-lg-block d-md-block d-sm-none d-none" style="height: 300px; background-image: url('
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer(
            'account/media/doctor-arms.jpg); background-repeat: no-repeat;  background-size: cover; background-position: center -160px;">\n  <div class="overlay">\n    <div class="container">\n      <h1 class="text-right">Login</h1>\n    </div>\n  </div>\n</section>\n<section class="d-lg-none d-md-none d-sm-block d-xs-block" style="height: 180px; background-image: url('
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer(
            'account/media/doctor-arms.jpg); background-repeat: no-repeat; background-position: top;  background-size: cover;">\n  <div class="overlay">\n    <div class="container">\n      <h1 class="text-right" style="color: #fff">Login</h1>\n    </div>\n  </div>\n</section>\n<section>\n  <div class="row">\n    <div class="col-12 col-lg-4 offset-lg-4">\n      <div class="well">\n        <div class="inlay-form-labels">\n          <h4 class="text-secondary">\n          Login\n          </h4>\n          <div class="oak_contact_form_wrapper">\n            <div class="oak_contact_above_form">\n            </div>\n            <form method="post" class="oak_contact_form">\n                '
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(csrf_input))
        __M_writer('\n                ')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(form.as_p()))
        __M_writer(
            '\n                <button class="btn btn-primary btn-block" type="submit">Submit</button>\n            </form>\n          </div>\n\n        </div>\n\n      </div>\n    </div>\n  </div>\n</section>\n\n\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 14
0
def render_site_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        form = context.get('form', UNDEFINED)
        self = context.get('self', UNDEFINED)

        def site_content():
            return render_site_content(context)

        msg = context.get('msg', UNDEFINED)
        request = context.get('request', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n')
        if request.user.is_authenticated:
            __M_writer(
                '   <div class="content">\r\n     <div style="width:100%;margin-left:18%">\r\n      <form action="" method="POST">\r\n        <p style="padding-top:10px;font-weight: bold;font-size: 56px;color:grey;line-height: 40px;">'
            )
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    request.user.username))
            __M_writer('</p>\r\n        <br>\r\n        ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(msg))
            __M_writer('\r\n        <table class="formlabel">\r\n            ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(form))
            __M_writer(
                '\r\n        </table>\r\n        <p style="margin-left:20%; margin-top:15px;"><input type="submit" class="btn mybtn" value="Change Password"/></p>\r\n      </form>\r\n    </div>\r\n</div>\r\n'
            )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 15
0
def render_site_left(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)

        def inside_left():
            return render_inside_left(context)

        def site_left():
            return render_site_left(context)

        __M_writer = context.writer()
        __M_writer('\n\n\n\n\n    <ul class="nav flex-column">\n')
        for category in cmod.Category.objects.all():
            __M_writer(
                '            <li class="nav-item"><a class="nav-link" href="/catalog/index/'
            )
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(category.id))
            __M_writer('">')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(category.name))
            __M_writer('</a> </li>\n')
        __M_writer('    </ul>\n\n')
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'inside_left'):
            context['self'].inside_left(**pageargs)

        __M_writer('\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 16
0
def render_page_content(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        def page_content():
            return render_page_content(context)
        polls = context.get('polls', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\n\n  ')
        from django.db.models import Count 
        
        __M_writer('\n\n  <div class="container-fluid">\n    <div class="row">\n      \n')
        for poll in polls:
            __M_writer('\n      <div class="col-lg-6 col-md-6">\n        <div class="card mt-0">\n          <div class="card-body">\n              <h3 class="card-title text-truncate mr-5">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( poll.title ))
            __M_writer('</h3>\n            <div class="row">\n              <div class="col-lg-12 col-md-12 table-responsive mt-3">\n                  <table class="table table-hover">\n                      <h6 class="h6 text-left mb-0 ml-2">Top 5</h6>\n                      <thead class="text-primary">\n                        <th>Name</th>\n                        <th class="text-center">Votes</th>\n                      </thead>\n                      <tbody>\n\n')
            for candidate in poll.candidate_set.filter(status='A').annotate(num_votes=Count('vote')).order_by('-num_votes')[:5]:
                __M_writer('\n                        <tr>\n                          <td>')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)( candidate.firstname + " " + candidate.lastname ))
                __M_writer('</td>\n                          <td class="text-center">')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)( candidate.vote_set.filter(round=poll.round).count() ))
                __M_writer('</td>\n                        </tr>\n                        \n')
            __M_writer('                      </tbody>\n                    </table>\n              </div>\n            </div>\n          </div>\n          <a class="btn btn-block btn-warning btn-round btn-just-icon edit-button" href="/dashboard/edit/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( poll.id ))
            __M_writer('"><i class="material-icons">edit</i></a>\n        </div>\n      </div>\n\n')
        __M_writer('\n    </div>\n  </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 17
0
def render_left_column(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        category = context.get('category', UNDEFINED)

        def left_column():
            return render_left_column(context)

        __M_writer = context.writer()
        __M_writer('\r\n    <ul id="category-list">\r\n        <li class="')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                'active' if category is None else ''))
        __M_writer(
            '">\r\n            <a href="/catalog/index/">All Products</a></li>\r\n'
        )
        for cat in cmod.Category.objects.order_by('name'):
            __M_writer('        <li class="')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    'active' if category == '${ cat.name }' else ''))
            __M_writer('">\r\n            <a href="/catalog/index/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(cat.id))
            __M_writer('">')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(cat.name))
            __M_writer('</a></li>\r\n')
        __M_writer('    </ul>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 18
0
def render_site_content(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        exists = context.get('exists', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)
        name = context.get('name', UNDEFINED)
        msg = context.get('msg', UNDEFINED)
        def site_content():
            return render_site_content(context)
        form = context.get('form', UNDEFINED)
        gender = context.get('gender', UNDEFINED)
        request = context.get('request', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n')
        if request.user.is_authenticated:
            __M_writer('<div class="content">\r\n      <div style="width:100%;margin-left:23%">\r\n       <form action="" method="POST">\r\n        <p class="homeparg">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(msg))
            __M_writer('</p>\r\n')
            if exists:
                __M_writer('        <p class="link2" style="margin-left:13%;font-style:italic">Type "Delete" below to confirm</p>\r\n        <div class="linkbox hha" style="margin-left:-150px;width:auto;max-width: 800px">\r\n                <img src="')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
                __M_writer('homepage/media/UserImages/')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)(gender))
                __M_writer('.png">\r\n                <p class="hha">')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)(name))
                __M_writer('</p> \r\n        </div>\r\n         <table class="formlabel" style="width:100%;margin-left:10%">\r\n             ')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)(form))
                __M_writer('\r\n         </table>\r\n         <p style="margin-left:20%; margin-top:15px;"><input type="submit" class="btn mybtn" value="Update"/></p>\r\n')
            __M_writer('       </form>\r\n     </div>\r\n </div>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 19
0
def render_center_column(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        form = context.get('form', UNDEFINED)

        def center_column():
            return render_center_column(context)

        stripeTotal = context.get('stripeTotal', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\r\n\r\n<form action="" method="post">\r\n    \r\n        <table>\r\n        '
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(form.as_table()))
        __M_writer(
            ' \r\n        </table>\r\n        <!-- <input type="submit" class="btn btn-info" value="Buy Now"> -->\r\n\r\n    <script\r\n    src="https://checkout.stripe.com/checkout.js" class="stripe-button"\r\n    data-key="'
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                settings.STRIPE_PUBLIC_KEY))
        __M_writer('"\r\n    data-amount="')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(stripeTotal))
        __M_writer(
            '"\r\n    data-name="Stripe.com"\r\n    data-description="Widget"\r\n    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"\r\n    data-locale="auto"\r\n    data-zip-code="true">\r\n  </script>\r\n\r\n</form>\r\n\r\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 20
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        self = context.get('self', UNDEFINED)
        request = context.get('request', UNDEFINED)

        def content():
            return render_content(context._locals(__M_locals))

        __M_writer = context.writer()
        __M_writer(
            '<!DOCTYPE html>\n<html>\n    <meta charset="UTF-8">\n    <head>\n\n        <title>DMP</title>\n\n'
        )
        __M_writer(
            '        <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>\n\n'
        )
        __M_writer(
            '        <script src="/django_mako_plus/dmp-common.min.js"></script>\n        '
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                django_mako_plus.links(self)))
        __M_writer(
            '\n\n        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">\n        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>\n\n    </head>\n    <body>\n\n        <header>\n            <nav class="navbar navbar-expand-lg navbar-light bg-light">\n                <div class="container">\n                  <a class="navbar-brand" href="#">Group 2-13 Intex</a>\n                  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">\n                  <span class="navbar-toggler-icon"></span>\n                </button>\n              \n                  <div class="collapse navbar-collapse" id="navbarSupportedContent">\n                    <ul class="navbar-nav ml-auto">\n                        <li class="nav-item">\n                            <a class="nav-link" href="#">Contact</a>\n                        </li>\n                        <li class="nav-item">\n                            <a class="nav-link" href="#">About</a>\n                        </li>\n'
        )
        if request.user.is_superuser:
            __M_writer(
                '                            <li class="nav-item">\n                                <a class="nav-link" href="#">Dashboard</a>\n                            </li>\n'
            )
        if not request.user.is_authenticated:
            __M_writer(
                '                            <li class="nav-item dropdown">\n                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n                                    Account\n                                </a>\n                                <!-- Here\'s the magic. Add the .animate and .slide-in classes to your .dropdown-menu and you\'re all set! -->\n                                <div class="dropdown-menu dropdown-menu-right animate slideIn" aria-labelledby="navbarDropdown">\n                                <a class="dropdown-item" href="/account">Login</a>\n                                <a class="dropdown-item" href="/account/signup">Sign Up</a>\n                                <div class="dropdown-divider"></div>\n                                <a class="dropdown-item" href="#">Learn More</a>\n                                </div>\n                            </li>\n'
            )
        else:
            __M_writer(
                '                        <li class="nav-item dropdown">\n                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n                                Welcome '
            )
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    request.user.username))
            __M_writer(
                '\n                            </a>\n                            <!-- Here\'s the magic. Add the .animate and .slide-in classes to your .dropdown-menu and you\'re all set! -->\n                            <div class="dropdown-menu dropdown-menu-right animate slideIn" aria-labelledby="navbarDropdown">\n                            <a class="dropdown-item" href="/account/logout">Logout</a>\n                        </li>\n'
            )
        __M_writer(
            '                    </ul>\n                  </div>\n                </div>\n              </nav>\n        </header>\n\n        <main style="width: 100%; padding-left: 0; padding-right: 0;">\n            '
        )
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'content'):
            context['self'].content(**pageargs)

        __M_writer(
            '\n        </main>\n\n        <footer>\n            <div><a href="http://django-mako-plus.readthedocs.io/">Online Documentation</a></div>\n            <div><a href="https://github.com/doconix/django-mako-plus/">DMP on GitHub</a></div>\n        </footer>\n\n    </body>\n</html>\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 21
0
def render_center_content(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        def center_content():
            return render_center_content(context)
        cartItems = context.get('cartItems', UNDEFINED)
        cart = context.get('cart', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n    <div id="shopping_cart">\r\n        <br />\r\n        <table>\r\n')
        __M_writer('            <tr>\r\n                <th>Product Image</th>\r\n                <th>Product Name</th>\r\n                <th>Quantity</th>\r\n                <th>Price</th>\r\n                <th>Extended</th>\r\n                <th>Actions</th>\r\n            </tr>\r\n')
        for si in cartItems:
            __M_writer('                <tr>\r\n                    <td><img class="cart_picture" src="')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(si.product.image_url()))
            __M_writer('"></td>\r\n                    <td><p class="table_box">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.product.name ))
            __M_writer('</p></td>\r\n                    <td><p class="table_box">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.quantity ))
            __M_writer('</p></td>\r\n                    <td><p class="table_box">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.price ))
            __M_writer('</p></td>\r\n                    <td><p class="table_box">')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.price * si.quantity ))
            __M_writer('</p></td>\r\n                    <td><a class="button btn btn-secondary table_box" type="button" \r\n                    href="/catalog/cart.remove/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.product.id ))
            __M_writer('">Remove</a></td>\r\n                </tr>\r\n')
        __M_writer('            <tr><td></td><td></td><td></td>\r\n            <td></td><td></td><td></td></tr>\r\n            <tr>\r\n                <td></td>\r\n                <td>Subtotal</td>\r\n                <td></td><td></td>\r\n                <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( cart.subtotal ))
        __M_writer('</td>\r\n                <td></td>\r\n            </tr>\r\n            <tr>\r\n                <td></td>\r\n                <td>Tax</td>\r\n                <td></td><td></td>\r\n                <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( cart.tax ))
        __M_writer('</td>\r\n                <td></td>\r\n            </tr>\r\n            <tr><td></td><td></td><td></td>\r\n            <td></td><td></td><td></td></tr>\r\n            <tr>\r\n                <td></td>\r\n                <td>Total</td>\r\n                <td></td><td></td>\r\n                <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( cart.total ))
        __M_writer('</td>\r\n                <td></td>\r\n            </tr>\r\n        </table>\r\n    </div>\r\n    <br />\r\n    <div id="checkout_button">\r\n        <a class="button btn btn-secondary" type="button" \r\n        id="dropdownMenuButton" href="/catalog/checkout/">Checkout Now</a>\r\n    </div>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 22
0
def render_site_center(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        sale = context.get('sale', UNDEFINED)
        self = context.get('self', UNDEFINED)
        saleitems = context.get('saleitems', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)
        def site_center():
            return render_site_center(context)
        __M_writer = context.writer()
        __M_writer('\r\n\r\n<h1>Receipt</h1>\r\n<table>\r\n    <tr>\r\n    <th></th>\r\n    <th>Product Name</th>\r\n    <th>Quantity</th>\r\n    <th>Price</th>\r\n    <th>Extended</th>\r\n    <th>Actions</th>\r\n    </tr>\r\n')
        for si in saleitems:
            __M_writer('        <tr>\r\n         <td>\r\n                <img id="product_image" src="')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( STATIC_URL ))
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.product.image_url() ))
            __M_writer('" alt="')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(django.utils.html.escape( si.product.name )))
            __M_writer('" />\r\n            </td>\r\n            <td>\r\n                ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.product.name ))
            __M_writer('\r\n            </td>\r\n            <td>\r\n                ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.quantity ))
            __M_writer('\r\n            </td>\r\n            <td>\r\n                ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( si.product.price * si.quantity ))
            __M_writer('\r\n            </td>\r\n        </tr>\r\n')
        __M_writer('    <tr>\r\n        <td>Subtotal</td>\r\n        <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(sale.subtotal))
        __M_writer('</td>\r\n    </tr>\r\n    <tr>\r\n        <td>Tax</td>\r\n        <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(sale.tax))
        __M_writer('</td>\r\n    </tr>\r\n    <tr>\r\n    <td>Total</td>\r\n        <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(sale.total))
        __M_writer('</td>\r\n    </tr>\r\n</table>\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 23
0
def render_site_center(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def site_center():
            return render_site_center(context)

        cartItems = context.get('cartItems', UNDEFINED)
        cart = context.get('cart', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\r\n    <table class="table table-striped table-bordered">\r\n        <tr>\r\n            <th>Product Image</th>\r\n            <th>Product Name</th>\r\n            <th>Quantity</th>\r\n            <th>Price</th>\r\n            <th>Extended</th>\r\n            <th>Actions</th>\r\n        </tr>\r\n'
        )
        for cartItem in cartItems:
            __M_writer(
                '            <tr>\r\n                <td><img class="cartThumbnail" src="'
            )
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    cartItem.product.image_url()))
            __M_writer('" alt="')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    cartItem.product.name))
            __M_writer('" /></td>\r\n                <td>')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    cartItem.product.name))
            __M_writer('</td>\r\n                <td>')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    cartItem.quantity))
            __M_writer('</td>\r\n                <td>')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(cartItem.price))
            __M_writer('</td>\r\n                <td>')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(
                    cartItem.price * cartItem.quantity))
            __M_writer(
                '</td>\r\n                <td><a href="/catalog/cart.remove/')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(cartItem.id))
            __M_writer('">Remove</a></td>\r\n            </tr>\r\n')
        __M_writer(
            '        <tr>\r\n            <td></td>\r\n            <td>Tax</td>\r\n            <td></td>\r\n            <td></td>\r\n            <td>'
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(cart.tax))
        __M_writer(
            '</td>\r\n            <td></td>\r\n        </tr>\r\n        <tr>\r\n            <td></td>\r\n            <td>Total</td>\r\n            <td></td>\r\n            <td></td>\r\n            <td>'
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(cart.total))
        __M_writer(
            '</td>\r\n            <td></td>\r\n        </tr>\r\n    </table>\r\n\r\n    <a href="/catalog/checkout"><input type="button" class="btn btn-primary" value="Checkout" /></a>\r\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 24
0
def render_site_center(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        myproducts = context.get('myproducts', UNDEFINED)
        self = context.get('self', UNDEFINED)
        SI = context.get('SI', UNDEFINED)
        def site_center():
            return render_site_center(context)
        __M_writer = context.writer()
        __M_writer('\n\n<div class="container">\n  <h2>Cart</h2>\n  <p>Every Product You Want to Buy</p>            \n  <table class="table table-bordered">\n    <thead>\n      <tr>\n        <th>Product Image</th>\n        <th>Product Name</th>\n        <th>Quantity</th>\n        <th>Price</th>\n        <th>Extended</th>\n        <th>Actions</th>\n      </tr>\n    </thead>\n    <tbody>\n      \n\n')
        for item in SI :
            __M_writer('            <tr>\n\n                <td> <img src="')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(item.product.image_url()))
            __M_writer('"/></td>\n                <td>')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(item.product.name))
            __M_writer('</td>\n                <td>')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(item.quantity))
            __M_writer('</td>\n                <td>')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(item.product.price))
            __M_writer('</td>\n                <td>')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(item.product.price * item.quantity))
            __M_writer('</td>\n               \n                <td><a class="btn btn-danger" href="/catalog/cart.remove/')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(item.id))
            __M_writer('">Remove From Cart</a></td>\n\n            </tr>\n')
        __M_writer('\n        \n        \n    \n      <tr>\n        <td></td>\n        <td>Tax</td>\n        <td></td>\n        <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(myproducts.tax))
        __M_writer('</td>\n        <td></td>\n      </tr>\n     <tr>\n        <td></td>\n        <td>Total</td>\n        <td></td>\n        <td>')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(myproducts.total))
        __M_writer('</td>\n        <td></td>\n      </tr>\n    </tbody>\n  </table>\n</div>\n\n<div>\n\n<a class="btn-lg btn-success" href="/catalog/checkout/">Checkout</a>\n\n</div>\n</br>\n\n\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 25
0
def render_logo(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        user = context.get('user', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)

        def logo():
            return render_logo(context)

        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\r\n')
        if user.groups.filter(name='Prescribers').exists():
            __M_writer('                <img src="')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
            __M_writer(
                'homepage/media/avatar.png" alt="python"  class="logo2"/>\r\n')
        else:
            if user.groups.filter(
                    name='HealthOfficials').exists() or user.groups.filter(
                        name='Officials').exists():
                __M_writer('                    <img src="')
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
                __M_writer(
                    'homepage/media/heart.png" alt="python" class="logo2" />\r\n                    \r\n'
                )
            else:
                if user.groups.filter(name='HHS').exists():
                    __M_writer('                        <img src="')
                    __M_writer(
                        django_mako_plus.ExpressionPostProcessor(self)(
                            STATIC_URL))
                    __M_writer(
                        'homepage/media/hha.png" alt="python" class="logo2" />\r\n'
                    )
                else:
                    __M_writer('                        <img src="')
                    __M_writer(
                        django_mako_plus.ExpressionPostProcessor(self)(
                            STATIC_URL))
                    __M_writer(
                        'homepage/media/logo2.png" alt="python" class="logo"/>\r\n'
                    )
                __M_writer('                        \r\n')
        __M_writer('                \r\n                \r\n                ')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 26
0
def render_page_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:

        def page_content():
            return render_page_content(context)

        self = context.get('self', UNDEFINED)
        polls = context.get('polls', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\n  <div class="row">\n    \n')
        for poll in polls:
            __M_writer(
                '\n    <div class="col-lg-6 col-md-6">\n      <div class="card">\n        <div class="card-header card-header-primary">\n          <h3 class="card-title">'
            )
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(poll.title))
            __M_writer(
                '</h3>\n        </div>\n        <div class="card-body">\n          <div class="row">\n            <div class="col-lg-12 col-md-12 table-responsive">\n                <table class="table table-hover">\n                    <thead class="text-warning">\n                      <th>Name</th>\n                      <th>Votes</th>\n                    </thead>\n                    <tbody>\n\n'
            )
            for candidate in poll.candidate_set.filter(round=poll.round):
                __M_writer(
                    '\n                      <tr>\n                        <td>'
                )
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(
                        candidate.firstname + " " + candidate.lastname))
                __M_writer('</td>\n                        <td>')
                __M_writer(
                    django_mako_plus.ExpressionPostProcessor(self)(
                        candidate.vote_set.filter(round=poll.round).count()))
                __M_writer(
                    '</td>\n                      </tr>\n                      \n'
                )
            __M_writer(
                '                    </tbody>\n                  </table>\n            </div>\n            <div class="col-lg-12 col-md-12">\n              <div class="row no-gutters justify-content-center">\n                <div class="col-xl-4 col-lg-6 col-md-6 p-1">\n                  <a class="btn btn-block btn-info" href="/dashboard/details/'
            )
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(poll.id))
            __M_writer(
                '">Details</a>\n                </div>\n                <div class="col-xl-4 col-lg-6 col-md-6 p-1">\n                  <a class="btn btn-block btn-warning" href="/dashboard/edit/'
            )
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(poll.id))
            __M_writer(
                '">Edit</a>\n                </div>\n              </div>\n            </div>\n          </div>\n          \n        </div>\n      </div>\n    </div>\n\n'
            )
        __M_writer('\n  </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 27
0
def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)

        def title():
            return render_title(context._locals(__M_locals))

        STATIC_URL = context.get('STATIC_URL', UNDEFINED)

        def content():
            return render_content(context._locals(__M_locals))

        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset="utf-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge">\n    <title>'
        )
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'title'):
            context['self'].title(**pageargs)

        __M_writer(
            ' - StudentElect</title>\n    <meta name="description" content="">\n    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no, viewport-fit=cover">\n    <meta name="robots" content="all,follow">\n    <meta name="apple-mobile-web-app-capable" content="yes">\n    <meta name="apple-mobile-web-app-status-bar-style" content="default">\n    \n    <!-- Font Awesome -->\n    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">\n    <!-- Bootstrap core CSS -->\n    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet">\n    <!-- Material Design Bootstrap -->\n    <link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.0/css/mdb.min.css" rel="stylesheet">\n    <!-- Fontastic Custom icon font-->\n    <link rel="stylesheet" href="'
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer(
            'media/css/fontastic.css">\n    <!-- Google fonts - Poppins -->\n    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,700">\n    <!-- theme stylesheet-->\n    <link rel="stylesheet" href="'
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer(
            'media/css/style.default.css" id="theme-stylesheet">\n\n    <!-- JQuery -->\n    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>\n    <!-- Bootstrap tooltips -->\n    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>\n    <!-- Bootstrap core JavaScript -->\n    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/js/bootstrap.min.js"></script>\n    <!-- MDB core JavaScript -->\n    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.0/js/mdb.min.js"></script>\n    \n\n    '
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                django_mako_plus.links(self)))
        __M_writer(
            '\n\n\n  </head>\n  <body>\n    <div class="page">\n        <div class="container content-inner">\n\n            '
        )
        if 'parent' not in context._data or not hasattr(
                context._data['parent'], 'content'):
            context['self'].content(**pageargs)

        __M_writer(
            '             \n\n        </div>\n    </div>\n\n  </body>\n</html>'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 28
0
def render_site_center(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        form = context.get('form', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)
        product = context.get('product', UNDEFINED)

        def site_center():
            return render_site_center(context)

        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(
            '\r\n    <h1 class="text-center">Products</h1>\r\n\r\n        <div id="catalog" class="row col-md-12">\r\n        \r\n            <div class="product-tile col-md-4 offset-md-2">\r\n                <div class="product-image"><img class="tile-image" src="'
        )
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                product.image_url()))
        __M_writer(
            '"></img></div>\r\n                <div class="product-name">')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(product.name))
        __M_writer('</div>\r\n                <div class="product-price">$')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(product.price))
        __M_writer('</div>\r\n                <div class="product-name">')
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(
                product.description))
        __M_writer(
            '</div>\r\n                <div class="product-quantity">Remaining quantity: '
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(product.quantity))
        __M_writer(
            '</div>\r\n            </div>\r\n            <div class="col-md-4">\r\n            </br></br></br></br></br></br></br></br>\r\n                <form method="post">\r\n                    <table>\r\n                        '
        )
        __M_writer(
            django_mako_plus.ExpressionPostProcessor(self)(form.as_table()))
        __M_writer(
            '\r\n                    </table>\r\n                    <input type="submit" value="Buy Now">\r\n                </form>\r\n                \r\n            </div>\r\n            <div class="col-md-8 offset-md-2">\r\n'
        )
        for url in product.image_urls():
            __M_writer('                    <img class="small-image" src="')
            __M_writer(
                django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)(url))
            __M_writer('"></img>\r\n')
        __M_writer('            </div>\r\n\r\n        </div>\r\n\r\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 29
0
def render_body(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        def content():
            return render_content(context._locals(__M_locals))
        request = context.get('request', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('<!DOCTYPE html>\n<html>\n    <meta charset="UTF-8">\n    <head>\n\n        <title>HHS Opioid Analytics</title>\n\n')
        __M_writer('        <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>\n\n')
        __M_writer('        <script src="/django_mako_plus/dmp-common.min.js"></script>\n        ')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( django_mako_plus.links(self) ))
        __M_writer('\n\n        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">\n        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>\n        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">\n        <link\n        type="text/css"\n        rel="stylesheet"\n        href="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.min.css"\n        />\n\n\n    </head>\n    <body>\n\n        <header>\n            <nav class="navbar navbar-expand-lg navbar-light bg-light">\n                <div class="container">\n                  <a class="navbar-brand" href="#"><img height="50" src="')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)(STATIC_URL))
        __M_writer('homepage/media/logo4.png"/></a>\n                  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">\n                  <span class="navbar-toggler-icon"></span>\n                </button>\n              \n                  <div class="collapse navbar-collapse" id="navbarSupportedContent">\n                    <ul class="navbar-nav ml-auto">\n                        <li class="nav-item">\n                            <a href="/drugs" class="nav-link" href="#">Drugs</a>\n                        </li>\n                        <li class="nav-item">\n                            <a href="/prescribers" class="nav-link" href="#">Prescribers</a>\n                        </li>\n                        ')
        __M_writer('\n')
        if request.user.has_perm('admin.dashboard'):
            __M_writer('                            <li class="nav-item">\n                                <a class="nav-link" href="/analytics">Dashboard</a>\n                            </li>\n')
        if not request.user.is_authenticated:
            __M_writer('                            <li class="nav-item dropdown">\n                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n                                    Account\n                                </a>\n                                <!-- Here\'s the magic. Add the .animate and .slide-in classes to your .dropdown-menu and you\'re all set! -->\n                                <div class="dropdown-menu dropdown-menu-right animate slideIn" aria-labelledby="navbarDropdown">\n                                <a class="dropdown-item" href="/account">Login</a>\n                                <a class="dropdown-item" href="/account/signup">Sign Up</a>\n                                \n                            </li>\n')
        else:
            __M_writer('                        <li class="nav-item dropdown">\n                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n                                Welcome ')
            __M_writer(django_mako_plus.ExpressionPostProcessor(self)( request.user.username))
            __M_writer('\n                            </a>\n                            <!-- Here\'s the magic. Add the .animate and .slide-in classes to your .dropdown-menu and you\'re all set! -->\n                            <div class="dropdown-menu dropdown-menu-right animate slideIn" aria-labelledby="navbarDropdown">\n                            <a class="dropdown-item" href="/account/logout">Logout</a>\n')
            if request.user.has_perm('admin.analytics') and not request.user.has_perm('admin.see_names'):
                __M_writer('                                ')
 
                p = dmod.Prescribers.objects.filter(doctorid = request.user.username).first()
                pid = p.id
                                                
                
                __M_locals_builtin_stored = __M_locals_builtin()
                __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['pid','p'] if __M_key in __M_locals_builtin_stored]))
                __M_writer('\n                                <div class="dropdown-divider"></div>\n                                    <a class="dropdown-item" href="/prescribers#/items/')
                __M_writer(django_mako_plus.ExpressionPostProcessor(self)(pid))
                __M_writer('">My Profile</a>\n                                </div>\n')
            __M_writer('\n                            </div>\n                            \n                        </li>\n')
        __M_writer('                    </ul>\n                  </div>\n                </div>\n              </nav>\n        </header>\n\n        <main style="width: 100%; padding-left: 0; padding-right: 0;">\n            ')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'content'):
            context['self'].content(**pageargs)
        

        __M_writer('\n        </main>\n\n        <!-- Footer -->\n        <footer class="page-footer font-small cyan darken-3">\n\n        <!-- Footer Elements -->\n        <div class="container">\n        \n            <!-- Grid row-->\n            <div class="row">\n        \n                <!-- Grid column -->\n                <div class="col-md-12 py-5">\n                    <div class="mb-5 flex-center">\n        \n                        <a class="fb-ic">\n                            <i class="fab fa-microsoft white-text mr-md-5 mr-3 fa-2x"></i>\n                        </a>\n                        <a class="tw-ic">\n                            <i class="fab fa-vuejs white-text mr-md-5 mr-3 fa-2x"></i>\n                        </a>\n                        <a class="gplus-ic">\n                            <i class="fab fa-python white-text mr-md-5 mr-3 fa-2x"></i>\n                        </a>\n                        <a class="gplus-ic">\n                            <i class="fas fa-file-medical white-text mr-md-5 mr-3 fa-2x"></i>\n                        </a>\n                        <a class="gplus-ic">\n                            <i class="fas fa-chart-bar white-text mr-md-5 mr-3 fa-2x"></i>\n                        </a>\n\n                        \n                        \n                    </div>\n                </div>\n                <!-- Grid column -->\n        \n            </div>\n            <!-- Grid row-->\n        \n        </div>\n            <!-- Footer Elements -->\n        \n            <!-- Copyright -->\n        <div class="footer-copyright text-center py-3">© 2019 Copyright:\n            <a href="https://www.is-celebrities-consulting.com">is-celebrities-consulting.com</a>\n        </div>\n            <!-- Copyright -->\n    \n      </footer>\n      <!-- Footer -->\n\n    </body>\n</html>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
Esempio n. 30
0
def render_content(context,**pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        def content():
            return render_content(context)
        csrf_input = context.get('csrf_input', UNDEFINED)
        __M_writer = context.writer()
        __M_writer('\n    <div class="content">\n        <!-- <div id="alignLeft">\n            <div class="container text-center">\n                <form method="POST" class="form-signin">\n                    ')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( csrf_input ))
        __M_writer('\n                    <img class="mb-4" src="https://getbootstrap.com/docs/4.1/assets/brand/bootstrap-solid.svg alt="" width="72" height="72">\n                    <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>\n                    <label for="id_Username" class="sr-only">User Name</label>\n                    <input type="text" name="Username" required="" id="id_Username" class="form-control" placeholder="User Name" required="" autofocus="">\n                    <label for="id_Password" class="sr-only">Password</label>\n                    <input type="password" name="Password" maxlength="32" required="" id="id_Password" class="form-control" placeholder="Password" required="">\n                    <br>\n                    <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>\n                    <p class="mt-5 mb-3 text-muted">© 2019</p>\n                </form>\n            </div>\n        </div> -->\n        <div class="container py-5">\n                <div class="row">\n                    <div class="col-md-12">\n                        <h2 class="text-center text-white mb-4">Bootstrap 4 Login Form</h2>\n                        <div class="row">\n                            <div class="col-md-6 mx-auto">\n            \n                                <!-- form card login -->\n                                <div class="card rounded-0">\n                                    <div class="card-header">\n                                        <h3 class="mb-0">Login</h3>\n                                    </div>\n                                    <div class="card-body">\n                                        <form class="form" role="form" autocomplete="off" id="formLogin" novalidate="" method="POST">\n                                            ')
        __M_writer(django_mako_plus.ExpressionPostProcessor(self)( csrf_input ))
        __M_writer('\n                                            <div class="form-group">\n                                                    <label for="id_Username" class="sr-only">User Name</label>\n                                                    <input type="text" name="Username" required="" id="id_Username" class="form-control" placeholder="User Name" required="" autofocus="">\n                                                <div class="invalid-feedback">Oops, you missed this one.</div>\n                                            </div>\n                                            <div class="form-group">\n                                                    <label for="id_Password" class="sr-only">Password</label>\n                                                    <input type="password" name="Password" maxlength="32" required="" id="id_Password" class="form-control" placeholder="Password" required="">\n                                                <div class="invalid-feedback">Enter your password too!</div>\n                                            </div>\n                                            <div>\n                                                <label class="custom-control custom-checkbox">\n                                                  <input type="checkbox" class="custom-control-input">\n                                                  <span class="custom-control-indicator"></span>\n                                                </label>\n                                            </div>\n                                            <button type="submit" class="btn btn-success btn-lg float-right" id="btnLogin">Login</button>\n                                        </form>\n                                    </div>\n                                    <!--/card-block-->\n                                </div>\n                                <!-- /form card login -->\n            \n                            </div>\n            \n            \n                        </div>\n                        <!--/row-->\n            \n                    </div>\n                    <!--/col-->\n                </div>\n                <!--/row-->\n            </div>\n            <!--/container-->\n    </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()