Permalink
Browse files

update admin vews

  • Loading branch information...
1 parent dd93cd8 commit 4c123768cdf4b93b56269f443fcd7bfe59c2e66a @shenoudab committed Nov 19, 2011
@@ -1,4 +1,37 @@
/*
*= require bootstrap
*= require_self
-*/
+*/
+/* Override some defaults */
+html, body {
+ background-color:#eee;
+}
+body {
+ padding-top:40px; /* 40px to make the container go all the way to the bottom of the topbar */
+}
+.container> footer p {
+ text-align:center; /* center align it with the container */
+}
+.container {
+ width:820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
+}
+.content {
+ background-color:white;
+ padding:20px;
+ margin:0 -20px;
+ -webkit-border-radius:6px 6px 6px 6px;
+ -moz-border-radius:6px 6px 6px 6px;
+ border-radius:6px 6px 6px 6px;
+ -webkit-box-shadow:0 1px 2px rgba(0,0,0,.15);
+ -moz-box-shadow:0 1px 2px rgba(0,0,0,.15);
+ box-shadow:0 1px 2px rgba(0,0,0,.15);
+}
+/* Page header tweaks */
+.page-header {
+ -webkit-border-radius:6px 6px 0 0;
+ -moz-border-radius:6px 6px 0 0;
+ border-radius:6px 6px 0 0;
+ background-color:#f5f5f5;
+ padding:20px 20px 10px;
+ margin:-20px -20px 20px;
+}
@@ -1,17 +0,0 @@
-<%= form_for(@subscriber) do |f| %>
-<% if @subscriber.errors.any? %>
-<div id="error_explanation">
- <h2><%= pluralize(@subscriber.errors.count, "error") %> prohibited this subscriber from being saved:</h2>
- <ul>
- <% @subscriber.errors.full_messages.each do |msg| %>
- <li>
- <%= msg %>
- </li>
- <% end %>
- </ul>
-</div>
-<% end %>
-<%= f.text_field :name, :placeholder => "Enter subscriber Name" %>
-<%= f.text_field :email, :placeholder => "Enter subscriber Email" %>
-<%= f.submit "Add Subscriber" %>
-<% end %>
@@ -1,6 +1,37 @@
-<h1>Editing subscriber</h1>
-
-<%= render 'form' %>
-
+<div class="page-header">
+ <h1>Edit Subscriber</h1>
+</div>
+<div id="subscriber">
+ <%= form_for(@subscriber) do |f| %>
+ <% if @subscriber.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@subscriber.errors.count, "error") %> prohibited this subscriber from being saved:</h2>
+ <ul>
+ <% @subscriber.errors.full_messages.each do |msg| %>
+ <li>
+ <%= msg %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+ <div class="clearfix">
+ <%= f.label :name %>
+ <div class="input">
+ <%= f.text_field :name, :class => 'xlarge', :placeholder => "Enter subscriber Name" %>
+ </div>
+ </div>
+ <div class="clearfix">
+ <%= f.label :email %>
+ <div class="input">
+ <%= f.text_field :email, :class => 'xlarge', :placeholder => "Enter subscriber Email" %>
+ </div>
+ </div>
+ <div class="actions">
+ <%= f.submit "Update", :class => 'btn primary' %>&nbsp;
+ <%= link_to 'Cancel', admin_subscribers_path, :class => 'btn' %>
+ </div>
+ <% end %>
+</div>
<%= link_to 'Show', @subscriber %> |
-<%= link_to 'Back', admin_subscribers_path %>
+<%= link_to 'Back', admin_subscribers_path %>
@@ -6,16 +6,16 @@
<th>#</th>
<th>Name</th>
<th>Email</th>
- <!-- <th> * </th> -->
+ <th> * </th>
</tr>
<% @subscribers.each_with_index do |subscriber, index| %>
<tr>
<td><%= index + 1 %></td>
<td><%= subscriber.name %></td>
<td><%= subscriber.email %></td>
- <!-- <td><%= link_to 'Show', admin_subscriber_path(subscriber) %> |
+ <td><%= link_to 'Show', admin_subscriber_path(subscriber) %> |
<%= link_to 'Edit', edit_admin_subscriber_path(subscriber) %> |
- <%= link_to 'Delete', subscriber, confirm: 'Are you sure?', method: :delete %></td> -->
+ <%= link_to 'Delete', subscriber, confirm: 'Are you sure?', method: :delete %></td>
</tr>
<% end %>
</table>
@@ -2,6 +2,35 @@
<h1>Add new Subscriber</h1>
</div>
<div id="subscriber">
- <%= render 'form' %>
+ <%= form_for(@subscriber) do |f| %>
+ <% if @subscriber.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@subscriber.errors.count, "error") %> prohibited this subscriber from being saved:</h2>
+ <ul>
+ <% @subscriber.errors.full_messages.each do |msg| %>
+ <li>
+ <%= msg %>
+ </li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+ <div class="clearfix">
+ <%= f.label :name %>
+ <div class="input">
+ <%= f.text_field :name, :class => 'xlarge', :placeholder => "Enter subscriber Name" %>
+ </div>
+ </div>
+ <div class="clearfix">
+ <%= f.label :email %>
+ <div class="input">
+ <%= f.text_field :email, :class => 'xlarge', :placeholder => "Enter subscriber Email" %>
+ </div>
+ </div>
+ <div class="actions">
+ <%= f.submit "Add Subscriber", :class => 'btn primary' %>&nbsp;
+ <%= link_to 'Cancel', admin_subscribers_path, :class => 'btn' %>
+ </div>
+ <% end %>
</div>
<%= link_to 'Back', admin_subscribers_path %>
@@ -1,5 +1,18 @@
-<p id="notice">
- <%= notice %>
-</p>
+<div class="page-header">
+ <h1>Subscriber</h1>
+</div>
+<div id="subscriber">
+ <p id="notice">
+ <%= notice %>
+ </p>
+ <div>
+ <b>Name:</b>
+ <%= @subscriber.name %>
+ </div>
+ <div>
+ <b>Email:</b>
+ <%= @subscriber.email %>
+ </div>
+</div>
<%= link_to 'Edit', edit_admin_subscriber_path(@subscriber) %> |
<%= link_to 'Back', admin_subscribers_path %>
@@ -1,2 +1,3 @@
ShenoudaB@gmail.com
shenoudab@gmail.com
+ShenoudaB@gmail.com

0 comments on commit 4c12376

Please sign in to comment.