
    h8                         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
mZmZ ddlmZ dd	lmZ d
dlmZmZ  ej$                  e      Zej(                   G d d ed      e
eeee             Zy)    )plugin_pool)gettext_lazy   )settings)CMSUIPlugin)AttributesMixinMarginMixinResponsiveMixin   )image)LinkPluginMixin   )formsmodelsc                        e Zd ZdZ ed      Z ed      Zej                  Z	e
j                  ZdZdZdZddd	if ed
      dddf ed      dddfgZdZd Z fdZ xZS )ImagePluginzX
    Content > "Image" Plugin
    https://getbootstrap.com/docs/5.0/content/images/
    zPicture / ImageFrontendTa  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-image" viewBox="0 0 16 16"><path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/><path d="M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1z"/></svg>z#djangocms_frontend/admin/image.htmlNfields)templatepictureexternal_picture)picture_fluidlazy_loadingpicture_roundedpicture_thumbnailFormat)collapse)use_responsive_imagewidthheight	alignment)classesr   Cropping))use_automatic_scalinguse_no_cropping)use_cropuse_upscalethumbnail_optionsc                 D    dt         j                   d|j                   dS )Nzdjangocms_frontend//z/image.html)r   	frameworkr   )selfcontextinstanceplaceholders       \/home/dcms/DCMS/lib/python3.12/site-packages/djangocms_frontend/contrib/image/cms_plugins.pyget_render_templatezImagePlugin.get_render_templateW   s%    $X%7%7$8(:K:K9LKXX    c                 2   |j                         |d<   |j                  |j                  dd      |j                  dd            |d<   |j                  |d<   |j                  j                  dd	      r|j                  d
d       t        |   |||      S )Npicture_linkr    r   r!   r   picture_sizeimg_srcset_datar   Floadinglazy)get_linkget_sizegetr8   configadd_attributesuperrender)r.   r/   r0   r1   	__class__s       r2   rA   zImagePlugin.renderZ   s    "*"3"3"5"*"3"3++gq);;x+ #4 #
 &.%=%=!"??~u5""9f5w~gx==r4   )__name__
__module____qualname____doc___namemoduler   Imagemodelr   	ImageFormformtext_enabled	text_iconchange_form_template	fieldsetslink_fieldset_positionr3   rA   __classcell__)rB   s   @r2   r   r      s    
 Dz]FLLE??DL	  A  
	
" hK(
	
 jM(
	
9'IP  Y
> 
>r4   r   rJ   N)cms.plugin_poolr   django.utils.translationr   rG    r   cms_pluginsr   commonr   r	   r
   r   link.cms_pluginsr   r   r   get_renderermixin_factoryregister_pluginr    r4   r2   <module>r^      sk    ' 6  & C C  . %%%e, U>'U> U>r4   