agenda-libre-ruby/app/views/orgas/show.html.haml

130 lines
3.5 KiB
Plaintext

- set_orga_meta
%h2
- if @orga.kind
%em.fa{ class: "fa-#{@orga.kind.icon}",
title: Kind.human_attribute_name("name_#{@orga.kind.name}") }
= title @orga.name
= image_tag @orga.url + '/favicon.ico', alt: '', class: :favicon
- if controller.controller_name == 'orgas' && controller.action_name == 'show'
%aside
%h1
%em.fa.fa-link
= t '.links'
%ul.fa-ul
%li
= link_to orgas_path(q: params[:q], page: params[:page]),
class: :back do
%em.fa.fa-li.fa-arrow-left
= Orga.model_name.human.pluralize
%li
= link_to events_path tag: @orga.name do
%em.fa.fa-li.fa-calendar
Agenda
%li
= link_to events_path format: :rss, tag: @orga.name do
%em.fa.fa-li.fa-rss
RSS
%li
= link_to events_path format: :ics, tag: @orga.name do
%em.fa.fa-li.fa-th-list
iCal
%li
= link_to maps_path tag: @orga.name do
%em.fa.fa-li.fa-map-marker
OpenStreetMap
%li
= link_to maps_path format: :json, tag: @orga.name do
%em.fa.fa-li.fa-dot-circle-o
GeoJSON
- if @orga.secret.nil? || user_signed_in?
%h1
%em.fa.fa-wrench
= t '.actions'
%h2
= link_to edit_orga_path @orga do
%em.fa.fa-lg.fa-pencil
= t '.edit'
- if user_signed_in?
%h2
= link_to cancel_orga_path @orga do
%em.fa.fa-lg.fa-thumbs-down
= t '.cancel'
%h3= t '.description'
.description
= description sanitize @orga.description,
tags: %w(p h1 h2 h3 h4 br table tr th td ul ol li a strong b em i img),
attributes: %w(href src width height style)
%dl
- if @orga.city.present?
%dt
%em.fa.fa-compress
= Orga.human_attribute_name :city
%dd= @orga.city
- if @orga.department.present?
%dt
%em.fa.fa-puzzle-piece
= Orga.human_attribute_name :department
%dd= @orga.department
- if @orga.region.present?
%dt
%em.fa.fa-shield
= Orga.human_attribute_name :region
%dd= @orga.region
- if @orga.url.present?
%dt
%em.fa.fa-external-link
= Orga.human_attribute_name :url
%dd= link_to @orga.url, @orga.url
- if @orga.diaspora.present?
%dt
%em.fa.fa-bullhorn
= Orga.human_attribute_name :diaspora
%dd= link_to @orga.diaspora, @orga.diaspora
- if @orga.feed.present?
%dt
%em.fa.fa-rss
= Orga.human_attribute_name :feed
%dd= link_to @orga.feed, @orga.feed
- if @orga.contact.present?
%dt
%em.fa.fa-envelope
= Event.human_attribute_name :contact
%dd= mail_to @orga.contact, nil,
encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @orga.tags?
%dt
%em.fa.fa-tags
= Event.human_attribute_name :tags
%dd= @orga.tags
%dt
%em.fa.fa-heartbeat
= Orga.human_attribute_name :active
%dd= t @orga.active.to_s
- if @orga.updated_at
%dt
%em.fa.fa-calendar
= Orga.human_attribute_name :updated_at
%dd= l @orga.updated_at.to_date, format: :long
- if @events_future && @events_future.any?
%dt= t '.future'
%dd= t '.count', count: @events_future.count
- if @events_future && @events_past.any?
%dt= t '.past'
%dd= t '.count', count: @events_past.count
.events#map{ title: @orga.name_as_tag,
data: { url: maps_path(format: :json, tag: @orga.name_as_tag,
future: false) } }