Browse Source

twaks, fixes

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
af68536f35
  1. 4
      app/controllers/hosts_controller.rb
  2. 2
      app/models/a.rb
  3. 2
      app/views/devise/registrations/edit.html.erb
  4. 4
      app/views/fragments/_bottom.html.erb
  5. 3
      app/views/fragments/_top.html.erb
  6. 3
      config/locales/en.yml

4
app/controllers/hosts_controller.rb

@ -25,6 +25,10 @@ class HostsController < ApplicationController
record
end
def beginning_of_chain
super.includes(:domain).where(:domains => {:name => Settings.host_domains})
end
def before_create_save(record)
record.user = current_user
end

2
app/models/a.rb

@ -15,7 +15,7 @@ class A < Record
validates :content, :presence => true, :ip => {:ip_type => :v4} # Only accept valid IPv4 addresses
attr_accessor :host_domain
validates :host_domain, :inclusion => {:in => Settings.host_domains}
validates :host_domain, :inclusion => {:in => Settings.host_domains}, :allow_blank => true
before_validation do
if host_domain.present? && Settings.host_domains.include?(host_domain)

2
app/views/devise/registrations/edit.html.erb

@ -32,6 +32,8 @@
<%= link_to "Back", :back %>
<br />
<hr />
<div class="danger-zone">
<h3>Danger zone</h3>
<p>

4
app/views/fragments/_bottom.html.erb

@ -1,10 +1,12 @@
<div id="footer">
<div class="block">
<br />
<p>
<%= link_to('Terms & Conditions', page_path('terms'), :data => {:pjax => '#main'}) %> &bullet;
<%= link_to('Privacy Policy', page_path('privacy'), :data => {:pjax => '#main'}) %> &bullet;
<%= link_to('Contact', page_path('contact'), :data => {:pjax => '#main'}) %> &bullet;
<%= link_to("&copy; #{Time.now.year} EntryDNS Team".html_safe, root_path, :data => {:pjax => '#main'}) %>
<%= link_to('About', page_path('about'), :data => {:pjax => '#main'}) %> &bullet;
<%= link_to("&copy; #{Time.now.year} EntryDNS Team".html_safe, page_path('team'), :data => {:pjax => '#main'}) %>
</p>
</div>
</div>

3
app/views/fragments/_top.html.erb

@ -19,9 +19,6 @@
<div id="user-navigation">
<ul class="wat-cf">
<% if user_signed_in? %>
<li><%= link_to('About', page_path('about'), :data => {:pjax => '#main'}) %></li>
<li><%= link_to('Team', page_path('team'), :data => {:pjax => '#main'}) %></li>
<li><%= link_to('Contact', page_path('contact'), :data => {:pjax => '#main'}) %></li>
<li><%= link_to('Help & Support', page_path('help'), :data => {:pjax => '#main'}) %></li>
<li><%= link_to(current_user.email, edit_user_registration_path, :title => "IP: #{client_remote_ip}", :data => {:pjax => '#main'}) %></li>
<li><%= link_to('Sign out', destroy_user_session_path, :method => :delete) %></li>

3
config/locales/en.yml

@ -4,6 +4,9 @@
en:
errors:
action_not_allowed: "Action not allowed"
messages:
ipv4: "must be a valid IPV4"
ipv6: "must be a valid IPV6"
activerecord:
models:
soa: "SOA Record"

Loading…
Cancel
Save