def open_view(request): author = Author.get_by_user(request.user) member = author.get_padmember(request.POST["id"]) if not member or not member.check_access("write"): return jsonify(success=False) return open_etherpad(member.pad, author, epoch_time(7 * 24 * 60 ** 2))
def open_view(request): 'Open an etherpad-lite pad for writing' author = Author.get_by_user(request.user) member = author.get_padmember(request.POST['id']) if not member or not member.check_access('write'): return jsonify(success=False) return open_etherpad(member.pad, author, epoch_time(7 * 24 * 60**2))
def create_view(request): 'Creates an Etherpad-Lite Pad' e = get_etherpad_client() # Create a group for sharing functionality groupid = e.createGroup()['groupID'] # Create a pad on the group padid = e.createGroupPad(groupID=groupid, padName='ek')['padID'] # Store reference to the group and pad pad = Pad(groupid=groupid, padid=padid) pad.save() user = request.user author = Author.get_by_user(user) # Set current padmember = PadMember(pad=pad, role='owner', author=author) padmember.save() return open_etherpad(pad, author, epoch_time(604800), e, id=padmember.id)