コード例 #1
0
ファイル: forum.py プロジェクト: bindscha/wnframework_old
def get_context(group_context):
	forum_context = {}
	
	if group_context.view.name in ("popular", "feed"):
		forum_context["post_list_html"] = get_post_list_html(group_context["group"]["name"], group_context["view"])
	
	elif group_context.view.name == "edit":
		forum_context["session_user"] = webnotes.session.user
		forum_context["post"] = webnotes.doc("Post", webnotes.form_dict.name).fields

	elif group_context.view.name == "settings":
		forum_context.update(get_settings_context(group_context))
		
	elif group_context.view.name == "post":
		forum_context.update(get_post_context(group_context))
	
	return forum_context
コード例 #2
0
ファイル: events.py プロジェクト: bindscha/wnframework_old
def get_context(group_context):
	events_context = {}
	
	if group_context.view.name in ("upcoming", "past"):
		events_context["post_list_html"] = get_post_list_html(group_context["group"]["name"], group_context["view"])
	
	elif group_context.view.name == "edit":
		events_context["session_user"] = webnotes.session.user
		events_context["post"] = webnotes.doc("Post", webnotes.form_dict.name).fields

	elif group_context.view.name == "settings":
		events_context.update(get_settings_context(group_context))
		
	elif group_context.view.name == "post":
		events_context.update(get_post_context(group_context))
	
	return events_context
コード例 #3
0
ファイル: tasks.py プロジェクト: bindscha/wnframework_old
def get_context(group_context):
	tasks_context = {}
	
	if group_context.view.name in ("open", "closed"):
		tasks_context["post_list_html"] = get_post_list_html(group_context["group"]["name"], group_context["view"])
	
	elif group_context.view.name == "edit":
		post = webnotes.doc("Post", webnotes.form_dict.name).fields
		tasks_context["session_user"] = webnotes.session.user
		tasks_context["post"] = post
		if post.assigned_to:
			tasks_context["profile"] = webnotes.doc("Profile", post.assigned_to)

	elif group_context.view.name == "settings":
		tasks_context.update(get_settings_context(group_context))
		
	elif group_context.view.name == "post":
		tasks_context.update(get_post_context(group_context))
	
	return tasks_context