Browse Source

error pages, refactor

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
e44909b0a6
  1. 4
      app/assets/stylesheets/overrides.css.erb
  2. 21
      app/views/active_scaffold_overrides/_form_association.html.erb
  3. 2
      app/views/domains/_list_record_columns.html.erb
  4. 2
      app/views/layouts/application.html.erb
  5. 29
      app/views/layouts/errors.html.erb

4
app/assets/stylesheets/overrides.css.erb

@ -14,6 +14,10 @@
text-shadow: none;
}
body.errors #main .inner {
margin-top: 15px;
}
.flash .alert {
border: 1px solid #bb9004;
background: #f9c006 url(<%= asset_path("web-app-theme/themes/default/images/messages/warning.png") %>) no-repeat 10px center;

21
app/views/active_scaffold_overrides/_form_association.html.erb

@ -1,21 +0,0 @@
<%
parent_record = @record
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).to_a
associated = associated.sort_by {|r| r.new_record? ? 99999999999 : r.id} unless column.association.options.has_key?(:order)
if show_blank_record = column.show_blank_record?(associated)
child = column.singular_association? ? parent_record.send(:"build_#{column.name}") : parent_record.send(column.name).build
reflection = parent_record.class.reflect_on_association(column.name)
if reflection && reflection.reverse
reverse_macro = child.class.reflect_on_association(reflection.reverse).macro
child.send(:"#{reflection.reverse}=", parent_record) if [:has_one, :belongs_to].include?(reverse_macro)
end
associated << child
end
subform_div_id = "#{sub_form_id({:association => column.name, :id => parent_record.id || 99999999999})}-div"
-%>
<h5><%= column.label -%></h5>
<div id ="<%= subform_div_id %>" <%= 'style="display: none;"'.html_safe if column.collapsed -%>>
<%= render :partial => subform_partial_for_column(column), :locals => {:column => column, :parent_record => parent_record, :associated => associated, :show_blank_record => show_blank_record} %>
</div>
<%= link_to_visibility_toggle(subform_div_id, {:default_visible => !column.collapsed}) -%>
<% @record = parent_record -%>

2
app/views/domains/_list_record_columns.html.erb

@ -1,3 +1,5 @@
<%# meaningful names for empty columns instead tiny dash "-" %>
<% columns.each do |column| %>
<% authorized = record.authorized_for?(:crud_type => :read, :column => column.name) -%>
<% column_value = authorized ? get_column_value(record, column) : active_scaffold_config.list.empty_field_text -%>

2
app/views/layouts/application.html.erb

@ -6,7 +6,7 @@
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>
<body>
<body class="application">
<div id="container">
<%= render :partial => 'fragments/top' %>

29
app/views/layouts/errors.html.erb

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>Simple DNS</title>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>
<body class="errors">
<div id="container">
<%= render :partial => 'fragments/top' %>
<div id="wrapper" class="wat-cf">
<div id="main" style="width: 100%;">
<div class="block">
<div class="content">
<div class="inner" data-pjax-container="true">
<%= flash_display 'flash' %>
<%= yield %>
</div>
</div>
</div>
</div>
</div>
<%= render :partial => 'fragments/bottom' %>
</div>
</body>
</html>
Loading…
Cancel
Save