lib/intranet/resources/haml/pictures_home.haml in intranet-pictures-1.1.0 vs lib/intranet/resources/haml/pictures_home.haml in intranet-pictures-2.0.0
- old
+ new
@@ -1,33 +1,35 @@
%section
= to_markup 'title_and_breadcrumb', {title: title, nav: nav}
- recent_groups.each do |recent|
- %h3= I18n.t('pictures.recents.' + recent[:group_type])
+ %h3= I18n.t('pictures.recents.' + recent[:group_key])
%ul.groups
- - recent[:groups].each do |group|
- %li{ title: group['title'] }
- %a{ onclick: 'openImagesGallery("' + gallery_url(recent[:group_type], group['id']) + '");' }
+ - recent[:groups].each do |group_name|
+ %li{ title: group_name }
+ %a{ onclick: 'openImagesGallery("' + gallery_url(recent[:group_key], group_name) + '");' }
%figure
- %div{ style: 'background-image: url("api/group/' + recent[:group_type] + '?' + recent[:group_type] + '=' + group['id'] + '")' }
+ %div{ style: 'background-image: url("api/group_thumbnail?' + recent[:group_key] + '=' + group_name + '")' }
%figcaption
- = group['title']
- - if group['brief']
+ = group_name
+ - group_brief = api_group_brief({ recent[:group_key] => group_name })
+ - unless group_brief.empty?
%br
- %em= group['brief']
+ %em= group_brief
- unless recent[:see_more_url].empty?
%p.see_more
%a{ href: recent[:see_more_url] }= I18n.t('pictures.see_more')
- all_groups.each do |section|
- %h3= I18n.t('pictures.browse_by.' + section[:group_type])
+ %h3= I18n.t('pictures.browse_by.' + section[:group_key])
%ul.groups.wide
- - section[:groups].each do |group|
- %li{ title: group['title'] }
- %a{ href: section[:url_prefix] + '&' + section[:group_type] + '=' + group['id'] }
+ - section[:groups].each do |group_name|
+ %li{ title: group_name }
+ %a{ href: section[:url_prefix] + '&' + section[:group_key] + '=' + group_name }
%figure
- %div{ style: 'background-image: url("api/group/' + section[:group_type] + '?' + section[:group_type] + '=' + group['id'] + '")' }
+ %div{ style: 'background-image: url("api/group_thumbnail?' + section[:group_key] + '=' + group_name + '")' }
%figcaption
- = group['title']
- - if group['brief']
+ = group_name
+ - group_brief = api_group_brief({ section[:group_key] => group_name })
+ - unless group_brief.empty?
%br
- %em= group['brief']
+ %em= group_brief