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