Пример #1
0
 def index_view(self):
     if not is_verified_user():
         flash("Your account is unverified. "
               "Please verify by clicking on the confirmation link that has been emailed to you.")
     profile = DataGetter.get_user(login.current_user.id)
     return self.render('/gentelella/admin/profile/index.html',
                        profile=profile)
 def index_view(self):
     if not is_verified_user():
         flash("Your account is unverified. "
               "Please verify by clicking on the confirmation link that has been emailed to you.")
     profile = DataGetter.get_user(login.current_user.id)
     return self.render('/gentelella/admin/profile/index.html',
                        profile=profile)
 def display_my_sessions_view(self):
     placeholder_images = DataGetter.get_event_default_images()
     custom_placeholder = DataGetter.get_custom_placeholders()
     upcoming_events_sessions = DataGetter.get_sessions_of_user(
         upcoming_events=True)
     im_config = DataGetter.get_image_configs()
     im_size = ''
     for config in im_config:
         if config.page == 'mysession':
             im_size = config.size
     past_events_sessions = DataGetter.get_sessions_of_user(
         upcoming_events=False)
     page_content = {
         "tab_upcoming_events": "Upcoming Sessions",
         "tab_past_events": "Past Sessions",
         "title": "My Session Proposals"
     }
     if not is_verified_user():
         flash(
             "Your account is unverified. "
             "Please verify by clicking on the confirmation link that has been emailed to you."
         )
     return self.render('/gentelella/admin/mysessions/mysessions_list.html',
                        upcoming_events_sessions=upcoming_events_sessions,
                        past_events_sessions=past_events_sessions,
                        page_content=page_content,
                        placeholder_images=placeholder_images,
                        custom_placeholder=custom_placeholder,
                        im_size=im_size)
Пример #4
0
 def index_view(self):
     if not is_verified_user():
         flash(
             Markup(
                 "Your account is unverified. "
                 "Please verify by clicking on the confirmation link that has been emailed to you."
                 '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> '
                 'click here to resend the confirmation.</a>'))
     profile = DataGetter.get_user(login.current_user.id)
     return self.render('/gentelella/admin/profile/index.html',
                        profile=profile)
 def display_my_sessions_view(self):
     upcoming_events_sessions = DataGetter.get_sessions_of_user(upcoming_events=True)
     past_events_sessions = DataGetter.get_sessions_of_user(upcoming_events=False)
     page_content = {"tab_upcoming_events": "Upcoming Sessions",
                     "tab_past_events": "Past Sessions",
                     "title": "My Session Proposals"}
     if not is_verified_user():
         flash("Your account is unverified. "
               "Please verify by clicking on the confirmation link that has been emailed to you.")
     return self.render('/gentelella/admin/mysessions/mysessions_list.html',
                        upcoming_events_sessions=upcoming_events_sessions, past_events_sessions=past_events_sessions,
                        page_content=page_content)
Пример #6
0
 def display_export_view(self, event_id):
     event = DataGetter.get_event(event_id)
     export_jobs = DataGetter.get_export_jobs(event_id)
     user = current_user
     if not is_verified_user():
         flash(
             "Your account is unverified. "
             "Please verify by clicking on the confirmation link that has been emailed to you."
         )
     return self.render('/gentelella/admin/event/export/export.html',
                        event=event,
                        export_jobs=export_jobs,
                        current_user=user)
Пример #7
0
 def display_export_view(self, event_id):
     event = DataGetter.get_event(event_id)
     export_jobs = DataGetter.get_export_jobs(event_id)
     user = current_user
     if not is_verified_user():
         flash(
             Markup(
                 "Your account is unverified. "
                 "Please verify by clicking on the confirmation link that has been emailed to you."
                 '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> '
                 'click here to resend the confirmation.</a>'))
     return self.render('/gentelella/admin/event/export/export.html',
                        event=event,
                        export_jobs=export_jobs,
                        current_user=user)
 def display_my_sessions_view(self):
     placeholder_images = DataGetter.get_event_default_images()
     custom_placeholder = DataGetter.get_custom_placeholders()
     upcoming_events_sessions = DataGetter.get_sessions_of_user(upcoming_events=True)
     im_config = DataGetter.get_image_configs()
     im_size = ''
     for config in im_config:
         if config.page == 'mysession':
             im_size = config.size
     past_events_sessions = DataGetter.get_sessions_of_user(upcoming_events=False)
     page_content = {"tab_upcoming_events": "Upcoming Sessions",
                     "tab_past_events": "Past Sessions",
                     "title": "My Session Proposals"}
     if not is_verified_user():
         flash("Your account is unverified. "
               "Please verify by clicking on the confirmation link that has been emailed to you.")
     return self.render('/gentelella/admin/mysessions/mysessions_list.html',
                        upcoming_events_sessions=upcoming_events_sessions, past_events_sessions=past_events_sessions,
                        page_content=page_content, placeholder_images=placeholder_images,
                        custom_placeholder=custom_placeholder, im_size=im_size)
    def display_api_view(self, event_id):
        event = DataGetter.get_event(event_id)
        data = json.loads(json.dumps(api.__schema__))  # Yep. What you're seeing was intentional.
        events_data = {}
        paths = []
        ctr = 0
        for path in data['paths']:
            if path.startswith('/events/{event_id}'):
                path_modified = path.replace('{event_id}', str(event_id))
                paths.append(path_modified)
                events_data[path_modified] = data['paths'][path]
                events_data[path_modified]['id'] = ctr
                ctr += 1
                for method in data['paths'][path]:
                    if method == "get":
                        try:
                            definition = data['paths'][path][method]['responses']['200']['schema']['items']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['200']['schema']['items']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['200']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['200']['schema']['ref_def'] = data['definitions'][definition]
                            for prop in data['definitions'][definition]['properties']:
                                if '$ref' in data['definitions'][definition]['properties'][prop]:
                                    def_ = data['definitions'][definition]['properties'][prop]['$ref'].replace('#/definitions/', '')
                                    events_data[path_modified][method]['responses']['200']['schema']['ref_def']['properties'][prop]['ref_def'] = data['definitions'][def_]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['400']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['400']['schema']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['401']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['401']['schema']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['404']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['404']['schema']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

                    elif method == "post" or method == "put" or method == "delete":
                        try:
                            definition = data['paths'][path][method]['parameters'][0]['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['parameters'][0]['schema']['ref_def'] = data['definitions'][definition]
                            for prop in data['definitions'][definition]['properties']:
                                if '$ref' in data['definitions'][definition]['properties'][prop]:
                                    def_ = data['definitions'][definition]['properties'][prop]['$ref'].replace('#/definitions/', '')
                                    events_data[path_modified][method]['parameters'][0]['schema']['ref_def']['properties'][prop]['ref_def'] = data['definitions'][def_]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['200']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['200']['schema']['ref_def'] = data['definitions'][definition]
                            for prop in data['definitions'][definition]['properties']:
                                if '$ref' in data['definitions'][definition]['properties'][prop]:
                                    def_ = data['definitions'][definition]['properties'][prop]['$ref'].replace('#/definitions/', '')
                                    events_data[path_modified][method]['responses']['200']['schema']['ref_def']['properties'][prop]['ref_def'] = data['definitions'][def_]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['400']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['400']['schema']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['401']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['401']['schema']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method]['responses']['404']['schema']['$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['404']['schema']['ref_def'] = data['definitions'][definition]
                        except:
                            pass

        paths.sort()

        if not is_verified_user():
            flash("Your account is unverified. "
                  "Please verify by clicking on the confirmation link that has been emailed to you.")
        return self.render('/gentelella/admin/event/api/index.html',
                           event=event, data=events_data, paths=paths)
Пример #10
0
    def display_api_view(self, event_id):
        event = DataGetter.get_event(event_id)
        data = json.loads(json.dumps(
            api.__schema__))  # Yep. What you're seeing was intentional.
        events_data = {}
        paths = []
        ctr = 0
        for path in data['paths']:
            if path.startswith('/events/{event_id}'):
                path_modified = path.replace('{event_id}', str(event_id))
                paths.append(path_modified)
                events_data[path_modified] = data['paths'][path]
                events_data[path_modified]['id'] = ctr
                ctr += 1
                for method in data['paths'][path]:
                    if method == "get":
                        try:
                            definition = data['paths'][path][method][
                                'responses']['200']['schema']['items'][
                                    '$ref'].replace('#/definitions/', '')
                            events_data[path_modified][method]['responses']['200']['schema']['items']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['200']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['200']['schema']['ref_def'] = \
                            data['definitions'][definition]
                            for prop in data['definitions'][definition][
                                    'properties']:
                                if '$ref' in data['definitions'][definition][
                                        'properties'][prop]:
                                    def_ = data['definitions'][definition][
                                        'properties'][prop]['$ref'].replace(
                                            '#/definitions/', '')
                                    events_data[path_modified][method][
                                        'responses']['200']['schema'][
                                            'ref_def']['properties'][prop][
                                                'ref_def'] = data[
                                                    'definitions'][def_]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['400']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['400']['schema']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['401']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['401']['schema']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['404']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['404']['schema']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

                    elif method == "post" or method == "put" or method == "delete":
                        try:
                            definition = data['paths'][path][method][
                                'parameters'][0]['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['parameters'][0]['schema']['ref_def'] = \
                            data['definitions'][definition]
                            for prop in data['definitions'][definition][
                                    'properties']:
                                if '$ref' in data['definitions'][definition][
                                        'properties'][prop]:
                                    def_ = data['definitions'][definition][
                                        'properties'][prop]['$ref'].replace(
                                            '#/definitions/', '')
                                    events_data[path_modified][method][
                                        'parameters'][0]['schema']['ref_def'][
                                            'properties'][prop][
                                                'ref_def'] = data[
                                                    'definitions'][def_]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['200']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['200']['schema']['ref_def'] = \
                            data['definitions'][definition]
                            for prop in data['definitions'][definition][
                                    'properties']:
                                if '$ref' in data['definitions'][definition][
                                        'properties'][prop]:
                                    def_ = data['definitions'][definition][
                                        'properties'][prop]['$ref'].replace(
                                            '#/definitions/', '')
                                    events_data[path_modified][method][
                                        'responses']['200']['schema'][
                                            'ref_def']['properties'][prop][
                                                'ref_def'] = data[
                                                    'definitions'][def_]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['400']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['400']['schema']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['401']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['401']['schema']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

                        try:
                            definition = data['paths'][path][method][
                                'responses']['404']['schema']['$ref'].replace(
                                    '#/definitions/', '')
                            events_data[path_modified][method]['responses']['404']['schema']['ref_def'] = \
                            data['definitions'][definition]
                        except:
                            pass

        paths.sort()

        if not is_verified_user():
            flash(
                Markup(
                    "Your account is unverified. "
                    "Please verify by clicking on the confirmation link that has been emailed to you."
                    '<br>Did not get the email? Please <a href="/resend_email/" class="alert-link"> click here to '
                    'resend the confirmation.</a>'))
        return self.render('/gentelella/admin/event/api/index.html',
                           event=event,
                           data=events_data,
                           paths=paths)
Пример #11
0
 def display_export_view(self, event_id):
     event = DataGetter.get_event(event_id)
     if not is_verified_user():
         flash("Your account is unverified. "
               "Please verify by clicking on the confirmation link that has been emailed to you.")
     return self.render('/gentelella/admin/event/export/export.html', event=event)