Skip to content

Commit

Permalink
Parent domain now defined in config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanzi committed Oct 9, 2011
1 parent 26c9bd7 commit fb23398
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ Config.yml
----------

development:
parent_domain: <parent domain>
username: <username>
password: <password>
test:
parent_domain: <parent domain>
username: <username>
password: <password>
production:
parent_domain: <parent domain>
username: <username>
password: <password>

Expand Down
2 changes: 1 addition & 1 deletion app/views/links/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="input">
<%= hidden_field_tag "default_subdomain", @default_subdomain %>
<%= f.text_field :subdomain, :placeholder => @default_subdomain, :value => (@link.subdomain unless @link.subdomain == @default_subdomain) %>
<span class="help-inline">Enter without the parent domain, e.g. subbysub NOT subbysub.hadric.us</span>
<span class="help-inline">Enter without the parent domain, e.g. subbysub NOT subbysub.<%= APP_CONFIG['parent_domain'] %></span>
<% @link.errors[:subdomain].each do |msg| %>
<span class="help-block"><%= msg.capitalize %>!</span>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/links/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= render :partial => 'errors' %>

<div class="page-header"><h1>Editing Subdomain <small><%= @link.subdomain %>.hadric.us</small></h1></div>
<div class="page-header"><h1>Editing Subdomain <small><%= "#{@link.subdomain}.#{APP_CONFIG['parent_domain']}" %></small></h1></div>

<%= render 'form' %>

4 changes: 2 additions & 2 deletions app/views/links/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<% @links.each do |link| %>
<tr>
<td><%= link.subdomain %><span class="sublabel">.hadric.us</span></td>
<td><%= link.subdomain %><span class="sublabel">.<%= APP_CONFIG['parent_domain'] %></span></td>
<td><a href="<%= link.url %>"><%= link.url %></a></td>
<% if is_authed? %>
<td><%= link.visits %></td>
Expand All @@ -25,7 +25,7 @@
<h3>Are you sure?</h3>
</div>
<div class="modal-body">
<p>Really destroy subdomain <strong><%= link.subdomain %>.hadric.us</strong>?</p>
<p>Really destroy subdomain <strong><%= "#{link.subdomain}.#{APP_CONFIG['parent_domain']}" %></strong>?</p>
</div>
<div class="modal-footer">
<%= link_to 'Destroy', link, method: :delete, :class => "btn danger" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/links/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render :partial => 'errors' %>

<div class="page-header"><h1>New Subdomain <small>@ hadric.us</small></h1></div>
<div class="page-header"><h1>New Subdomain <small>@ <%= APP_CONFIG['parent_domain'] %></small></h1></div>

<%= render 'form' %>

0 comments on commit fb23398

Please sign in to comment.