Skip to content

Commit

Permalink
continue the categories index interface and translate the calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
ishmael committed Oct 21, 2010
1 parent bb39ad1 commit b86dbfc
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 22 deletions.
5 changes: 4 additions & 1 deletion app/helpers/categories_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ def nodes(categories,parent_id,index)
end

}
ret+= '<td></td>'
soma_linha.each do |soma|
ret+='<td class="categoryamount">' + soma
ret+='<td class="tc categoryamount">' + soma
ret+='</td'
end

ret +='<td class="actionsshared"> '
if (categoria.user_id == @current_user.id)
ret += '<ul class="actions">'
Expand All @@ -57,6 +59,7 @@ def nodes(categories,parent_id,index)
ret += '</ul>'
end
ret +='</td>'
ret+= '<td></td>'
ret +='</tr>'
ret +=nodes(categories,categoria.id,index+1)
end
Expand Down
31 changes: 19 additions & 12 deletions app/views/categories/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@
<table cellspacing="0">
<thead>
<tr>
<th class="first categoryname"><%= I18n.t('layout.movements.description') %><%= link_to image_tag("/images/led-ico/arrow_left.png",:alt => I18n.t('layout.categories.title')), categories_path(:month=>(@month.to_i - 1).to_s ),{:class =>'ico', :title => I18n.t('layout.categories.title')} %></th>
<th class="first categoryamount"> <%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-5).month] %></th>
<th class="first categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-4).month] %></th>
<th class="first categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-3).month] %></th>
<th class="first categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-2).month] %></th>
<th class="first categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-1).month] %></th>
<th class="first categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i).month] %></th>
<td class="tc last actionsshared">
<% if @month.to_i<0%>
<%= link_to image_tag("/images/led-ico/arrow_right.png",:alt => I18n.t('layout.categories.title')), categories_path(:month=>(@month.to_i + 1).to_s ),{:class =>'ico', :title => I18n.t('layout.categories.title')} %>
<% end %>
<%= I18n.t('layout.application.actions') %></td>
<th class="first categoryname">
<%= I18n.t('layout.categories.name') %>
</th>
<th class="arrow"> <%= link_to image_tag("/images/led-ico/arrow_left.png",:alt => I18n.t('layout.categories.title')), categories_path(:month=>(@month.to_i - 1).to_s ),{:class =>'ico', :title => I18n.t('layout.categories.title')} %></th>
<th class="tc categoryamount"> <%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-5).month] %></th>
<th class="tc categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-4).month] %></th>
<th class="tc categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-3).month] %></th>
<th class="tc categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-2).month] %></th>
<th class="tc categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i-1).month] %></th>
<th class="tc categoryamount"><%= I18n.t('date.month_names')[Time.now.months_since(@month.to_i).month] %></th>

<th class="actionsshared">
<%= I18n.t('layout.application.actions') %>
</td>
<th class="last arrow">
<% if @month.to_i<0%>
<%= link_to image_tag("/images/led-ico/arrow_right.png",:alt => I18n.t('layout.categories.title')), categories_path(:month=>(@month.to_i + 1).to_s ),{:class =>'ico', :title => I18n.t('layout.categories.title')} %>
<% end %>
</td>
</tr>
</thead>
<tbody>
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<%= stylesheet_link_tag 'reset-min','main'%>
<!--javascript-->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.1/build/yui/yui-min.js"></script>

<script type="text/javascript">
var locale = '<%= I18n.locale %>';
</script>
<!--css-->
<%= javascript_include_tag 'swfobject' %>

Expand Down
13 changes: 12 additions & 1 deletion public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@




// var querystring = YAHOO.util.History.getQueryStringParameter('locale'); ,'yui2-history'
// alert(locale);
var ButtonGroup = YAHOO.widget.ButtonGroup;

Event.onContentReady("header", function () {
Expand Down Expand Up @@ -88,6 +89,16 @@
// element of the Overlay.

var oCalendar = new YAHOO.widget.Calendar("buttoncalendar", oCalendarMenu.body.id,{navigator:true});

if (locale == "pt")
{
oCalendar.cfg.setProperty("MONTHS_SHORT", ["Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Dez"]);
oCalendar.cfg.setProperty("MONTHS_LONG", ["Janeiro", "Fevereiro", "Mar\u00E7o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]);
oCalendar.cfg.setProperty("WEEKDAYS_1CHAR", ["D", "S", "T", "Q", "Q", "S", "S"]);
oCalendar.cfg.setProperty("WEEKDAYS_SHORT", ["Do", "Se", "Te", "Qa", "Qi", "Se", "Sa"]);
oCalendar.cfg.setProperty("WEEKDAYS_MEDIUM",["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S\u00E1b"]);
oCalendar.cfg.setProperty("WEEKDAYS_LONG", ["Domingo", "Segunda", "Ter\u00E7a", "Quarta", "Quinta", "Sexta", "S\u00E1bado"]);
}

oCalendar.render();

Expand Down
11 changes: 10 additions & 1 deletion public/javascripts/bankaccount_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,16 @@
outTxt.value = "";

var cal = new YAHOO.example.calendar.IntervalCalendar("calSearchContainer", {pages:1,navigator:true,MDY_MONTH_POSITION:2,MDY_DAY_POSITION:1,MDY_YEAR_POSITION:3});

if (locale == "pt")
{
cal.cfg.setProperty("MONTHS_SHORT", ["Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Dez"]);
cal.cfg.setProperty("MONTHS_LONG", ["Janeiro", "Fevereiro", "Mar\u00E7o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]);
cal.cfg.setProperty("WEEKDAYS_1CHAR", ["D", "S", "T", "Q", "Q", "S", "S"]);
cal.cfg.setProperty("WEEKDAYS_SHORT", ["Do", "Se", "Te", "Qa", "Qi", "Se", "Sa"]);
cal.cfg.setProperty("WEEKDAYS_MEDIUM",["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S\u00E1b"]);
cal.cfg.setProperty("WEEKDAYS_LONG", ["Domingo", "Segunda", "Ter\u00E7a", "Quarta", "Quinta", "Sexta", "S\u00E1bado"]);
}

var oButtonGroup1 = new YAHOO.widget.ButtonGroup("search_type_movements_group");
oButtonGroup1.setStyle( 'visibility', 'visible');

Expand Down
11 changes: 11 additions & 0 deletions public/javascripts/movements.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@
// element of the Overlay.

var oCalendar = new YAHOO.widget.Calendar("movementscalendar", oCalendarMenu.body.id,{navigator:true});

if (locale == "pt")
{
oCalendar.cfg.setProperty("MONTHS_SHORT", ["Jan", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Dez"]);
oCalendar.cfg.setProperty("MONTHS_LONG", ["Janeiro", "Fevereiro", "Mar\u00E7o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]);
oCalendar.cfg.setProperty("WEEKDAYS_1CHAR", ["D", "S", "T", "Q", "Q", "S", "S"]);
oCalendar.cfg.setProperty("WEEKDAYS_SHORT", ["Do", "Se", "Te", "Qa", "Qi", "Se", "Sa"]);
oCalendar.cfg.setProperty("WEEKDAYS_MEDIUM",["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S\u00E1b"]);
oCalendar.cfg.setProperty("WEEKDAYS_LONG", ["Domingo", "Segunda", "Ter\u00E7a", "Quarta", "Quinta", "Sexta", "S\u00E1bado"]);
}


oCalendar.render();

Expand Down
9 changes: 3 additions & 6 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ input.phosney-header-button {
.box .content table th,
.box .content table td {padding: 10px 10px 8px 10px;}
.box .content table th {text-align: left; font-weight: normal;}
.box .content table th.arrow {padding: 0 0 0 5px;}
.box .content table tr.even th,
.box .content table tr.even td {background: #f5f5f5;}
.box .content table th.first,
Expand Down Expand Up @@ -845,17 +846,13 @@ input.phosney-header-button {
/* background: url("/images/led-ico/application_side_tree.png") 0 50% no-repeat;*/
}



.categoryamount {
width:70px;
}

th.categoryamount {
text-align:center !important;
}

td.categoryamount {
text-align:right !important;
}

.category_children {
display:inline-block;
Expand Down

0 comments on commit b86dbfc

Please sign in to comment.