Merge branch '8800-queue-query'
[arvados.git] / apps / workbench / app / views / application / _report_issue_popup.html.erb
1 <%
2   generated_at = arvados_api_client.discovery[:generatedAt]
3   arvados_base = Rails.configuration.arvados_v1_base
4   support_email = Rails.configuration.support_email_address
5
6   additional_info = {}
7   additional_info['Current location'] = params[:current_location]
8   additional_info['User UUID'] = current_user.uuid if current_user
9
10   additional_info_str = additional_info.map {|k,v| "#{k}=#{v}"}.join("\n")
11
12   additional_info['api_source_version'] = api_source_version
13   additional_info['generated_at'] = generated_at
14   additional_info['workbench_version'] = AppVersion.hash
15   additional_info['arvados_base'] = arvados_base
16   additional_info['support_email'] = support_email
17   additional_info['error_message'] = params[:error_message] if params[:error_message]
18   additional_info['api_error_request_url'] = params[:api_error_request_url] if params[:api_error_request_url]
19   additional_info['api_error_response'] = params[:api_error_response] if params[:api_error_response]
20 %>
21
22 <div class="modal">
23  <div class="modal-dialog modal-with-loading-spinner">
24   <div class="modal-content">
25
26     <%= form_tag report_issue_path, {name: 'report-issue-form', method: 'post',
27         class: 'form-horizontal'} do %>
28
29       <%
30         title = 'Version / debugging info'
31         title = 'Report a problem' if params[:popup_type] == 'report'
32       %>
33
34       <div class="modal-header">
35         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
36         <div>
37           <div class="col-sm-8"> <h4 class="modal-title"><%=title%></h4> </div>
38           <div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
39         </div>
40         <br/>
41       </div>
42
43       <div class="modal-body" style="height: 25em; overflow-y: scroll">
44         <div class="form-group">
45           <label for="support_email" class="col-sm-4 control-label"> Support email </label>
46           <div class="col-sm-8">
47             <p class="form-control-static" name="support_version"><a href="mailto:<%=support_email%>?subject=Workbench problem report&amp;body=Problem while viewing page <%=params[:current_location]%>"><%=support_email%></a></p>
48           </div>
49         </div>
50
51         <div class="form-group">
52           <label for="current_page" class="col-sm-4 control-label"> Current page </label>
53           <div class="col-sm-8">
54             <p class="form-control-static text-overflow-ellipsis" name="current_page"><%=params[:current_path]%></a></p>
55           </div>
56         </div>
57
58         <% if params[:popup_type] == 'report' %>
59           <div class="form-group">
60             <label for="report_text_label" class="col-sm-4 control-label"> Describe the problem </label>
61             <div class="col-sm-8">
62               <textarea class="form-control" rows="4" id="report_issue_text" name="report_issue_text" type="text" placeholder="Describe the problem"/>
63             </div>
64             <input type="hidden" name="report_additional_info" value="<%=additional_info.to_json%>">
65           </div>
66         <% end %>
67
68         <div class="form-group">
69           <label for="wb_version" class="col-sm-4 control-label"> Workbench version </label>
70           <div class="col-sm-8">
71             <p class="form-control-static" name="wb_version">
72               <%= link_to AppVersion.hash, version_link_target(AppVersion.hash) %>
73             </p>
74           </div>
75         </div>
76
77         <div class="form-group">
78           <label for="server_version" class="col-sm-4 control-label"> API version </label>
79           <div class="col-sm-8">
80             <p class="form-control-static" name="server_version">
81               <%= link_to api_source_version, version_link_target(api_source_version) %>
82             </p>
83           </div>
84         </div>
85
86         <div class="form-group">
87           <label for="generated_at" class="col-sm-4 control-label"> API startup time </label>
88           <div class="col-sm-8">
89             <p class="form-control-static" name="generated_at"><%=generated_at%></p>
90           </div>
91         </div>
92
93         <div class="form-group">
94           <label for="arvados_base" class="col-sm-4 control-label"> API address </label>
95           <div class="col-sm-8">
96             <p class="form-control-static" name="arvados_base"><%=arvados_base%></p>
97           </div>
98         </div>
99
100         <% if current_user %>
101           <div class="form-group">
102             <label for="user_uuid" class="col-sm-4 control-label"> User UUID </label>
103             <div class="col-sm-8">
104               <p class="form-control-static" name="user_uuid"><%=current_user.uuid%></p>
105             </div>
106           </div>
107         <% end %>
108
109         <% if params[:error_message] %>
110           <div class="form-group">
111             <label for="error_message" class="col-sm-4 control-label"> Error message </label>
112             <div class="col-sm-8">
113               <p class="form-control-static text-overflow-ellipsis" name="error_message"><%=params[:error_message]%></p>
114             </div>
115           </div>
116         <% end %>
117
118         <% if params[:api_error_request_url] %>
119           <div class="form-group">
120             <label for="api_error_url" class="col-sm-4 control-label"> API error request URL </label>
121             <div class="col-sm-8">
122               <p class="form-control-static text-overflow-ellipsis" name="api_error_url"><%=params[:api_error_request_url]%></p>
123             </div>
124           </div>
125         <% end %>
126
127         <% if params[:api_error_response] %>
128           <div class="form-group">
129             <label for="api_error_response" class="col-sm-4 control-label"> API error response </label>
130             <div class="col-sm-8">
131               <p class="form-control-static text-overflow-ellipsis" name="api_error_response"><%=params[:api_error_response]%></p>
132             </div>
133           </div>
134         <% end %>
135       </div>
136
137       <div class="modal-footer">
138         <% if params[:popup_type] == 'report' %>
139           <button class="btn btn-default report-issue-cancel" id="report-issue-cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
140           <button type="submit" id="report-issue-submit" class="btn btn-primary report-issue-submit" autofocus>Send problem report</button>
141         <% else %>
142           <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
143         <% end %>
144       </div>
145     <% end #form %>
146   </div>
147  </div>
148 </div>