Browse files

some ui changes

  • Loading branch information...
1 parent 0894ac2 commit f3fd8ee430ba01bfa040fd1e307c42c2ad3450f3 @gakshay committed Mar 7, 2012
View
5 app/controllers/transactions_controller.rb
@@ -97,7 +97,10 @@ def receive
@transaction = Transaction.get_document(params[:transaction][:receiver_mobile], params[:transaction][:receiver_email], params[:transaction][:document_secret])
unless @transaction.blank?
@document = @transaction.document
- send_file "public#{@document.doc.url(:original, false)}" , :type => "#{@document.doc_content_type}"
+ respond_to do |format|
+ format.html { send_file "public#{@document.doc.url(:original, false)}" , :type => "#{@document.doc_content_type}" }
+ format.xml{render :xml => @document}
+ end
else
respond_to do |format|
@transaction = Transaction.new(params[:transaction])
View
24 app/views/layouts/application.html.erb
@@ -9,25 +9,29 @@
</head>
<body>
<div class="header" style="width: 900px; margin: auto;">
- <%= link_to image_tag("logo.png"), "/" %>
+ <% if user_signed_in? %>
+ <%= link_to image_tag("logo.png"), "/transactions" %>
+ <% else %>
+ <%= link_to image_tag("logo.png"), "/" %>
+ <% end %>
<div class="right">
<% if user_signed_in? %>
- <%= current_user.mobile %> | <span><%= link_to "Sign out", destroy_user_session_path, :class => "button orange small" %></span>
- <span><%= link_to "Get Mail", receive_transactions_url, :class => "button orange small" %></span>
- <span><%= link_to "Send Mail", new_transaction_url, :class => "button orange small" %></span>
+ <%= current_user.mobile %> | <span><%= link_to "Sign out", destroy_user_session_path, :class => "button gray small" %></span>
+ <span><%= link_to "Get Mail", receive_transactions_url, :class => "button gray small" %></span>
+ <span><%= link_to "Send Mail", new_transaction_url, :class => "button gray small" %></span>
<% else %>
- <span><%= link_to "Login", new_user_session_url, :class => "button orange small" %></span>
- <span><%= link_to "Register", new_user_registration_url, :class => "button orange small" %></span>
- <span><%= link_to "Get Mail", receive_transactions_url, :class => "button orange small" %></span>
- <span><%= link_to "Send Mail", new_transaction_url, :class => "button orange small" %></span>
+ <span><%= link_to "Login", new_user_session_url, :class => "button gray small" %></span>
+ <span><%= link_to "Register", new_user_registration_url, :class => "button gray small" %></span>
+ <span><%= link_to "Get Mail", receive_transactions_url, :class => "button gray small" %></span>
+ <span><%= link_to "Send Mail", new_transaction_url, :class => "button gray small" %></span>
<% end %>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
</div>
</div>
- <div clas="content-wrapper" style="background-color: #ecf7fd; border-top: 1px solid #a0e5f3;border-bottom: 1px solid #a0e5f3;">
- <div class="content" style="width: 900px; margin: auto;">
+ <div class="content-wrapper">
+ <div class="content">
<%= yield %>
</div>
</div>
View
9 app/views/transactions/index.html.erb
@@ -1,16 +1,20 @@
<h1>Listing transactions</h1>
+<%= link_to 'Send New Document', new_transaction_path, :class => "button gray" %>
<table>
<tr>
- <th></th>
- <th></th>
+ <th>S.No</th>
+ <th>Document</th>
+ <th>Date</th>
+ <th>Secret Code</th>
<th></th>
</tr>
<% @transactions.each do |transaction| %>
<tr>
<td><%= link_to "#{transaction.id}", transaction %></td>
<td><%= link_to "#{transaction.document.doc_file_name}", transaction.document.doc.url(:original, false) %></td>
+ <td><%= transaction.created_at %></td>
<td><%= transaction.document_secret %></td>
<td><%= link_to 'Edit', edit_transaction_path(transaction) %></td>
<td><%= link_to 'x', transaction, :confirm => 'Are you sure?', :method => :delete %></td>
@@ -20,4 +24,3 @@
<br />
-<%= link_to 'New Transaction', new_transaction_path %>
View
13 public/stylesheets/application.css
@@ -8,13 +8,14 @@ font-size: 14px;
a img {
border: none;
+text-decoration : none;
}
a {
-color: #007ead;
text-decoration: none;
}
+
.clear {
clear: both;
height: 0;
@@ -26,6 +27,14 @@ overflow: hidden;
.heading {padding: 8px;}
input {
- border: 1px solid #98BF21;
+ border: 1px solid #98BF21;
}
+.content-wrapper{
+ background-color: #ecf7fd;
+ border-top: 1px solid #a0e5f3;
+ border-bottom: 1px solid #a0e5f3;
+}
+.content{
+width: 900px; margin: auto;
+}
View
4 public/stylesheets/scaffold.css
@@ -12,9 +12,7 @@ pre {
font-size: 11px;
}
-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
+a{ color: #666; }
div.field, div.actions {
margin-bottom: 10px;

0 comments on commit f3fd8ee

Please sign in to comment.