Browse Source

N'utiliser que .targets et pas .all_targets

master
Norore 4 years ago
parent
commit
12d3a9c117
  1. 3
      app/controllers/config_controller.rb
  2. 4
      app/views/config/index.html.erb

3
app/controllers/config_controller.rb

@ -2,7 +2,6 @@ class ConfigController < ApplicationController
def index
@groups = Group.all
@templates = ::Template.all
@targets = Target.all
@sites = Site.all.order(:name, :url)
@sites = Site.where(group: nil).order(:name, :url)
end
end

4
app/views/config/index.html.erb

@ -75,11 +75,11 @@
<ul class="">
<% @sites.each do |site| %>
<li><%= link_to (site.name||site.url), site %></li>
<% unless site.all_targets.empty? %>
<% unless site.targets.empty? %>
<ul class="">
<li>targets:</li>
<ul class="">
<% site.all_targets.each do |target| %>
<% site.targets.each do |target| %>
<li><%= :name %>: <%= target.name||target.id %></li>
<% if target.css %>
<li><%= :css %>: <%= content_tag :code do target.css end %></li>

Loading…
Cancel
Save