Permalink
Browse files

Profile bug solved

  • Loading branch information...
1 parent 8073c25 commit 6b340756e4fae129f8bac54fe5dab68427e1a8fc @adiezbal adiezbal committed Jul 11, 2011
Showing with 14 additions and 16 deletions.
  1. +1 −0 app/assets/stylesheets/base.css
  2. +7 −2 app/models/profile.rb
  3. +5 −14 app/views/profiles/edit.html.erb
  4. +1 −0 config/locales/en.yml
@@ -48,6 +48,7 @@ input.other_blue{ background:#497FC1; border:0px; cursor:pointer; font-size:1.0
margin-right:4px; color:white; padding:1px;}
textarea.new_contact_text_area{ width:100%; height: 100px; color: #2A3890;}
.colum_field_title{ text-align: center; }
+.needed{color:#D8000C;font-weight: normal;}
.select_relations select{ font-size: 12px; color: white; background-color:#1F4A75;}
/************ Forms - Buttons SECTION ***************************/
View
@@ -17,18 +17,23 @@ class Profile < ActiveRecord::Base
validate :validate_birthday
- def birthday=(value)
+ def birthday=(value)
+
+ puts "He entrado en el metodo birthday con un :" + value.class.to_s
+
if value.blank?
@birthday_formatted_invalid = false
super value
else
begin
- super Date.parse(value)
+ #super Date.parse(value)
+ super value
@birthday_formatted_invalid = false
rescue
@birthday_formatted_invalid = true
end
end
+
end
def age
@@ -80,17 +80,6 @@ end %>
<% end %>
<% if !params[:section].present? or params[:section].eql?("about_me") %>
- <% content_for :javascript do %>
- $(function () {
- defDate='-30y';
- if(<%= @profile.birthday?%>){
- defDate= new Date('<%=@profile.birthday%>');
- }
- $( "#profile_birthday" ).datepicker({ yearRange: '1900:<%= Time.now.utc.to_date.year%>',
- changeYear: true, maxDate: '+0d',
- defaultDate: defDate});
- });
- <% end %>
<div class="row">
<div class="form_row">
<h2><%=t('profile.' + current_subject.class.to_s.downcase + '.info')%></h2>
@@ -99,10 +88,10 @@ end %>
<%= f.fields_for :actor do |actor_form| %>
<div class="form_row">
<div class="form_label">
- <%= f.label t('actor.name') %>
+ <%= f.label t('actor.name') %><span class="needed"> (*)</span>
</div>
<div class="form_field">
- <%= actor_form.text_field :name, :class => "required form_tag" %>
+ <%= actor_form.text_field :name, :class => "required form_tag"%>
</div>
</div>
<%end%>
@@ -123,7 +112,7 @@ end %>
<%= f.label t('profile.' + current_subject.class.to_s.downcase + '.birthday')%>
</div>
<div class="form_field">
- <%= f.text_field( :birthday , :class => "date form_tag") %>
+ <%= date_select "profile", "birthday", :order => [:day, :month, :year], :end_year=> Date.today.year, :start_year=> (Date.today.year - 100) %>
</div>
</div>
@@ -151,6 +140,7 @@ end %>
<div class="form_row">
<%= f.text_area :description, :maxlength => 200, :rows => 10, :class => "form_tag_long" %>
</div>
+ <div class="form_row needed"><%=t('required')%></div>
<% end %>
<% if !params[:section].present? or params[:section].eql?("contact_info") %>
<div class="form_row">
@@ -210,6 +200,7 @@ end %>
<% if params[:section].present? %>
<%= hidden_field_tag("section", params[:section]) %>
<% end %>
+
<div class="form_row space_center">
<%= f.submit t('button.update'), :class => "button" %>&nbsp;
<button class="button" onclick="window.location.href='<%= polymorphic_path(current_subject) %>';">
View
@@ -301,6 +301,7 @@ en:
new: "+ New level"
relation_public:
name: "Public"
+ required: "* These fields are required"
settings:
error: "Some errors raised when saving your changes"
for: "Settings for"

0 comments on commit 6b34075

Please sign in to comment.