Skip to content

Commit

Permalink
refact for better readability, spell check
Browse files Browse the repository at this point in the history
  • Loading branch information
kfl62 committed Mar 17, 2009
1 parent 4abaa26 commit 5fd85f4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 52 deletions.
20 changes: 15 additions & 5 deletions app/models/trst_prtn.rb
Expand Up @@ -21,7 +21,7 @@
# t.string "tel", :limit => 30, :default => "", :null => false
# t.string "fax", :limit => 30, :default => "", :null => false
# t.string "email", :limit => 30, :default => "", :null => false
# t.string "webadress", :limit => 30, :default => "", :null => false
# t.string "webaddress", :limit => 30, :default => "", :null => false
# t.boolean "flag_clb", :default => false, :null => false
# t.trst
# end
Expand Down Expand Up @@ -52,18 +52,28 @@ def full_name
return prefix + ' ' + name + ' ' + suffix
end

def full_address
address = self.address? ? self.addres : 'str. ?'
def id_info
chamcom = self.id_chamcom? ? self.id_chamcom : 'J12/.../....'
fiscal = self.id_fiscal? ? self.id_fiscal : 'R...'
itm = self.id_itm? ? self.id_itm : '...?...'
account = self.id_account? ? self.id_account : '...?...'
return chamcom + '; ' + fiscal + '; ' + itm + '; ' + account
end

def address_info
address = self.address? ? self.address : 'str. ?'
city = self.city? ? self.city : '...?...'
zip = self.zip? ? self.zip : '...?...'
state = self.state? ? self.state : '...?...'
return address + ', ' + city + ', ' + zip + ', ' + state
end

def full_telnr
def contact_info
tel = self.tel? ? self.tel : '...?...'
fax = self.fax? ? self.fax : '...?...'
return tel + ', Fax/Mobil ' + fax
email = self.email? ? self.email : '...?...'
web = self.webaddress? ? self.webaddress : '...?...'
return tel + ' ' + fax + ' ' + email + ' ' + web
end

end
17 changes: 9 additions & 8 deletions app/views/trst_sys/prtn/_edit.html.erb
@@ -1,4 +1,4 @@
<div style="width : 380px; height : 260px;">
<div style="width : 380px; height : 280px;">
<% if params[:obj_id] == "new"
obj = TrstPrtn.new
else
Expand All @@ -15,17 +15,17 @@
</thead>
<tbody>
<tr>
<%= f.td_label_tag :full_name, t('activerecord.attributes.trst_prtn.fullname_0_edit'), {:colspan => 2} %>
<%= f.td_label_tag :name_info, nil, {:colspan => 2} %>
</tr>
<tr>
<td colspan="2">
<%= f.text_field :prefix, {:size => 2} %>
<%= f.text_field :name, {:size => 15} %>
<%= f.text_field :name, {:size => 27} %>
<%= f.text_field :suffix, {:size => 3} %>
</td>
</tr>
<tr>
<%= f.td_label_tag :full_name, t('activerecord.attributes.trst_prtn.fullname_1_edit'), {:colspan => 2} %>
<%= f.td_label_tag :id_info, nil, {:colspan => 2} %>
</tr>
<tr>
<td colspan="2">
Expand All @@ -36,7 +36,7 @@
</td>
</tr>
<tr>
<%= f.td_label_tag :full_name, t('activerecord.attributes.trst_prtn.fullname_2_edit'), {:colspan => 2} %>
<%= f.td_label_tag :address_info, nil, {:colspan => 2} %>
</tr>
<tr>
<td colspan="2">
Expand All @@ -48,16 +48,17 @@
</tr>
<tr>
<%= f.td_label_tag :contactpers %>
<%= f.td_text_field :contactpers, {:size => 20 } %>
<%= f.td_text_field :contactpers, {:size => 23 } %>
</tr>
<tr>
<%= f.td_label_tag :full_name, t('activerecord.attributes.trst_prtn.fullname_3_edit'), {:colspan => 2} %>
<%= f.td_label_tag :contact_info, nil, {:colspan => 2} %>
</tr>
<tr>
<td colspan="2">
<%= f.text_field :tel, {:size => 8} %>
<%= f.text_field :fax, {:size => 8} %>
<%= f.text_field :email, {:size => 14} %>
<%= f.text_field :email, {:size => 16} %>
<%= f.text_field :webaddress, {:size => 40} %>
</td>
</tr>
<%= f.hidden_fields :updated_by => current_trst_user.id %>
Expand Down
30 changes: 8 additions & 22 deletions app/views/trst_sys/prtn/_show.html.erb
@@ -1,4 +1,4 @@
<div style="width:500px;height:440px">
<div style="width:500px;height:380px">
<% o = find_obj(TrstPrtn,params[:obj_id]) %>
<table style="width:80%; margin:auto;">
<thead>
Expand All @@ -17,41 +17,27 @@
<%= td_value_tag o, :namesh %>
</tr>
<tr>
<%= td_label_tag o, :id_chamcom %>
<%= td_value_tag o, :id_chamcom %>
<%= td_label_tag o, :id_info, nil, {:colspan => '2', :style => 'font-style:italic'} %>
</tr>
<tr>
<%= td_label_tag o, :id_fiscal %>
<%= td_value_tag o, :id_fiscal %>
<%= td_value_tag o, :id_info, :colspan => '2' %>
</tr>
<tr>
<%= td_label_tag o, :id_itm %>
<%= td_value_tag o, :id_itm %>
<%= td_label_tag o, :address_info, nil, {:colspan => '2', :style => 'font-style:italic'} %>
</tr>
<tr>
<%= td_label_tag o, :id_account %>
<%= td_value_tag o, :id_account %>
</tr>
<tr>
<%= td_label_tag o, :id_internet %>
<%= td_value_tag o, :id_internet %>
</tr>
<tr>
<%= td_label_tag o, :address %>
<%= td_value_tag o, :full_address %>
<%= td_value_tag o, :address_info, :colspan => '2' %>
</tr>
<tr>
<%= td_label_tag o, :contactpers %>
<%= td_value_tag o, :contactpers %>
</tr>
<tr>
<%= td_label_tag o, :tel %>
<%= td_value_tag o, :full_telnr %>
<%= td_label_tag o, :contact_info, nil, {:colspan => '2', :style => 'font-style:italic'} %>
</tr>
<tr>
<%= td_label_tag o, :email %>
<%= td_value_tag o, :email %>
</tr
<%= td_value_tag o, :contact_info, :colspan => '2' %>
</tr>
<tr>
<td colspan="2"><hr/></td>
</tr>
Expand Down
26 changes: 9 additions & 17 deletions config/locales/trst_prtn.yml
Expand Up @@ -58,10 +58,6 @@ en:
fax: ""
email: ""
webaddress: ""
fullname_0_edit: ""
fullname_1_edit: ""
fullname_2_edit: ""
fullname_3_edit: ""

#Romanian translation
ro:
Expand Down Expand Up @@ -90,15 +86,19 @@ ro:
fax: "Nr. Fax"
email: "Adresa email"
webaddress: "Adresa paginei de internet"
name_info: "Prefix (S.C. ...) / Nume / Suffix (S.A. ...)"
id_info: "Nr. Cam. Comerţ / Cod Fiscal / Cod ITM / Cont contab."
address_info: "Adresa (str.nr...)/ Oraş / Cod poştal / Judeţ"
contact_info: "Nr. telefon/ Fax, Mobil / Adresă email / Adresă internet"
save:
create: "Partenerul a fost creat ..."
update: "Modificările au fost salvate..."
remove: "Firma <strong>{{prtn_name}}</strong> a fost ştearsă..."
link_to_show: "Detalii firmă"
link_to_list: "Lista firmelor"
remove: "Partenerul <strong>{{prtn_name}}</strong> a fost ştearsă..."
link_to_show: "Detalii partener"
link_to_list: "Lista patenerilor"
show:
link_to_edit: "Editare firmă"
link_to_list: "Lista firmelor"
link_to_edit: "Editare partener"
link_to_list: "Lista partenerilor"
activerecord:
attributes:
trst_prtn:
Expand All @@ -124,10 +124,6 @@ ro:
fax: "Fax."
email: "Email"
webaddress: "www"
fullname_0_edit: "Prefix (S.C. ...) / Nume / Suffix S.A. ..."
fullname_1_edit: "Nr. Cam. Comerţ / Cod Fiscal / Cod ITM / Cont contab."
fullname_2_edit: "Adresa (str.nr...)/ Oraş / Cod poştal / Judeţ"
fullname_3_edit: "Nr. telefon/ Fax, Mobil / Adresă email"

#Hungarian translation
hu:
Expand Down Expand Up @@ -190,7 +186,3 @@ hu:
fax: ""
email: ""
webaddress: ""
fullname_0_edit: ""
fullname_1_edit: ""
fullname_2_edit: ""
fullname_3_edit: ""

0 comments on commit 5fd85f4

Please sign in to comment.