2017-04-21 14:33:48 -04:00
|
|
|
- hidden = local_assigns.fetch(:hidden, false)
|
2017-04-21 14:59:34 -04:00
|
|
|
- render_error = viewer.render_error
|
2017-05-12 15:43:06 -04:00
|
|
|
- load_async = local_assigns.fetch(:load_async, viewer.load_async?)
|
2017-04-21 14:33:48 -04:00
|
|
|
|
2017-05-12 15:43:06 -04:00
|
|
|
- viewer_url = local_assigns.fetch(:viewer_url) { url_for(params.merge(viewer: viewer.type, format: :json)) } if load_async
|
2017-05-08 19:52:05 -04:00
|
|
|
.blob-viewer{ data: { type: viewer.type, url: viewer_url }, class: ('hidden' if hidden) }
|
2017-05-12 15:43:06 -04:00
|
|
|
- if load_async
|
2017-05-08 19:50:23 -04:00
|
|
|
= render viewer.loading_partial_path, viewer: viewer
|
2017-04-21 14:33:48 -04:00
|
|
|
- elsif render_error
|
2017-04-26 16:48:49 -04:00
|
|
|
= render 'projects/blob/render_error', viewer: viewer
|
2017-04-21 14:33:48 -04:00
|
|
|
- else
|
|
|
|
- viewer.prepare!
|
|
|
|
= render viewer.partial_path, viewer: viewer
|