Example #1
0
def user_settings_view(request):
    data = {
        'title': 'User settings',
        'page': 'user'
    }
    file = device.get_template(request, 'user_settings.html')
    return render(request, file, data)
Example #2
0
def under_construction_view(request):
    data = {
        'title': 'Under Construction',
        'page': 'home'
    }
    file = device.get_template(request, 'error_under_construction.html')
    return render(request, file, data)
Example #3
0
def invalid_request_view(request):
    data = {
        'title': 'Invalid Request',
        'page': 'home'
    }
    file = device.get_template(request, 'error_invalid_request.html')
    return render(request, file, data)
Example #4
0
def offer_home_view(request):
    offers = Offer.get_all()
    pprint(offers)
    obj = list(offers)
    data = {'title': 'Offers', 'offers_list': offers}
    file = device.get_template(request, 'offer_home.html')
    return render(request, file, data)
Example #5
0
def index(request):
    data = {
        'title': 'Error',
        'page': 'home'
    }
    #	return HttpResponse ('This is Invalid Request')
    file = device.get_template(request, 'error_error.html')
    return render(request, file, data)
Example #6
0
def user_topics_select_view(request):
    data = {
        'title': 'Follow Topics',
        'page': 'user'
    }
    topics = Topic.get_topics(request.user)
    data.update({'topics': topics})
    file = device.get_template(request, 'user_topics_select.html')
    return render(request, file, data)
Example #7
0
def home(request):
    if request.user.level != 9:
        __redirect(settings.ERROR_ACCESS_DENIED_URL)

    countries = Country.get_all()
    states = State.get_all('India')
    data = {'title': 'MyAdmin', 'countries': countries, 'states': states}
    file = device.get_template(request, 'admin_home.html')
    return render(request, file, data)
Example #8
0
def signup_view(request):
    data = {'title': 'Signup', 'page': 'user'}
    data.update(csrf(request))
    if 'form_errors' in request.session:
        data['form_errors'] = request.session['form_errors']
        data['form_values'] = request.session['form_values']
        del request.session['form_errors']
        del request.session['form_values']

    file = device.get_template(request, 'user_signup.html')
    return render(request, file, data)
Example #9
0
def profile_view(request):
    print('profile')
    user = User.get_user(request.user)
    dataurl = 'data-url="' + settings.USER_PROFILE_URL + '"'
    data = {
        'title': 'Profile',
        'page': 'user',
        'dataurl': dataurl,
        'user': user
    }
    file = device.get_template(request, 'user_profile.html')
    return render(request, file, data)
Example #10
0
def offer_create_view(request):
    pprint(request)
    imgdata = open(
        settings.STATIC_ROOT + "/images/site-icons-svg/location.svg",
        "rb").read()
    image = "data:image/svg+xml;base64,%s" % base64.b64encode(imgdata).decode(
        'utf8')
    data = {'title': 'Create Offer', 'loc_image': image}
    if 'form_errors' in request.session:
        data['form_errors'] = request.session['form_errors']
        data['form_values'] = request.session['form_values']
        del request.session['form_errors']
        del request.session['form_values']

    file = device.get_template(request, 'offer_create_new.html')
    return render(request, file, data)
Example #11
0
def profile(request):
    data = {'title': 'Profile'}
    file = device.get_template(request, 'user_profile.html')
    return render(request, file, data)
Example #12
0
def home_page(request):
    offers = Offer.get_all()
    pprint(offers)
    data = {'title': 'home', 'offers_list': offers}
    file = device.get_template(request, 'home.html')
    return render(request, file, data)
Example #13
0
def offer_detail_view(request, offer_id):
    print('offer_id : ' + offer_id)
    offer = Offer.get_by_id(offer_id)
    data = {'title': 'View Offers', 'offer': offer}
    file = device.get_template(request, 'offer_detail_view.html')
    return render(request, file, data)
Example #14
0
def access_denied_view(request):
    data = {'title': 'Access Denied', 'page': 'home'}
    file = device.get_template(request, 'error_access_denied.html')
    return render(request, file, data)
Example #15
0
def aboutus(request):
    data = {'title': 'About us'}
    file = device.get_template(request, 'home_aboutus.html')
    return render(request, file, data)
Example #16
0
def contacts(request):
    data = {'title': 'Contacts'}
    file = device.get_template(request, 'home_contacts.html')
    return render(request, file, data)
Example #17
0
def signup_success_view(request):
    print('registration success')
    data = {'title': 'Signup :: Success', 'page': 'user'}
    file = device.get_template(request, 'user_registered.html')
    return render(request, file, data)