Sha256: 94b1e8432fc1656c1f145d9be7a80eddae0873139b249e8bacf74456dccc1e7f

Contents?: true

Size: 1.32 KB

Versions: 12

Compression:

Stored size: 1.32 KB

Contents

<%
  if comp
    events = nil unless bound_locals_include?(:events, binding)
    events = comp.events || events
    if bound_locals_include?(:class_name, binding)
      class_name ||= ''
      class_name += ' v-avatar'
    else
      class_name = 'v-avatar'
    end
    position = comp.position unless bound_locals_include?(:position, binding)
    position ||= []
    position_classes = position.map {|p| "v-avatar-position-#{p}"}.join(' ')
    size_class = "v-avatar-size-#{comp.size}" unless bound_locals_include?(:size_class, binding)
%>
  <% if %w(jpg gif png).include?(comp.avatar&.to_s.split('.').last) %>
    <span class="<%=class_name%> <%=position_classes%> <%= size_class %>">
      <img id="<%= comp.id %>"
           class="v-avatar
               <%= 'v-actionable' if events %>"
         src="<%= comp.avatar %>"
         <%= partial "components/event", :locals => {comp: comp, events: events, parent_id: comp.event_parent_id} if events&.any? %> />
      <%= partial "components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} if comp.tooltip %>
    </span>
  <% else %>
    <span class="v-avatar <%=position_classes%> <%= size_class %>">
    <%= partial "components/icon", :locals => {comp: comp, icon_name: comp.avatar, parent_id: comp.event_parent_id, position: []} if comp.avatar %>
    </span>
  <% end %>

<% end %>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.11 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.10 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.9 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.8 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.7 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.6 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.5 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.4 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.3 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.2 views/mdc/components/_avatar.erb
coprl-3.0.0.beta.1 views/mdc/components/_avatar.erb