Skip to content

Commit

Permalink
updating the ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ishmael committed Aug 17, 2010
1 parent bb2b8e3 commit 274fb97
Show file tree
Hide file tree
Showing 27 changed files with 390 additions and 511 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def currencies(currencies,accounts,last)
ret = ''
currencies.each do |currency_type|
value = accounts.find_all{|item| item.currency == currency_type }.sum { |citem| citem.balance }
ret += "<tr class=\""+ cycle('even', 'odd') +"\">"
ret += "<tr class=\""+ cycle('even', 'odd',:name => "accounts") +"\">"
ret +="<th class=\"first\">"+ I18n.t('layout.accounts.total') +"(" + currency_type + ")</th>"
ret += "<td class=\"tr\">" + value.format
ret+="</td>"
Expand Down
26 changes: 11 additions & 15 deletions app/views/accounts/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<% content_for :javascript_includes do %>
<%= javascript_include_tag 'accounts_dashboard' %>
<% end %>
<div class="box box-first box-50 altbox ">
<div class="boxin">
<div class="header">
<div class="box box-first box-50 cr-all ">
<div class="header cr-top">
<h3><%= I18n.t('layout.bankaccounts.tagline') %></h3>
</div>
<div class="content">
<div class="content cr-bottom">
<table cellspacing="0">
<thead>
<tr>
Expand All @@ -17,7 +16,7 @@
<tbody>
<% uniq_currencies = Array.new %>
<% @accounts.each_with_index do |account,i| %>
<tr class="<% if i == 0 %>first<% else %><%= cycle('even', 'odd') %><% end%>" >
<tr class="<% if i == 0 %>first<% else %><%= cycle('even', 'odd',:name=> "accounts") %><% end%>" >
<th class="first"><div class="account_color" style="background-color:#<%= account.color%> ;"></div><%= link_to account.name,polymorphic_path([account,:movements]) %></th>
<td class="tr"><%= account.balance.format %></td>
</tr>
Expand All @@ -29,14 +28,12 @@
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-last box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div class="box box-last box-50 cr-all">
<div class="header cr-top">
<h3> <%= I18n.t('layout.movements.tag5line') %></h3>
</div>
<div class="content">
<div class="content cr-bottom">
<table cellspacing="0">
<thead>
<tr>
Expand All @@ -47,7 +44,7 @@
</thead>
<tbody>
<% @last5movements.each_with_index do |movement,i| %>
<tr class="<% if i == 0 %>first<% else %><%= cycle('even', 'odd') %><% end%>" >
<tr class="<% if i == 0 %>first<% else %><%= cycle('even', 'odd',:name=> "movements") %><% end%>" >
<th class="first"><%=h movement.description %></th>
<td class="tr"><%= movement.amount.format %></td>
<td ><%=h movement.type_of_movement %></td>
Expand All @@ -56,19 +53,18 @@
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-100 altbox">
<div class="box box-100 cr-all">
<div id="charts" class="yui-navset boxin">
<div class="header">
<div class="header cr-top">
<h3><%= I18n.t('layout.application.movsbyday') %> </h3>
<ul class="yui-nav">
<% uniq_currencies.each_with_index do |ycurrency,i| %>
<li <% if i == 0 %>class="selected"<% end %>><a href="#tab<%= i%>"><%=ycurrency %></a></li>
<% end %>
</ul>
</div>
<div class="content">
<div class="content cr-bottom">
<div class="yui-content">
<% uniq_currencies.each_with_index do |ycurrency,i| %>
<div id="<%='tab'+i.to_s %>">
Expand Down
16 changes: 6 additions & 10 deletions app/views/accounts_users/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="box box-first box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div class="box box-50 cr-all">
<div class="header cr-top">
<h3><%= I18n.t('layout.accountsusers.name') %></h3>
</div>
<div class="basic cr-bottom">
<% form_for([@account,@sharedaccount],:html =>{:class => 'basic'}) do |f| %>
<div class="inner-form">
<dl>
<dt><%= f.label :email , I18n.t('layout.accountsusers.user') %></dt>
<dd><%= f.text_field :login,:disabled => :true ,:class => 'txt' %></dd>
Expand All @@ -15,14 +14,11 @@
<dt><%= f.label I18n.t('layout.accountsusers.candelete') %></dt>
<dd><%= f.check_box :allow_delete %></dd>
<dd class="submit">
<div>
<%= f.submit I18n.t('layout.application.update'),:class => 'button' %> <%= I18n.t('layout.application.or') %>
<%= link_to I18n.t('layout.application.cancel'), polymorphic_path([@account,:movements]) %>
</div>
<%= f.submit I18n.t('layout.application.update'),:class => 'phosney-button edit cr-bottom-left' %>
<%= link_to I18n.t('layout.application.cancel'), polymorphic_path([@account,:movements]),:class => 'phosney-button delete cr-bottom-right' %>
</dd>
</dl>
</div>
<% end %>
</div>
</div>
</div>

17 changes: 7 additions & 10 deletions app/views/bankaccounts/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<% content_for :javascript_includes do %>
<%= javascript_include_tag 'accounts_dashboard' %>
<% end %>
<div class="box box-first box-50 altbox">
<!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div class="box box-first box-50 cr-all">
<div class="header cr-top">
<h3>
<%= I18n.t('layout.bankaccounts.tagline') %>
</h3>
</div>
<div class="content">
<div class="content cr-bottom">
<table cellspacing="0">
<thead>
<tr>
Expand All @@ -26,7 +24,7 @@
</thead>
<tbody>
<% uniq_currencies = Array.new %><% @bankaccountsdata.each_with_index do |bankaccount,i| %>
<tr class="<% if i == 0 %>first<% else %><%= cycle('even', 'odd') %><% end%>">
<tr class="<% if i == 0 %>first<% else %><%= cycle('even', 'odd',:name=> "accounts") %><% end%>">
<th class="first">
<div class="account_color" style="background-color:#<%= bankaccount.color%> ;"></div><%= link_to bankaccount.name,polymorphic_path([bankaccount,:movements]) %>
</th>
Expand All @@ -48,11 +46,10 @@
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-100 altbox">
<div class="box box-100 cr-all">
<div id="charts" class="yui-navset boxin">
<div class="header">
<div class="header cr-top">
<h3>
<%= I18n.t('layout.application.movsbyday') %>
</h3>
Expand All @@ -63,7 +60,7 @@
</li><% end %>
</ul>
</div>
<div class="content">
<div class="content cr-bottom">
<div class="yui-content">
<% uniq_currencies.each_with_index do |ycurrency,i| %>
<div id="<%='tab'+i.to_s %>">
Expand Down
20 changes: 9 additions & 11 deletions app/views/categories/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<div id="category_div" class="box box-first box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div id="category_div" class="box box-50 "><!-- .altbox for alternative box's color -->
<div class="header cr-top">
<h3><%= I18n.t('layout.categories.name') %></h3>
</div>
<div class="basic cr-bottom">
<% form_for(@category,:html =>{:class => 'basic'}) do |f| %>
<div class="inner-form">

<dl>
<%= render :partial => "form", :object => f %>
<dd class="submit">
<div>
<%= f.submit I18n.t('layout.application.update'),:class => 'button' %> <%= I18n.t('layout.application.or') %>
<%= link_to I18n.t('layout.application.cancel'), categories_path %>
</div>
<%= f.submit I18n.t('layout.application.update'),:class => 'phosney-button edit cr-bottom-left' %>
<%= link_to I18n.t('layout.application.cancel'), categories_path,:class => 'phosney-button delete cr-bottom-right' %>
</dd>
</dl>
</div>

<% end %>
</div>
</div>
</div>
</div>
10 changes: 4 additions & 6 deletions app/views/categories/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<% content_for :javascript_includes do %>
<%= javascript_include_tag 'categories_dashboard' %>
<% end %>
<div class="box box-first box-100 altbox "><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div class="box box-first box-100 cr-all "><!-- .altbox for alternative box's color -->
<div class="header cr-top">
<h3><%= I18n.t('layout.categories.title') %></h3>
<% if not @categories.empty? %>
<%= link_to I18n.t('layout.categories.new'), new_category_path ,:class => 'button'%>
<%= link_to I18n.t('layout.categories.new'), new_category_path ,:class => 'phosney-button'%>
<% end%>
</div>
<div class="content categories_content">
<div class="content categories_content cr-bottom">
<% if not @categories.empty? %>
<div id="categoriesnl">
<ul class="catnestedlist droppable">
Expand All @@ -24,5 +23,4 @@
</div>
<% end %>
</div>
</div>
</div>
17 changes: 7 additions & 10 deletions app/views/categories/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<div id="category_div" class="box box-first box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div id="category_div" class="box box-50 cr-all"><!-- .altbox for alternative box's color -->
<div class="header cr-top">
<h3><%= I18n.t('layout.categories.new') %></h3>
</div>
<div class="basic cr-bottom">
<% form_for(@category,:html =>{:class => 'basic'}) do |f| %>
<div class="inner-form">

<dl>
<%= render :partial => "form", :object => f %>
<dd class="submit">
<div>
<%= f.submit I18n.t('layout.application.create'),:class => 'button' %> <%= I18n.t('layout.application.or') %>
<%= link_to I18n.t('layout.application.cancel'), categories_path %>
</div>
<%= f.submit I18n.t('layout.application.create'),:class => 'phosney-button edit cr-bottom-left' %>
<%= link_to I18n.t('layout.application.cancel'), categories_path,:class => 'phosney-button delete cr-bottom-right' %>
</dd>
</dl>
</div>
<% end %>
</div>
</div>
</div>
39 changes: 14 additions & 25 deletions app/views/categories/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@

<div id="movements_div" class="box box-first box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div id="movements_div" class="box box-first box-50 cr-all">
<div class="header cr-top">
<h3><%= I18n.t('layout.categories.name') %></h3>
<% if @category.user_id == @current_user.id %>
<%= link_to I18n.t('layout.application.edit'),edit_category_path(@category.id),:class => 'button' %>
<%= link_to I18n.t('layout.application.edit'),edit_category_path(@category.id),:class => 'phosney-button' %>
<% end %>
</div>
<div class="inner-form">
<div class="basic">
<div class="basic cr-bottom">
<dl>
<dt><%= I18n.t('activerecord.attributes.category.name') %></dt>
<dd><%=h @category.name %></dd>
<dd class="submit">
<div>
<%= link_to I18n.t('layout.application.back'), categories_path %>
</div>
<%= link_to I18n.t('layout.application.back'), categories_path,:class => 'phosney-button back cr-bottom' %>
</dd>
</dl>
</div>
</div>
</div>
</div>
<% if @category.user_id == @current_user.id %>
<% @shared_categories = @category.categories_users.find(:all,:conditions => ['user_id <> :user_id',:user_id => @current_user.id]) %>

<div class="box box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div class="box box-50 cr-all"><!-- .altbox for alternative box's color -->
<div class="header cr-top">
<h3><%= I18n.t('layout.categoriesusers.shared_with') %></h3>
<% if (not @shared_categories.empty?) %>
<%= link_to I18n.t('layout.application.new'),new_polymorphic_path([@category,:categories_user]),:class => 'button' %>
<%= link_to I18n.t('layout.application.new'),new_polymorphic_path([@category,:categories_user]),:class => 'phosney-button' %>
<% end %>
</div>

<% if not @shared_categories.empty? %>
<div class="content">
<% if not @shared_categories.empty? %>
<div class="content cr-bottom">
<table cellspacing="0">
<thead>
<tr>
Expand All @@ -60,14 +50,13 @@
</tbody>
</table>
</div>
<% else %>
<div class="basic">
<% else %>
<div class="basic cr-bottom">
<% if @category.user_id == @current_user.id%>
<div class="tc" style="margin:10px;"><%= link_to I18n.t('layout.categoriesusers.share_category'), new_polymorphic_path([@category,:categories_user]) %></div>
<% end %>
</div>
<% end %>

</div>
<% end %>

</div>
<% end %>
14 changes: 5 additions & 9 deletions app/views/categories_users/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<% content_for :javascript_includes do %>
<%= javascript_include_tag 'categories_user' %>
<% end %>
<div class="box box-first box-50 altbox"><!-- .altbox for alternative box's color -->
<div class="boxin">
<div class="header">
<div class="box box-50 cr-all">
<div class="header cr-top">
<h3><%= I18n.t('layout.categoriesusers.name') %></h3>
</div>
<% form_for([@category,@categoryusers],:html =>{:class => 'basic'}) do |f| %>
<div class="inner-form">
<div class="basic cr-bottom">
<% if not f.error_messages.blank? %>
<div class="msg msg-error">
<%= f.error_messages :header_message => nil, :message => nil %>
Expand All @@ -19,13 +18,10 @@
<%= f.collection_select :user_id, AccountsUser.find_shared_accounts_users(:all,:conditions => ['accounts_users.account_id in (select accu.account_id from accounts_users accu where accu.user_id = :user_id) and users.id <>:user_id', :user_id => @current_user.id,:user_id =>@current_user.id]), :id, :login, { :include_blank => false}, { :id => 'shared_category' } %></dd>

<dd class="submit">
<div>
<%= f.submit I18n.t('layout.application.share'),:class => 'button' %> <%= I18n.t('layout.application.or') %>
<%= link_to I18n.t('layout.application.cancel'), category_path(@category) %>
</div>
<%= f.submit I18n.t('layout.application.share'),:class => 'phosney-button edit cr-bottom-left' %>
<%= link_to I18n.t('layout.application.cancel'), category_path(@category),:class => 'phosney-button delete cr-bottom-right' %>
</dd>
</dl>
</div>
<% end %>
</div>
</div>

0 comments on commit 274fb97

Please sign in to comment.