/
index.html.haml
37 lines (35 loc) · 1.19 KB
/
index.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
= content_for :main_header do
%h1 Shared Scenarios
- if @new_scenario && @new_scenario.errors.any?
.alert-message.block-message.error
%ul
- @new_scenario.errors.full_messages.each do |message|
- if message.match(/Master scenario can't be blank/)
%li This scenario can't be cloned because it doesn't have a master scenario.
- else
%li= message
%table.zebra-striped
%thead
%tr
%th Name
%th Instructor
%th Original Author
%th Created on
%th Desktop Application
%th
- @scenarios.each do |scenario|
%tr
%td= link_to scenario.name, instructors_scenario_path(scenario)
%td= scenario.user.name
%td
- if scenario.original_author
= scenario.original_author.name
- else
%em This scenario has not been cloned.
%td= scenario.created_at.to_formatted_s(:long)
%td
- if scenario.client_version
= link_to 'Download', scenario.client_version.url, :class => 'btn primary'
- else
Not available for download
%td= link_to 'Clone', instructors_shared_scenario_clone_path(scenario), :confirm => 'Are you sure?', :class => 'btn success'