Project

General

Profile

« Previous | Next » 

Revision 5d6ab0b1

Added by Amos Benari over 10 years ago

refs #3811 - additional bootstrap 3 updates/fixes

  • css renamed alert-error is now alert-danger
  • spinner progress indicators are back
  • fixed progress bar on create host

View differences:

app/assets/javascripts/application.js
}
$('.flash.error').each(function(index, item) {
if ($('.alert-message.alert-error.base').length == 0) {
if ($('.alert-message.alert-danger.base').length == 0) {
if ($('#host-conflicts-modal').length == 0) {
notify(item, 'error');
}
......
var data = $("form").serialize().replace('method=put', 'method=post');
data = data + '&host_id=' + host_id
if (env_id == "") return;
$(element).indicator_show();
$.ajax({
type: 'post',
url: url,
......
$('[rel="twipsy"]').tooltip();
},
complete: function() {
$('#hostgroup_indicator').hide();
$(element).indicator_hide();
}
})
}
......
});
$.fn.indicator_show = function(){
$(this).parent().find('img').show();
$(this).parents('.form-group').find('img').show();
}
$.fn.indicator_hide = function(){
$(this).parent().find('img').hide();
$(this).parents('.form-group').find('img').hide();
}
function spinner_placeholder(text){
app/assets/javascripts/host_edit.js
},
success: function(result){
$('#compute_resource').html(result);
if ($('#compute_resource').find('.alert-error').length > 0) $('#compute_resource_tab a').addClass('tab-error');
if ($('#compute_resource').find('.alert-danger').length > 0) $('#compute_resource_tab a').addClass('tab-error');
update_capabilities($('#capabilities').val());
}
})
......
$('.error').children().children('.help-block').remove();
$('.error').removeClass('error');
$('.tab-error').removeClass('tab-error');
$('.alert-error').remove();
$('.alert-danger').remove();
}
function animate_progress(){
......
var done_tasks = $('.glyphicon-check',data).size();
var failed_tasks = $('.glyphicon-remove',data).size();
var $progress = $('.progress');
$("#host-progress").show();
if(failed_tasks > 0) {
$progress.removeClass('progress-success').addClass('progress-danger');
$('.progress-bar').addClass('progress-bar-danger');
}else{
$progress.removeClass('progress-danger').addClass('progress-success');
$('.progress-bar').removeClass('progress-bar-danger');
}
$('.bar').width(done_tasks/task_list_size *$progress.width());
$('.progress-bar').width(done_tasks/task_list_size * 100 + '%')
$('#tasks_progress').replaceWith(data);
}
app/assets/javascripts/two-pane.js
$('.error .help-block').hide();
$('.error').removeClass('error');
$('.tab-error').removeClass('tab-error');
$('.alert-error').remove();
$('.alert-danger').remove();
}
// when ajax call hit a session time out it should handle the redirect to login correctly.
app/helpers/layout_helper.rb
def base_errors_for obj
unless obj.errors[:base].blank?
content_tag(:div, :class => "alert alert-message alert-block alert-error base in fade") do
content_tag(:div, :class => "alert alert-message alert-block alert-danger base in fade") do
("<a class='close' href='#' data-dismiss='alert'>&times;</a><h4>" + _("Unable to save") + "</h4> " + obj.errors[:base].map {|e| "<li>".html_safe + e + "</li>".html_safe}.join).html_safe
end
end
app/views/common/403.html.erb
<div class="alert alert-message alert-block alert-error base in fade">
<div class="alert alert-message alert-block alert-danger base in fade">
<h2><%= _("Permission denied") %></h2>
<p><strong><%= _("You are not authorized to perform this action") %></strong></p>
app/views/common/500.html.erb
<% title _("Oops, we're sorry but something went wrong") %>
<div class="alert alert-message alert-block alert-error base in fade">
<div class="alert alert-message alert-block alert-danger base in fade">
<a class="close" href="#" data-dismiss="alert">x</a>
<%= h exception.message %>
</div>
......
<%= link_to_function(_("Full trace"), "$('#backtrace').toggle()")%> <%= _("and relevant log entries.") %>
</p>
<div id="backtrace" class="alert alert-message alert-block alert-error base in fade hide">
<div id="backtrace" class="alert alert-message alert-block alert-danger base in fade hide">
<em><%= exception.class %></em><br>
<strong><%= exception.message %></strong><br>
<%= Rails.backtrace_cleaner.clean(exception.backtrace).join("<br>").html_safe %>
app/views/hosts/_compute.html.erb
<%= render :partial => "compute_resources_vms/form/#{compute_resource.provider.downcase}",
:locals => { :f => compute, :compute_resource => compute_resource}.merge(args_for_compute_resource_partial(@host)) %>
<% else %>
<div class="alert alert-message alert-block alert-error base in fade">
<div class="alert alert-message alert-block alert-danger base in fade">
<% if @host %>
<h4><%= _("'%{host}' not found on '%{resource}'") % { :host => @host.name, :resource => compute_resource } %></h4>
<p><%= _("'%{host}' could be deleted or '%{resource}' is not responding.") % {:host => @host.name, :resource => compute_resource} %></p>
app/views/hosts/_progress.html.erb
<a class='close' href='#' data-dismiss='alert'>&times</a>
<h3><%= action_name %> <%= _('In Progress') %></h3>
<p id="tasks_progress"><%= action_name %> in progress.</p>
<div class="progress progress-striped active" style="width: 400px;">
<div class="bar" style="width: 0%;"></div>
<div class="progress progress-striped active">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
</div>
</div>
</div>
app/views/puppetclasses/_class_selection.html.erb
<div class="row">
<% if obj.errors[:puppetclasses].any? %>
<div class="alert alert-message alert-block alert-error base in fade">
<div class="alert alert-message alert-block alert-danger base in fade">
<a class='close' href='#' data-dismiss="alert">×</a>
<%= obj.errors[:puppetclasses].map {|e| "<li>#{e}</li>"}.to_s.html_safe %>
</div>
app/views/puppetclasses/no_route.html.erb
<%= stylesheet_link_tag 'jquery-ui', 'jquery.jnotify', 'bootstrap.min', 'style' %>
<%= javascript_include_tag :defaults %>
<div id="content" class="container">
<div class="alert alert-message alert-block alert-error">
<div class="alert alert-message alert-block alert-danger">
<h3><%= _('Oops') %></h3>
<p>
<%= _('Either you didn''t generate the puppetdocs (see <a rel="external" href="%{url}">here</a>) or the class <strong>%{name}</strong> could not be found in environment <strong>%{environment}</strong><br/> Please ensure that the class <strong>%{name}</strong>''s declaration is accessible via the modulepath associated with <strong>%{environment}</strong>.') % { :name => name, :environment => environment, :url => 'http://theforeman.org/projects/foreman/wiki/Puppet_class_browser' } %>
app/views/reports/show.html.erb
<p class='ra'> <%= _("Reported at %s ") % @report.reported_at.getlocal %> </p>
<% if @offset > 10 %>
<div class="alert alert-message alert-block alert-error">
<div class="alert alert-message alert-block alert-danger">
<a class="close" href="#" data-dismiss="alert">&times;</a>
<h3><%= _("Host times seems to be adrift!") %></h3>
<%= (_("Host reported time is <em>%s</em>") % @report.reported_at).html_safe %> <br/>

Also available in: Unified diff