def get_ci_tasks(self, request, all_tasks, show_tag, is_full_part): task_list = list() for dm_task in all_tasks: tag_menu = self.get_task_tag_menu(dm_task, "ci-task-tag-inline", 1) parameter_group_menu = self.get_task_parameter_menu(dm_task.id) tmp_task = VM_CITask(dm_task, tag_menu, show_tag, is_full_part, parameter_group_menu) task_list.append(tmp_task) return task_list
def get_ci_task_history_webpart(self, request, task_id): task_history_list_controll = self.get_ci_task_history_list(task_id) dm_ci_task = CITask.objects.get(int(task_id)) vm_ci_task = VM_CITask(dm_ci_task, None, True, True) pagefileds = { "ci_task_history_list": task_history_list_controll, "ci_task": vm_ci_task } return self.get_webpart(pagefileds, CITaskPath.task_history_page)
def task_changelog_webpart(self, request, task_id): task_changelog_list = self.task_changelog_list(task_id) dm_ci_task = CITask.objects.get(int(task_id)) vm_ci_task = VM_CITask(dm_ci_task, None, True, True) pagefileds = { "task_changelog_list": task_changelog_list, "ci_task": vm_ci_task } return self.get_webpart(pagefileds, CITaskPath.task_changelog_page)
def get_ci_task_parameter_webpart(self, request, task_id): task_parameter_list_controll = self.get_ci_task_parameter_list(task_id) dm_ci_task = CITask.objects.get(int(task_id)) vm_ci_task = VM_CITask(dm_ci_task, None, True, True) task_parameter_group_type_menu = self.task_parameter_group_type_menu( task_id) pagefileds = { "task_parameter_group_list": task_parameter_list_controll, "ci_task": vm_ci_task } pagefileds[ "task_parameter_group_type_menu"] = task_parameter_group_type_menu return self.get_webpart(pagefileds, CITaskPath.task_parameter_page)
def get_task_config_webpart(self, request, task_id): dm_ci_task = CITask.objects.get(task_id) vm_ci_task = VM_CITask(dm_ci_task, None, True, True) task_plugin_menus = self.get_task_plugin_menu(request, dm_ci_task.TaskType) section_page_worker = CISectionPageWorker(request) post_section_plugins = section_page_worker.get_section_webpart( vm_ci_task.task_config.get_post_section(), task_id) build_section_plugins = section_page_worker.get_section_webpart( vm_ci_task.task_config.get_build_section(), task_id) scm_section_plugins = section_page_worker.get_section_webpart( vm_ci_task.task_config.get_scm_section(), task_id) pre_section_plugins = section_page_worker.get_section_webpart( vm_ci_task.task_config.get_pre_section(), task_id) pagefileds = {"task": vm_ci_task} pagefileds = dict(pagefileds, **task_plugin_menus) pagefileds['post_section_plugins'] = post_section_plugins pagefileds['build_section_plugins'] = build_section_plugins pagefileds['scm_section_plugins'] = scm_section_plugins pagefileds['pre_section_plugins'] = pre_section_plugins return self.get_webpart(pagefileds, CITaskPath.task_config_webpart)
def get_task_sub_navbar(self, request, dm_products, sub_nav_action, task_id=0, task_property=None): if sub_nav_action: result = self.get_sub_nav_bar(request, self.subpage_model, CITaskPath.sub_nav_template_path, sub_nav_action=sub_nav_action, products=dm_products) else: dm_ci_task = CITask.objects.get(task_id) vm_ci_task = VM_CITask(dm_ci_task, None, False, True) result = self.get_property_nav_bar( request, self.task_property_model, CITaskPath.task_property_nav, property_nav_action=task_property, ci_task=vm_ci_task) return result