Example #1
0
def user_list():
  user_dbs, more_cursor = util.retrieve_dbs(
      model.User.query(),
      limit=util.param('limit', int),
      cursor=util.param('cursor'),
      order=util.param('order') or '-created',
      name=util.param('name'),
      admin=util.param('admin', bool),
      active=util.param('active', bool),
      permissions=util.param('permissions', list),
    )

  if flask.request.path.startswith('/_s/'):
    return util.jsonify_model_dbs(user_dbs, more_cursor)

  permissions = list(UserUpdateForm._permission_choices)
  permissions += util.param('permissions', list) or []
  return flask.render_template(
      'user/user_list.html',
      html_class='user-list',
      title='User List',
      user_dbs=user_dbs,
      more_url=util.generate_more_url(more_cursor),
      has_json=True,
      permissions=sorted(set(permissions)),
    )
Example #2
0
def user_list():
    user_dbs, more_cursor = util.retrieve_dbs(
        model.User.query(),
        limit=util.param("limit", int),
        cursor=util.param("cursor"),
        order=util.param("order") or "-created",
        admin=util.param("admin", bool),
        active=util.param("active", bool),
        permissions=util.param("permissions", list),
    )

    if flask.request.path.startswith("/_s/"):
        return util.jsonify_model_dbs(user_dbs, more_cursor)

    permissions = list(UserUpdateForm._permission_choices)
    permissions += util.param("permissions", list) or []
    return flask.render_template(
        "user/user_list.html",
        html_class="user-list",
        title="User List",
        user_dbs=user_dbs,
        more_url=util.generate_more_url(more_cursor),
        has_json=True,
        permissions=sorted(set(permissions)),
    )
Example #3
0
def contact_list():
  contact_dbs, more_cursor = util.retrieve_dbs(model.Contact.query(),
                                               limit=util.param('limit',int),
                                               cursor=util.param('cursor'),
                                               order=util.param('order') or 'name',
                                               )
  return flask.render_template(
                               'contact_list.html',
                               html_class='contact-list',
                               title='Contact List',
                               contact_dbs=contact_dbs,
                               more_url = util.generate_more_url(more_cursor),
                               )
Example #4
0
def verse_list():
  verse_dbs, more_cursor = util.retrieve_dbs(
                                               model.Verse.query(),# @UndefinedVariable
                                               limit=util.param('limit', 600),
                                               cursor=util.param('cursor'),
                                               order=util.param('order'),
                                               )
  return flask.render_template(
                               'verse_list.html',
                               html_class='verse-list',
                               title='Verse List',
                               verse_dbs=verse_dbs,
                               more_url=util.generate_more_url(more_cursor),
                               )
Example #5
0
def exam_list():
  exam_dbs, more_cursor = util.retrieve_dbs(
      model.Exam.query(),
      limit=util.param('limit', int),
      cursor=util.param('cursor'),
      order=util.param('order') or 'name',
    )
  return flask.render_template(
      'exam_list.html',
      html_class='exam-list',
      title='Exam List',
      exam_dbs=exam_dbs,
      more_url=util.generate_more_url(more_cursor),
    )
Example #6
0
def contact_list():
    contact_dbs, more_cursor = util.retrieve_dbs(
        model.Contact.query(),
        limit=util.param('limit', int),
        cursor=util.param('cursor'),
        order=util.param('order'),
    )
    return flask.render_template(
        'contact_list.html',
        html_class='contact-list',
        title='Contact List',
        contact_dbs=contact_dbs,
        more_url=util.generate_more_url(more_cursor),
    )
Example #7
0
def verse_list():
    verse_dbs, more_cursor = util.retrieve_dbs(
        model.Verse.query(),  # @UndefinedVariable
        limit=util.param('limit', 600),
        cursor=util.param('cursor'),
        order=util.param('order'),
    )
    return flask.render_template(
        'verse_list.html',
        html_class='verse-list',
        title='Verse List',
        verse_dbs=verse_dbs,
        more_url=util.generate_more_url(more_cursor),
    )
Example #8
0
def contact_list():
    contact_dbs, more_cursor = util.retrieve_dbs(
        model.Contact.query(),
        limit=util.param("limit", int),
        cursor=util.param("cursor"),
        order=util.param("order") or "name",
    )
    return flask.render_template(
        "contact_list.html",
        html_class="contact-list",
        title="Contact List",
        contact_dbs=contact_dbs,
        more_url=util.generate_more_url(more_cursor),
    )
Example #9
0
def user_list():
    user_dbs, more_cursor = model.User.get_dbs()

    if flask.request.path.startswith('/_s/'):
        return util.jsonify_model_dbs(user_dbs, more_cursor)

    permissions = list(UserUpdateForm._permission_choices)
    permissions += util.param('permissions', list) or []
    return flask.render_template(
        'user/user_list.html',
        html_class='user-list',
        title='User List',
        user_dbs=user_dbs,
        more_url=util.generate_more_url(more_cursor),
        has_json=True,
        permissions=sorted(set(permissions)),
    )
Example #10
0
def user_list():
  user_dbs, more_cursor = model.User.get_dbs()

  if flask.request.path.startswith('/_s/'):
    return util.jsonify_model_dbs(user_dbs, more_cursor)

  permissions = list(UserUpdateForm._permission_choices)
  permissions += util.param('permissions', list) or []
  return flask.render_template(
      'user/user_list.html',
      html_class='user-list',
      title='User List',
      user_dbs=user_dbs,
      more_url=util.generate_more_url(more_cursor),
      has_json=True,
      permissions=sorted(set(permissions)),
    )
Example #11
0
def index():
    user_dbs, more_cursor = util.retrieve_dbs(
        User,
        User.query(),
        limit=util.param('limit', int),
        cursor=util.param('cursor'),
        order=util.param('order'),
        name=util.param('name'),
      )

    if request.path.startswith('/_json/'):
        return util.jsonify_model_dbs(user_dbs, more_cursor)
    return render_template(
        'admin/user/index.html',
        title=u'Пользователи',
        user_dbs=user_dbs,
        more_url=util.generate_more_url(more_cursor)
    )
Example #12
0
def resource_list():
    resource_dbs, more_cursor = util.retrieve_dbs(
        model.Resource.query(),
        user_key=auth.current_user_key(),
        limit=util.param('limit', int),
        cursor=util.param('cursor'),
        order=util.param('order') or '-created',
    )

    if flask.request.path.startswith('/_s/'):
        return util.jsonify_model_dbs(resource_dbs, more_cursor)

    return flask.render_template(
        'resource/resource_list.html',
        html_class='resource-list',
        title='Resource List',
        resource_dbs=resource_dbs,
        more_url=util.generate_more_url(more_cursor),
    )
Example #13
0
def resource_list():
  resource_dbs, more_cursor = util.retrieve_dbs(
      model.Resource.query(),
      user_key=auth.current_user_key(),
      limit=util.param('limit', int),
      cursor=util.param('cursor'),
      order=util.param('order') or '-created',
    )

  if flask.request.path.startswith('/_s/'):
    return util.jsonify_model_dbs(resource_dbs, more_cursor)

  return flask.render_template(
      'resource/resource_list.html',
      html_class='resource-list',
      title='Resource List',
      resource_dbs=resource_dbs,
      more_url=util.generate_more_url(more_cursor),
    )
Example #14
0
def user_list():
  user_dbs, more_cursor = util.retrieve_dbs(
      model.User.query(),
      limit=util.param('limit', int),
      cursor=util.param('cursor'),
      order=util.param('order') or '-created',
      name=util.param('name'),
      admin=util.param('admin', bool),
    )

  if flask.request.path.startswith('/_s/'):
    return util.jsonify_model_dbs(user_dbs, more_cursor)

  return flask.render_template(
      'user_list.html',
      html_class='user',
      title='User List',
      user_dbs=user_dbs,
      more_url=util.generate_more_url(more_cursor),
    )
Example #15
0
def user_list():
    user_dbs, more_cursor = util.retrieve_dbs(
        model.User.query(),
        limit=util.param("limit", int),
        cursor=util.param("cursor"),
        order=util.param("order") or "-created",
        name=util.param("name"),
        admin=util.param("admin", bool),
    )

    if flask.request.path.startswith("/_s/"):
        return util.jsonify_model_dbs(user_dbs, more_cursor)

    return flask.render_template(
        "user_list.html",
        html_class="user",
        title="User List",
        user_dbs=user_dbs,
        more_url=util.generate_more_url(more_cursor),
    )
Example #16
0
def user_list():
  user_dbs, more_cursor = util.retrieve_dbs(
      model.User.query(),
      limit=util.param('limit', int),
      cursor=util.param('cursor'),
      order=util.param('order') or '-created',
      name=util.param('name'),
      admin=util.param('admin', bool),
    )

  if flask.request.path.startswith('/_s/'):
    return util.jsonify_model_dbs(user_dbs, more_cursor)

  return flask.render_template(
      'user_list.html',
      html_class='user',
      title=_('User List'),
      user_dbs=user_dbs,
      more_url=util.generate_more_url(more_cursor),
    )