本文整理汇总了Python中shuup.admin.toolbar.get_default_edit_toolbar函数的典型用法代码示例。如果您正苦于以下问题:Python get_default_edit_toolbar函数的具体用法?Python get_default_edit_toolbar怎么用?Python get_default_edit_toolbar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_default_edit_toolbar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
obj = self.get_object()
delete_url = reverse_lazy("shuup_admin:task.delete", kwargs={"pk": obj.pk}) if obj.pk else None
toolbar = get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)
if obj and obj.pk:
if obj.status == TaskStatus.NEW:
toolbar.append(
PostActionButton(
post_url=reverse_lazy("shuup_admin:task.set_status", kwargs=dict(pk=obj.pk)),
icon="fa fa-check",
name="status",
value=TaskStatus.IN_PROGRESS.value,
text=_("Set In Progress"),
extra_css_class="btn-success",
)
)
if obj.status == TaskStatus.IN_PROGRESS:
toolbar.append(
PostActionButton(
post_url=reverse_lazy("shuup_admin:task.set_status", kwargs=dict(pk=obj.pk)),
icon="fa fa-check",
name="status",
value=TaskStatus.COMPLETED.value,
text=_("Set Completed"),
extra_css_class="btn-success",
)
)
return toolbar
开发者ID:ruqaiya,项目名称:shuup,代码行数:30,代码来源:edit.py
示例2: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
if save_form_id:
delete_url = None
if self.object and self.object.pk:
delete_url = reverse_lazy("shuup_admin:xtheme_snippet.delete", kwargs={"pk": self.object.pk})
return get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)
开发者ID:ruqaiya,项目名称:shuup,代码行数:7,代码来源:_snippet.py
示例3: __init__
def __init__(self, view):
self.view = view
self.request = view.request
self.user = view.object
super(UserDetailToolbar, self).__init__()
self.extend(get_default_edit_toolbar(self.view, "user_form", with_split_save=False))
if self.user.pk:
self._build_existing_user()
开发者ID:ahmadzai,项目名称:shuup,代码行数:8,代码来源:detail.py
示例4: get_toolbar
def get_toolbar(self):
toolbar = get_default_edit_toolbar(
self,
self.get_save_form_id(),
discard_url=(get_model_url(self.object) if self.object.pk else None)
)
# TODO: Add extensibility
return toolbar
开发者ID:ahmadzai,项目名称:shuup,代码行数:8,代码来源:edit.py
示例5: get_toolbar
def get_toolbar(self):
toolbar = get_default_edit_toolbar(
self,
"permissions_form",
discard_url=get_model_url(self.object),
with_split_save=False
)
return toolbar
开发者ID:ahmadzai,项目名称:shuup,代码行数:8,代码来源:permissions.py
示例6: get_toolbar
def get_toolbar(self):
toolbar = get_default_edit_toolbar(self, self.get_save_form_id(), with_split_save=False)
toolbar.append(
URLActionButton(
text=_("Custom CSS/JS"),
icon="fa fa-magic",
url=reverse("shuup_admin:xtheme_snippet.list"),
extra_css_class="btn-info"
)
)
return toolbar
开发者ID:ruqaiya,项目名称:shuup,代码行数:11,代码来源:_theme.py
示例7: get_toolbar
def get_toolbar(self):
toolbar = get_default_edit_toolbar(
self,
self.get_save_form_id(),
discard_url=(get_model_url(self.object) if self.object.pk else None)
)
for button in get_provide_objects("admin_contact_edit_toolbar_button"):
toolbar.append(button(self.object))
return toolbar
开发者ID:NamiStudio,项目名称:shuup,代码行数:11,代码来源:edit.py
示例8: __init__
def __init__(self, view):
super(EditProductToolbar, self).__init__()
self.view = view
self.request = view.request
self.product = view.object
self.extend(get_default_edit_toolbar(
self.view, "product_form",
delete_url="shuup_admin:product.delete"
))
if self.product.pk:
self._build_existing_product()
开发者ID:ahmadzai,项目名称:shuup,代码行数:11,代码来源:toolbars.py
示例9: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = reverse_lazy("shuup_admin:service_provider.delete", kwargs={"pk": object.pk})
toolbar = get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)
if self.object.pk:
toolbar.append(URLActionButton(
text=_("Create {service_name}").format(
service_name=self.object.service_model._meta.verbose_name),
icon="fa fa-plus",
url="{model_url}?provider={id}".format(
model_url=get_model_url(self.object.service_model, "new"),
id=self.object.id),
extra_css_class="btn-info"
))
return toolbar
开发者ID:suutari,项目名称:shoop,代码行数:17,代码来源:_edit.py
示例10: get_toolbar
def get_toolbar(self):
product_type = self.get_object()
save_form_id = self.get_save_form_id()
delete_url = reverse_lazy(
"shuup_admin:product_type.delete", kwargs={"pk": product_type.pk}
) if product_type.pk else None
toolbar = get_default_edit_toolbar(self, save_form_id)
if not delete_url:
return toolbar
toolbar.append(PostActionButton(
post_url=delete_url,
text=_(u"Delete"),
icon="fa fa-trash",
extra_css_class="btn-danger",
confirm=_("Are you sure you wish to delete %s? Warrning: all related products will disappear from storefront until new value for product type is set!") % product_type, # noqa
required_permissions=()
))
return toolbar
开发者ID:ruqaiya,项目名称:shuup,代码行数:18,代码来源:edit.py
示例11: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = reverse_lazy("shuup_admin:category.delete", kwargs={"pk": object.pk}) if object.pk else None
return get_default_edit_toolbar(self, save_form_id, delete_url=delete_url)
开发者ID:NamiStudio,项目名称:shuup,代码行数:5,代码来源:edit.py
示例12: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
return get_default_edit_toolbar(self, save_form_id, with_split_save=settings.SHUUP_ENABLE_MULTIPLE_SHOPS)
开发者ID:shawnadelic,项目名称:shuup,代码行数:3,代码来源:edit.py
示例13: __init__
def __init__(self, view):
super(ProductParentBaseToolbar, self).__init__()
self.view = view
self.parent_product = view.object
self.request = view.request
get_default_edit_toolbar(self.view, "product_form", with_split_save=False, toolbar=self)
开发者ID:ruqaiya,项目名称:shuup,代码行数:6,代码来源:edit_parent.py
示例14: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
if save_form_id:
return get_default_edit_toolbar(self, save_form_id)
开发者ID:yourkin,项目名称:shuup,代码行数:4,代码来源:views.py
示例15: get_toolbar
def get_toolbar(self):
object = self.get_object()
delete_url = (
reverse_lazy("shuup_admin:label.delete", kwargs={"pk": object.pk})
if object.pk else None)
return get_default_edit_toolbar(self, self.get_save_form_id(), delete_url=delete_url)
开发者ID:ruqaiya,项目名称:shuup,代码行数:6,代码来源:views.py
示例16: get_context_data
def get_context_data(self, **kwargs):
context = super(ListSettingsView, self).get_context_data(**kwargs)
context["toolbar"] = get_default_edit_toolbar(self, "settings_form", with_split_save=False)
return context
开发者ID:shawnadelic,项目名称:shuup,代码行数:4,代码来源:__init__.py
示例17: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
if save_form_id:
return get_default_edit_toolbar(self, save_form_id, delete_url="shuup_admin:carousel.delete")
开发者ID:gurch101,项目名称:shuup,代码行数:4,代码来源:_edit.py
示例18: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
with_split_save = ShuupSettings.get_setting("SHUUP_ENABLE_MULTIPLE_SHOPS")
return get_default_edit_toolbar(self, save_form_id, with_split_save=with_split_save)
开发者ID:ruqaiya,项目名称:shuup,代码行数:4,代码来源:edit.py
示例19: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = get_model_url(object, "delete") if object.pk else None
return get_default_edit_toolbar(self, save_form_id, delete_url=(delete_url if object.can_delete() else None))
开发者ID:suutari,项目名称:shoop,代码行数:5,代码来源:_edit.py
示例20: get_toolbar
def get_toolbar(self):
save_form_id = self.get_save_form_id()
object = self.get_object()
delete_url = reverse_lazy("shuup_admin:contact-group.delete", kwargs={"pk": object.pk})
return get_default_edit_toolbar(self, save_form_id, delete_url=delete_url if object.can_delete() else None)
开发者ID:NamiStudio,项目名称:shuup,代码行数:5,代码来源:edit.py
注:本文中的shuup.admin.toolbar.get_default_edit_toolbar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论