Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #130 and little css issues

  • Loading branch information...
commit 088fbdcb460326c61b661de0a04ccefd20adbd88 1 parent a375664
@adiezbal adiezbal authored
View
1  .gitignore
@@ -11,4 +11,5 @@ nbproject
lib/generators/social_stream/templates/public/images/tmp/
**.*swp
spec/dummy/documents/pictures/*
+spec/dummy/documents/documents/*
.code_swarm
View
7 base/app/assets/javascripts/invitations.js
@@ -1 +1,8 @@
//= require jquery.validate
+
+$(function() {
+jQuery.validator.addMethod("emails", function(value, element){
+ return this.optional(element) || /^((, *)*((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)+$/i.test(value);
+ }," Please enter valid email addresses.");
+ $(".invitation_form").validate({errorClass: "validation_error"});
+});
View
5 base/app/assets/javascripts/profiles.js
@@ -2,5 +2,8 @@
//= require jquery.fcbkcomplete
$(function() {
- $(".edit_profile").validate();
+ jQuery.validator.addMethod("phone", function(value, element){
+ return this.optional(element) || /^((\((\+?)\d+\))?|(\+\d+)?)[ ]*-?(\d+[ ]*\-?[ ]*\d*)+$/.test(value);
+ }, " Please enter a valid telephone number");
+ $(".edit_profile").validate({errorClass: "validation_error"});
});
View
5 base/app/assets/stylesheets/base.css.scss
@@ -34,7 +34,7 @@ margin-top: auto; margin-bottom:auto; background-image:none; padding-bottom: 9px
margin-left: auto;
margin-right: auto;
}
-.notice ul, .success ul, .alert ul, .error ul, .validation ul{
+.notice ul, .success ul, .alert ul, .error ul, .validation ul, #error_explanation ul{
margin-left:40px;
}
@@ -108,8 +108,9 @@ button, input[type=submit]{margin: 10px 0 10px 0px;padding: 3px 20px 3px 20px;co
.block .field{ display:inline; padding: 0px; width:50%;}
.block .form_tag{color: $main-color; padding: 5px 5px 5px 5px; border:1px solid $input-border-color; width:90%;}
.block .form_tag_long{color: $main-color; padding: 5px 5px 5px 5px; border:1px solid $input-border-color; width:91%;}
-.block .form_label{display:inline-block; width:25%; font-weight:bold; vertical-align:10%; padding-top:3px;}
+.block .form_label{display:inline-block; width:25%; font-weight:bold; vertical-align:top; padding-top:7px;}
.block .form_field{ display:inline-block; padding: 0px; width:73%;}
+.block #form_select.form_field{ padding: 3px 0px;}
.block .form_row {display: block; padding:5px; padding-left:20px;}
.block .form_sub_row {display: block; padding:5px; padding-left:30px;}
.block .label{ display:inline-block; width:49%; }
View
2  base/app/views/conversations/show.html.erb
@@ -9,7 +9,7 @@
<% toolbar :option => :messages %>
<% content_for :javascript do %>
-$('.cont_conversation').validate();
+$('.cont_conversation').validate({errorClass: "validation_error"});
<% unless @box.eql?'trash' %>
$("#body").cleditor({
width:493,
View
2  base/app/views/conversations/show.js.erb
@@ -2,7 +2,7 @@ $("#content").html("<%= escape_javascript(render :partial => 'show') %>");
<%= toolbar :option => :messages %>
-$('.cont_conversation').validate();
+$('.cont_conversation').validate({errorClass: "validation_error"});
<% unless @box.eql?'trash' %>
$("#body").cleditor({
width:493,
View
2  base/app/views/devise/registrations/edit.html.erb
@@ -7,7 +7,7 @@
<%= devise_error_messages! %>
<% content_for :javascript do %>
- $(".user_edit").validate();
+ $(".user_edit").validate({errorClass: "validation_error"});
<%end%>
<div class="space_center"></div>
View
2  base/app/views/groups/_new.html.erb
@@ -1,6 +1,6 @@
<% content_for :javascript do %>
$(function() {
- $(".new_group").validate();
+ $(".new_group").validate({errorClass: "validation_error"});
});
$("#group__participants").fcbkcomplete({
json_url: "<%= contacts_path(:form => true, :format => :json) %>",
View
5 base/app/views/invitations/_new.html.erb
@@ -1,8 +1,3 @@
-<% content_for :javascript do %>
- $(function() {
- $(".invitation_form").validate();
- });
-<% end %>
<div class="space_center"></div>
View
2  base/app/views/messages/new.html.erb
@@ -31,7 +31,7 @@
$("#_recipients").trigger("addItem",[{"title": "<%= truncate_name @recipient.name %>", "value": "<%= @recipient.id %>"}]);
<% end %>
- $(".new_message").validate();
+ $(".new_message").validate({errorClass: "validation_error"});
<% end %>
View
2  base/app/views/messages/new.js.erb
@@ -25,4 +25,4 @@ var recipients = $("#_recipients").fcbkcomplete({
$("#_recipients").trigger("addItem",[{"title": "<%= @recipient.name %>", "value": "<%= @recipient.id %>"}]);
<% end %>
-$(".new_message").validate();
+$(".new_message").validate({errorClass: "validation_error"});
View
10 base/app/views/profiles/edit.html.erb
@@ -37,7 +37,7 @@ end %>
<% if !params[:section].present? or params[:section].eql?("tags") %>
<% content_for :javascript do %>
$(function() {
- $(".new_group").validate();
+ $(".new_group").validate({errorClass: "validation_error"});
});
$("#profile_actor_attributes_tag_list").fcbkcomplete({
json_url: "<%= tags_path(:format => :json) %>",
@@ -95,7 +95,7 @@ end %>
<div class="form_label">
<%= f.label t('profile.' + current_subject.class.to_s.downcase + '.birthday')%>
</div>
- <div class="form_field">
+ <div class="form_field" id="form_select">
<%= date_select "profile", "birthday", :order => [:day, :month, :year], :end_year=> Date.today.year,
:start_year=> (Date.today.year - 100), :prompt => { :day => 'Day', :month => 'Month', :year => 'Year' } %>
</div>
@@ -119,8 +119,10 @@ end %>
</div>
</div>
- <div class="form_row form_label">
- <%= f.label t('profile.' + current_subject.class.to_s.downcase + '.about') %>
+ <div class="form_row">
+ <div class="form_label">
+ <%= f.label t('profile.' + current_subject.class.to_s.downcase + '.about') %>
+ </div>
</div>
<div class="form_row">
<%= f.text_area :description, :maxlength => 200, :rows => 10, :class => "form_tag_long" %>
Please sign in to comment.
Something went wrong with that request. Please try again.