
    h+
                         d dl mZ d dlmZ d dlmZ d dlmZ 	 d dlm	Z	  e
e	d      r G d d      Zne	  G d dee      Z G d de      Zy# e$ r d	d
lmZ  G d d      Z	Y /w xY w)    )CMSPluginBase)	force_str)get_related)AbstractFrontendUIItem)PlaceholderAdmin
edit_fieldc                       e Zd Zy)FrontendEditableAdminMixinN__name__
__module____qualname__     Q/home/dcms/DCMS/lib/python3.12/site-packages/djangocms_frontend/ui_plugin_base.pyr
   r
      s    r   r
      )r
   c                       e Zd Zy)r   Nr   r   r   r   r   r      s    r   r   c                   Z     e Zd ZdZdZ fdZ fdZ eed      s fdZ	d Z
 xZS  xZS )CMSUIPluginBasez&djangocms_frontend/html_container.htmlz"djangocms_frontend/admin/base.htmlc                 2    t        t        | 	               S )N)r   super__str__)self	__class__s    r   r   zCMSUIPluginBase.__str__   s    *++r   c                    t        |t              r|j                  j                         D ]h  \  }}t        |t              st        |j                               ddhk(  s6||j                         vsIt        |j                  |t        |             j d|j                  vr5t        |j                  t              r|j                  |j                         t        | 5  |||      S )Npkmodelinstance)
isinstancer   configitemsdictsetkeys__dir__setattrr   r   updater   render)r   contextr   placeholderkeyvaluer   s         r   r(   zCMSUIPluginBase.render!   s    h 67&oo335 K
UeT*s5::</@T7O/S("2"2"44 2 2CS9IJK 0ZQU5Vx/w~gx==r   r   c                     ddl m | j                  j                  j                   d| j                  j                  j
                   fd} |d| j                        gt        | !         z   S )Nr   )re_path_c                 8     | | d|j                          S )Nr/   )name)r   )regexfninfor.   s     r   patz,CMSUIPluginBase.get_plugin_urls.<locals>.pat3   s!    ub$q/FGGr   z edit-field/([0-9]+)/([a-z\-]+)/$)	django.urlsr.   r   _meta	app_label
model_namer   r   get_plugin_urls)r   r5   r4   r.   r   s     @@r   r:   zCMSUIPluginBase.get_plugin_urls.   si    +jj&&0014::3C3C3N3N2OPDH 7I')* *r   c                 F    ddl m} |j                  j                  |      S )Nr   )FrontendUIItem)r   )modelsr<   objectsget)r   	object_idlanguager<   s       r   _get_object_for_single_fieldz,CMSUIPluginBase._get_object_for_single_field:   s    .!))---;;r   )r   r   r   render_templatechange_form_templater   r(   hasattrr   r:   rB   __classcell__)r   s   @r   r   r      s4    >O?,> #\2
	*	< 3r   r   c                       e Zd Zy)CMSUIComponentNr   r   r   r   rH   rH   A   s    r   rH   N)cms.plugin_baser   django.utils.encodingr   djangocms_frontend.helpersr   djangocms_frontend.modelsr   cms.admin.placeholderadminr   rE   r
   ImportErrorhelpersr   rH   r   r   r   <module>rP      sv    ) + 2 <;.	 	 		$<0- $<N	_ 	_  3 	s   A A'&A'