コード例 #1
0
def index_view(request):

    if request.method == 'GET':

        page = request.GET.get('page', 1)
        obj = ClientObject(request.user)
        context = {
            'user':
            obj.get_user(),
            'profile':
            obj.get_user_profile(),
            'client':
            obj.get_user_client(),
            'counts':
            obj.get_counts(),
            'balance':
            obj.get_client_balance(),
            'hosting':
            Pagination(obj.get_client_hosting(), 10).get_page(page),
            'messages': [
                get_status_message(get_message_info(request), obj.language), {
                    'message': obj.get_error_message(),
                    'code': 'danger'
                }
            ],
            'dictionary':
            get_language_dictionary(obj.language),
        }
        return render(request, 'hosting/index.html', context)

    raise Http404
コード例 #2
0
ファイル: views.py プロジェクト: madmax330/bssmanager
def staff_index_view(request):

    if request.method == 'GET':

        page = request.GET.get('page', 1)
        obj = StaffObject(request.user)
        context = {
            'user':
            obj.get_user(),
            'profile':
            obj.get_user_profile(),
            'counts':
            obj.get_counts(),
            'projects':
            Pagination(obj.get_active_projects(), 10).get_page(page),
            'messages': [
                get_status_message(get_message_info(request), obj.language), {
                    'message': obj.get_error_message(),
                    'code': 'danger'
                }
            ],
            'dictionary':
            get_language_dictionary(obj.language),
        }
        return render(request, 'project/staff_index.html', context)

    raise Http404
コード例 #3
0
ファイル: views.py プロジェクト: madmax330/bssmanager
def project_view(request, pk):

    if request.method == 'GET':

        tab = request.GET.get('tab', '')
        pages = get_page_numbers(request)
        obj = ClientObject(request.user)
        context = {
            'user':
            obj.get_user(),
            'profile':
            obj.get_user_profile(),
            'client':
            obj.get_user_client(),
            'counts':
            obj.get_counts(),
            'project':
            obj.get_project(pk),
            'required_actions':
            obj.get_project_required_actions(),
            'timeline':
            obj.get_project_timeline(),
            'hosting':
            Pagination(obj.get_project_hosting(),
                       10).get_page(pages['hosting_page']),
            'bills':
            Pagination(obj.get_project_bills(),
                       10).get_page(pages['bill_page']),
            'files':
            Pagination(obj.get_project_files(),
                       10).get_page(pages['file_page']),
            'chat':
            obj.get_project_chat(),
            'messages': [
                get_status_message(get_message_info(request), obj.language), {
                    'message': obj.get_error_message(),
                    'code': 'danger'
                }
            ],
            'dictionary':
            get_language_dictionary(obj.language),
            'tab':
            tab,
        }
        return render(request, 'project/project.html', context)

    raise Http404
コード例 #4
0
def staff_consult_view(request, pk):

    if request.method == 'GET':

        tab = request.GET.get('tab', '')
        pages = get_page_numbers(request)
        obj = StaffObject(request.user)
        context = {
            'user':
            obj.get_user(),
            'profile':
            obj.get_user_profile(),
            'counts':
            obj.get_counts(),
            'staff':
            obj.get_staff_members(),
            'consult':
            obj.get_consult(pk),
            'required_actions':
            Pagination(obj.get_consult_required_actions(),
                       5).get_page(pages['action_page']),
            'events':
            Pagination(obj.get_consult_events(),
                       5).get_page(pages['event_page']),
            'bills':
            Pagination(obj.get_consult_bills(),
                       5).get_page(pages['bill_page']),
            'files':
            Pagination(obj.get_consult_files(),
                       5).get_page(pages['file_page']),
            'chat':
            obj.get_consult_chat(),
            'messages': [
                get_status_message(get_message_info(request), obj.language), {
                    'message': obj.get_error_message(),
                    'code': 'danger'
                }
            ],
            'dictionary':
            get_language_dictionary(obj.language),
            'tab':
            tab,
        }
        return render(request, 'consult/staff_consult.html', context)

    raise Http404
コード例 #5
0
def staff_client_view(request, pk):

    if request.method == 'GET':

        tab = request.GET.get('tab', '')
        pages = get_page_numbers(request)
        obj = StaffObject(request.user)
        client = obj.get_client(pk)
        bills = obj.get_client_bills()
        if obj.get_client(pk):
            context = {
                'user':
                obj.get_user(),
                'profile':
                obj.get_user_profile(),
                'counts':
                obj.get_counts(),
                'client':
                client,
                'projects':
                Pagination(obj.get_client_projects(),
                           5).get_page(pages['project_page']),
                'consults':
                Pagination(obj.get_client_consults(),
                           5).get_page(pages['consult_page']),
                'hosting':
                Pagination(obj.get_client_hosting(),
                           5).get_page(pages['hosting_page']),
                'bills': {
                    'project':
                    Pagination(bills['project'],
                               10).get_page(['project_bill_page']),
                    'consult':
                    Pagination(bills['consult'],
                               10).get_page(['consult_bill_page']),
                    'hosting':
                    Pagination(bills['hosting'],
                               10).get_page(['hosting_bill_page']),
                },
                'users':
                Pagination(obj.get_client_users(),
                           5).get_page(pages['user_page']),
                'messages': [
                    get_status_message(get_message_info(request),
                                       obj.language), {
                                           'message': obj.get_error_message(),
                                           'code': 'danger'
                                       }
                ],
                'dictionary':
                get_language_dictionary(obj.language),
                'tab':
                tab,
            }
            return render(request, 'home/staff_client.html', context)
        else:
            return render(request, 'home/staff_client.html')

    raise Http404
コード例 #6
0
def staff_index_view(request):

    if request.method == 'GET':

        pages = get_page_numbers(request)
        obj = StaffObject(request.user)
        context = {
            'user':
            obj.get_user(),
            'profile':
            obj.get_user_profile(),
            'counts':
            obj.get_counts(),
            'projects':
            Pagination(obj.get_notified_projects(),
                       10).get_page(pages['project_page']),
            'hosting':
            Pagination(obj.get_notified_hosting(),
                       10).get_page(pages['hosting_page']),
            'consults':
            Pagination(obj.get_notified_consults(),
                       10).get_page(pages['consult_page']),
            'contact_messages':
            Pagination(obj.get_new_messages(),
                       10).get_page(pages['message_page']),
            'bills':
            obj.get_reported_bills(),
            'requests':
            Pagination(obj.get_consult_requests(),
                       10).get_page(pages['request_page']),
            'messages': [
                get_status_message(get_message_info(request), obj.language), {
                    'message': obj.get_error_message(),
                    'code': 'danger'
                }
            ],
            'dictionary':
            get_language_dictionary(obj.language),
        }
        return render(request, 'home/staff_index.html', context)

    raise Http404
コード例 #7
0
def hosting_view(request, pk):

    if request.method == 'GET':

        tab = request.GET.get('tab', '')
        page = request.GET.get('page', 1)
        obj = ClientObject(request.user)
        context = {
            'user':
            obj.get_user(),
            'profile':
            obj.get_user_profile(),
            'client':
            obj.get_user_client(),
            'counts':
            obj.get_counts(),
            'hosting':
            obj.get_hosting(pk),
            'events':
            obj.get_hosting_events(),
            'bills':
            Pagination(obj.get_hosting_bills(), 10).get_page(page),
            'chat':
            obj.get_hosting_chat(),
            'messages': [
                get_status_message(get_message_info(request), obj.language), {
                    'message': obj.get_error_message(),
                    'code': 'danger'
                }
            ],
            'dictionary':
            get_language_dictionary(obj.language),
            'tab':
            tab,
        }
        return render(request, 'hosting/hosting.html', context)

    raise Http404