gem 'jquery-rails'
gem 'bootstrap-sass', '~> 3.1.0'
gem 'bootstrap-x-editable-rails'
+gem 'bootstrap-tab-history-rails'
gem 'less'
gem 'less-rails'
multi_json (>= 1.0.0)
bootstrap-sass (3.1.0.1)
sass (~> 3.2)
+ bootstrap-tab-history-rails (0.1.0)
+ railties (>= 3.1)
bootstrap-x-editable-rails (1.5.1.1)
railties (>= 3.0)
builder (3.2.2)
andand
arvados (>= 0.1.20140917180103)
bootstrap-sass (~> 3.1.0)
+ bootstrap-tab-history-rails
bootstrap-x-editable-rails
capybara
coffee-rails
//= require bootstrap/modal
//= require bootstrap/button
//= require bootstrap3-editable/bootstrap-editable
+//= require bootstrap-tab-history
//= require wiselinks
//= require_tree .
$(e.target.href).collapse('toggle');
});
+ $(document).on('click', '.force-cache-reload', function(e) {
+ history.replaceState( { nocache: true }, '' );
+ });
});
+
+window.addEventListener("DOMContentLoaded", function(e) {
+ if(history.state) {
+ if(history.state.nocache) {
+ showLoadingModal();
+ history.replaceState( {}, '' );
+ location.reload(true);
+ }
+ }
+});
+
+function showLoadingModal() {
+ $('#loading-modal').modal('show');
+}
+
+function hideLoadingModal() {
+ $('#loading-modal').modal('hide');
+}
# Methods that don't require login should
# skip_around_filter :require_thread_api_token
around_filter :require_thread_api_token, except: ERROR_ACTIONS
+ before_filter :set_cache_buster
before_filter :accept_uuid_as_id_param, except: ERROR_ACTIONS
before_filter :check_user_agreements, except: ERROR_ACTIONS
before_filter :check_user_profile, except: ERROR_ACTIONS
with: :render_exception)
end
+ def set_cache_buster
+ response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
+ response.headers["Pragma"] = "no-cache"
+ response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
+ end
+
def unprocessable(message=nil)
@errors ||= []
<% comparable = controller.respond_to? :compare %>
-<ul class="nav nav-tabs" data-tab-counts-url="<%= url_for(action: :tab_counts) rescue '' %>">
- <% pane_list.each_with_index do |pane, i| %>
- <% pane_name = (pane.is_a?(Hash) ? pane[:name] : pane) %>
- <li class="<%= 'active' if i==0 %>">
- <a href="#<%= pane_name %>" data-toggle="tab"
- class="pane-anchor"
- id="<%= pane_name %>-tab"
- data-pane-content-url="<%= url_for(params.merge(tab_pane: pane)) %>">
- <%= pane_name.gsub('_', ' ') %> <span id="<%= pane_name %>-count"></span>
- </a>
- </li>
- <% end %>
-</ul>
-<div class="tab-content">
-<% pane_list.each_with_index do |pane, i| %>
+ <ul class="nav nav-tabs" data-tab-counts-url="<%= url_for(action: :tab_counts) rescue '' %>">
+ <% pane_list.each_with_index do |pane, i| %>
<% pane_name = (pane.is_a?(Hash) ? pane[:name] : pane) %>
- <div id="<%= pane_name %>"
- class="tab-pane fade <%= 'in active loaded' if i==0 %> arv-log-event-listener"
-<% if controller.action_name == "index" %>
- data-object-kind="arvados#<%= ArvadosApiClient.class_kind controller.model_class %>"
-<% else %>
- data-object-uuid="<%= @object.uuid %>"
-<% end %>
- >
+ <li class="<%= 'active' if i==0 %>">
+ <a href="#<%= pane_name %>"
+ class="pane-anchor"
+ id="<%= pane_name %>-tab"
+ data-toggle="tab"
+ data-tab-history=true
+ data-tab-history-update-url=true
+ data-pane-content-url="<%= url_for(params.merge(tab_pane: pane_name)) %>">
+ <%= pane_name.gsub('_', ' ') %> <span id="<%= pane_name %>-count"></span>
+ </a>
+ </li>
+ <% end %>
+ </ul>
+
+ <div class="tab-content">
+ <% pane_list.each_with_index do |pane, i| %>
+ <% pane_name = (pane.is_a?(Hash) ? pane[:name] : pane) %>
+ <div id="<%= pane_name %>"
+ class="tab-pane fade <%= 'in active loaded' if i==0 %> arv-log-event-listener"
+ <% if controller.action_name == "index" %>
+ data-object-kind="arvados#<%= ArvadosApiClient.class_kind controller.model_class %>"
+ <% else %>
+ data-object-uuid="<%= @object.uuid %>"
+ <% end %>
+ >
<div id="<%= pane_name %>-scroll" style="margin-top:0.5em;">
<div class="pane-content">
<% if i == 0 %>
</div>
<%= content_for :tab_panes %>
+
+<%= render :partial => 'loading_modal' %>
--- /dev/null
+<div id="loading-modal" class="modal fade">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h3>Refreshing...</h3>
+ </div>
+ <div class="modal-body">
+ <p>Content may have changed.</p>
+ </div>
+ </div>
+ </div>
+</div>
selection_param: 'uuid',
success: 'redirect-to-created-object'
}.to_json),
- { class: "btn btn-sm btn-primary", remote: true, method: 'get',
+ { class: "btn btn-sm btn-primary force-cache-reload", remote: true, method: 'get',
title: "Move this #{object_class} to a different project"}) do %>
<i class="fa fa-fw fa-truck"></i> Move <%=object_class%>...
<% end %>
<% end %>
<%
- # Display any flash messages in an alert. If there is any entry with "error" key, alert-danger is used.
+ # Display any flash messages in an alert. If there is any entry with "error" key, alert-danger is used.
flash_msg = ''
flash_msg_is_error = false
flash.each do |msg|