social_stream 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/Rakefile +0 -12
  2. data/app/controllers/activities_controller.rb +17 -1
  3. data/app/controllers/api_controller.rb +2 -2
  4. data/app/controllers/avatars_controller.rb +44 -0
  5. data/app/controllers/contacts_controller.rb +13 -21
  6. data/app/controllers/conversations_controller.rb +107 -0
  7. data/app/controllers/groups_controller.rb +7 -11
  8. data/app/controllers/messages_controller.rb +21 -88
  9. data/app/controllers/profiles_controller.rb +3 -1
  10. data/app/controllers/pshb_controller.rb +37 -1
  11. data/app/controllers/ties_controller.rb +7 -8
  12. data/app/controllers/users_controller.rb +19 -43
  13. data/app/helpers/location_helper.rb +34 -0
  14. data/app/helpers/subjects_helper.rb +18 -1
  15. data/app/models/activity.rb +67 -27
  16. data/app/models/activity_verb.rb +1 -1
  17. data/app/models/actor.rb +85 -37
  18. data/app/models/avatar.rb +90 -0
  19. data/app/models/group.rb +2 -2
  20. data/app/models/profile.rb +8 -0
  21. data/app/models/tie.rb +20 -22
  22. data/app/models/user.rb +2 -8
  23. data/app/views/activities/_index.html.erb +22 -0
  24. data/app/views/activities/_options.html.erb +3 -1
  25. data/app/views/activities/_root.html.erb +4 -2
  26. data/app/views/activities/_walls.html.erb +34 -0
  27. data/app/views/activities/index.js.erb +1 -0
  28. data/app/views/avatars/_form.html.erb +23 -0
  29. data/app/views/{logos → avatars}/_precrop.html.erb +23 -15
  30. data/app/views/avatars/edit.html.erb +6 -0
  31. data/app/views/avatars/index.html.erb +42 -0
  32. data/app/views/{logos → avatars}/new.html.erb +7 -11
  33. data/app/views/avatars/show.html.erb +5 -0
  34. data/app/views/contacts/_index.html.erb +33 -0
  35. data/app/views/contacts/index.html.erb +35 -2
  36. data/app/views/contacts/index.js.erb +1 -0
  37. data/app/views/conversations/_conversation.html.erb +37 -0
  38. data/app/views/conversations/_conversation_full.html.erb +52 -0
  39. data/app/views/{messages → conversations}/_conversations.html.erb +2 -1
  40. data/app/views/conversations/_index.html.erb +23 -0
  41. data/app/views/{messages → conversations}/_menu_options.html.erb +2 -2
  42. data/app/views/conversations/_show.html.erb +21 -0
  43. data/app/views/{messages → conversations}/edit.html.erb +0 -0
  44. data/app/views/{messages → conversations}/index.html.erb +1 -3
  45. data/app/views/conversations/index.js.erb +7 -0
  46. data/app/views/conversations/show.html.erb +47 -0
  47. data/app/views/conversations/show.js.erb +39 -0
  48. data/app/views/frontpage/_header.html.erb +5 -1
  49. data/app/views/groups/_new.html.erb +50 -48
  50. data/app/views/groups/_sidebar_show.html.erb +1 -1
  51. data/app/views/groups/index.html.erb +1 -1
  52. data/app/views/groups/new.html.erb +6 -1
  53. data/app/views/groups/show.html.erb +1 -3
  54. data/app/views/home/_menu.html.erb +46 -0
  55. data/app/views/home/_sidebar.html.erb +12 -0
  56. data/app/views/home/index.html.erb +3 -3
  57. data/app/views/layouts/application.html.erb +1 -1
  58. data/app/views/layouts/test.html +58 -41
  59. data/app/views/location/_location.html.erb +3 -0
  60. data/app/views/messages/_form.html.erb +5 -52
  61. data/app/views/messages/_message.html.erb +31 -0
  62. data/app/views/messages/_new.html.erb +10 -16
  63. data/app/views/messages/new.html.erb +48 -3
  64. data/app/views/messages/new.js.erb +38 -1
  65. data/app/views/profiles/_profile.html.erb +194 -0
  66. data/app/views/profiles/edit.html.erb +168 -0
  67. data/app/views/profiles/show.html.erb +2 -175
  68. data/app/views/{users → profiles}/update.js.erb +12 -15
  69. data/app/views/subjects/_contacts.html.erb +2 -3
  70. data/app/views/subjects/_toolbar_home.html.erb +1 -1
  71. data/app/views/subjects/_toolbar_home_menu.html.erb +4 -1
  72. data/app/views/subjects/_toolbar_home_menu_options.html.erb +4 -7
  73. data/app/views/subjects/_toolbar_home_menu_options_subjects.html.erb +0 -3
  74. data/app/views/subjects/_toolbar_logo.html.erb +1 -1
  75. data/app/views/subjects/_toolbar_message_menu.html.erb +17 -0
  76. data/app/views/subjects/_toolbar_profile.html.erb +4 -12
  77. data/app/views/subjects/_toolbar_profile_menu.html.erb +9 -10
  78. data/app/views/subjects/_toolbar_profile_menu_basic_options.html.erb +6 -5
  79. data/app/views/subjects/_toolbar_profile_menu_tie_options.html.erb +13 -13
  80. data/app/views/ties/_new.html.erb +30 -25
  81. data/app/views/ties/_suggestions.html.erb +1 -0
  82. data/app/views/ties/new.js.erb +2 -0
  83. data/app/views/users/_index.html.erb +1 -1
  84. data/app/views/users/index.html.erb +1 -3
  85. data/app/views/users/show.html.erb +4 -3
  86. data/config/locales/en.yml +79 -24
  87. data/config/routes.rb +8 -2
  88. data/lib/generators/social_stream/install_generator.rb +1 -1
  89. data/lib/generators/social_stream/templates/migration.rb +17 -11
  90. data/lib/generators/social_stream/templates/public/images/btn/message_conversation.png +0 -0
  91. data/lib/generators/social_stream/templates/public/images/btn/message_inbox.png +0 -0
  92. data/lib/generators/social_stream/templates/public/images/btn/message_new.png +0 -0
  93. data/lib/generators/social_stream/templates/public/images/btn/message_sentbox.png +0 -0
  94. data/lib/generators/social_stream/templates/public/images/btn/message_trash.png +0 -0
  95. data/lib/generators/social_stream/templates/public/javascripts/ajax.paginate.js +1 -1
  96. data/lib/generators/social_stream/templates/public/javascripts/menu.js +9 -99
  97. data/lib/generators/social_stream/templates/public/stylesheets/default/base.css +14 -5
  98. data/lib/generators/social_stream/templates/public/stylesheets/default/home.css +1 -0
  99. data/lib/generators/social_stream/templates/public/stylesheets/default/jquery-ui.css +13 -10
  100. data/lib/generators/social_stream/templates/public/stylesheets/default/menu.css +5 -11
  101. data/lib/generators/social_stream/templates/public/stylesheets/default/messages.css +96 -20
  102. data/lib/generators/social_stream/templates/relations.yml +1 -0
  103. data/lib/paperclip/social_stream.rb +1 -1
  104. data/lib/social_stream/ability.rb +1 -0
  105. data/lib/social_stream/controllers/helpers.rb +20 -0
  106. data/lib/social_stream/models/subject.rb +13 -12
  107. data/lib/social_stream/rails.rb +4 -1
  108. data/lib/social_stream/version.rb +1 -1
  109. data/lib/tasks/db/populate.rake +14 -4
  110. data/social_stream.gemspec +31 -5
  111. data/spec/controllers/contacts_controller_spec.rb +6 -0
  112. data/spec/controllers/profiles_controller_spec.rb +3 -4
  113. data/spec/dummy/config/initializers/devise.rb +4 -1
  114. data/spec/dummy/config/relations.yml +1 -0
  115. data/spec/models/activity_spec.rb +24 -0
  116. metadata +91 -89
  117. data/app/controllers/logos_controller.rb +0 -37
  118. data/app/models/logo.rb +0 -88
  119. data/app/views/activities/_activities.html.erb +0 -46
  120. data/app/views/groups/_profile.html.erb +0 -142
  121. data/app/views/groups/edit.html.erb +0 -135
  122. data/app/views/groups/update.js.erb +0 -39
  123. data/app/views/logos/_form.html.erb +0 -33
  124. data/app/views/logos/edit.html.erb +0 -6
  125. data/app/views/logos/index.html.erb +0 -27
  126. data/app/views/logos/show.html.erb +0 -5
  127. data/app/views/menu/_group.html.erb +0 -15
  128. data/app/views/menu/_home_user.html.erb +0 -0
  129. data/app/views/menu/_optionsGroups.html.erb +0 -11
  130. data/app/views/menu/_optionsUser.html.erb +0 -11
  131. data/app/views/menu/_services.html.erb +0 -11
  132. data/app/views/menu/_tiesGroup.html.erb +0 -14
  133. data/app/views/menu/_tiesUser.html.erb +0 -11
  134. data/app/views/menu/_user.html.erb +0 -15
  135. data/app/views/messages/_conversation.html.erb +0 -34
  136. data/app/views/messages/_conversation_full.html.erb +0 -65
  137. data/app/views/messages/_index.html.erb +0 -19
  138. data/app/views/messages/_location.html.erb +0 -3
  139. data/app/views/messages/_show.html.erb +0 -22
  140. data/app/views/messages/index.js.erb +0 -1
  141. data/app/views/messages/show.html.erb +0 -10
  142. data/app/views/messages/show.js.erb +0 -1
  143. data/app/views/users/_profile.html.erb +0 -171
  144. data/app/views/users/_sidebar_show.html.erb +0 -1
  145. data/app/views/users/edit.html.erb +0 -194
@@ -3,18 +3,14 @@
3
3
  <%= stylesheet_link_tag "jquery.Jcrop", :media => "screen, projection" %>
4
4
  <%= stylesheet_link_tag "logos", :media => "screen, projection" %>
5
5
  <%end%>
6
- <h1>Create a new logo</h1>
7
- <% if current_subject.blank? %>
8
- LOGUEATE
9
- <% else %>
10
-
11
- <% if !@logo.logo.errors['precrop'].blank? %>
6
+ <% toolbar :profile => current_subject %>
7
+ <div id="content_logo">
8
+ <% if !@avatar.logo.errors['precrop'].blank? %>
9
+ <h1><%= t('avatar.crop_image') %></h1>
12
10
  <%= render :partial => 'precrop' %>
13
11
  <% else %>
12
+ <h1><%= t('avatar.new') %></h1>
14
13
  <%= render :partial => 'form' %>
15
14
  <% end %>
16
-
17
- <%= link_to 'Back', logos_path %>
18
-
19
-
20
- <% end %>
15
+ </div>
16
+ <% link_to 'Back', avatars_path %>
@@ -0,0 +1,5 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+
4
+ <%= link_to 'Edit', edit_avatar_path(@avatar) %> |
5
+ <%= link_to 'Back', avatars_path %>
@@ -0,0 +1,33 @@
1
+ <% cont=0; %>
2
+
3
+ <% @contacts.each do |contact| %>
4
+
5
+ <% if (cont%2) == 0 %>
6
+ <% cont+=1; %>
7
+ <div class="row">
8
+ <% end %>
9
+
10
+ <div class="label">
11
+ <div class="logo">
12
+ <%= link_to image_tag(contact.logo.url , :size => "50x50", :alt => contact.name), contact %>
13
+ </div>
14
+ <div class="sub-block">
15
+ <div class="name black" >
16
+ <%=link_to(contact.name, contact)%>
17
+ </div>
18
+ <div class="link">
19
+ <%= ties_to(contact) %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+
25
+ <% if ((cont%2) != 0) %>
26
+ <div class="label">
27
+ </div>
28
+ </div>
29
+ <% end %>
30
+
31
+ <div class="row">
32
+ <%= will_paginate @contacts %>
33
+ </div>
@@ -1,2 +1,35 @@
1
- <h1>Contacts#index</h1>
2
- <p>Find me in app/views/contacts/index.html.erb</p>
1
+ <% content_for :headers do %>
2
+ <%= javascript_include_tag 'jquery.ba-url','ajax.paginate' %>
3
+ <% end %>
4
+
5
+ <% toolbar %>
6
+
7
+ <div id="my_conferences">
8
+ <div id="contacts" class="block">
9
+ <div class="search_field_wrapper">
10
+ <input type="text" value="Search by name" id="search_field" class="search_input" />
11
+ <%= image_tag("btn/search.png",:size=>"20x20",:id=>"search_button") %>
12
+ </div>
13
+ <div class="space_center"></div>
14
+ <div class="row" >
15
+ <div class="center">
16
+ <%= link_to t('contact.all_n', :count => current_subject.contacts(:direction => :sent).count), contacts_path %> -
17
+ <% Actor.distinct_initials.
18
+ contacted_from(current_subject).
19
+ merge(Tie.original.related_by(current_subject.relations.find_by_id(params[:relation]))).
20
+ distinct_initials.
21
+ each do |l| %>
22
+ <%= link_to l.initial,{:letter => l.initial,:page => 1},:class => "contact_letter_link" %>
23
+ <% end %>
24
+ </div>
25
+ </div>
26
+ <div class="space_center"></div>
27
+ <div id="list_contacts_ajax" class="tab_content block">
28
+ <%= render :partial => "contacts/index"%>
29
+ </div>
30
+ <div class="space_center"></div>
31
+ </div>
32
+ </div>
33
+
34
+
35
+ <div class="space_center"></div>
@@ -0,0 +1 @@
1
+ $('#list_contacts_ajax').html("<%= escape_javascript(render :partial => "contacts/index") %>");
@@ -0,0 +1,37 @@
1
+ <%= div_for(conversation, :class => read_class) do %>
2
+ <div class="notification">
3
+ </div>
4
+ <div class="sender_photo">
5
+ <%= link_to image_tag(conversation.last_sender.logo.url(:actor),
6
+ :title => conversation.last_sender.name, :alt => conversation.last_sender.name),
7
+ conversation.last_sender.subject %>
8
+ </div>
9
+ <div class="content_left">
10
+ <div class="sender_name">
11
+ <%= link_to conversation.last_sender.name, conversation.last_sender.subject %>
12
+ </div>
13
+ <div class="date">
14
+ <%= t('time.ago', :time => time_ago_in_words(conversation.updated_at)) %>
15
+ </div>
16
+ </div>
17
+ <div class="content_right">
18
+ <div class="subject">
19
+ <%= link_to(truncate(conversation.subject, :length => 55), conversation_path(conversation.id,:box => @box,:page => params[:page])) %>
20
+ </div>
21
+ <div class="briefing">
22
+ <%= raw(truncate(strip_tags(conversation.last_message.body), :length => 50)) %>
23
+ </div>
24
+ <div class="clearfloat">
25
+ </div>
26
+ </div>
27
+ <% unless @box.eql?'trash' %>
28
+ <div class="action">
29
+ <%= link_to(image_tag('btn/btn_delete.png', :atl => "Delete", :title => "Delete"),
30
+ conversation_path(conversation, :location => @box, :box => @box, :page => params[:page]),
31
+ :confirm => 'Do you want to move "' + conversation.subject + '" to trash?',
32
+ :method => :delete, :remote => true) %>
33
+ </div>
34
+ <% end %>
35
+ <div class="clearfloat">
36
+ </div>
37
+ <% end %>
@@ -0,0 +1,52 @@
1
+ <div class="title">
2
+ <h2><%= conversation.subject %></h2>
3
+ </div>
4
+ <div class="action">
5
+ <% unless @box.eql?'trash' %><%= link_to ( image_tag('btn/btn_delete.png', :atl => "Delete", :title => "Delete"),
6
+ conversation_path(conversation, :location => 'conversation', :box => @box),
7
+ :confirm => 'Do you want to move "' + conversation.subject + '" to trash?',
8
+ :method => :delete, :remote => true) %><% end %>
9
+ </div>
10
+ <div class="clearfloat">
11
+ </div>
12
+ <div class="participants">
13
+ <% conversation.recipients.each do |recp| %>
14
+ <%= link_to image_tag(recp.logo.url(:tie), :title=>recp.name, :alt => recp.name), recp.subject %>
15
+ <% end %>
16
+ </div>
17
+ <div class="messages">
18
+ <% @receipts.each do |receipt| %>
19
+ <% message = receipt.message %>
20
+ <% read_class = message.is_unread?(@actor) ? 'unread' : '' %>
21
+ <%= render :partial => "messages/message",:object => message, :locals => {:read_class => read_class} %>
22
+ <% end %>
23
+
24
+ <% unless @box.eql?'trash' %>
25
+ <br>
26
+ <%= form_tag conversation_path(conversation.id), :method => :put, :class => "cont_conversation" do %>
27
+ <% if @receipt and @receipt.errors.any? %>
28
+ <div class="error">
29
+ <h2><%= pluralize(@receipt.errors.count, "error") %> prohibited this message from being sent:</h2>
30
+ <ul>
31
+ <% @receipt.errors.full_messages.each do |msg| %>
32
+ <li>
33
+ <%= msg %>
34
+ </li>
35
+ <% end %>
36
+ </ul>
37
+ </div>
38
+ <% end %>
39
+ <div class="block">
40
+ <div class="form_row">
41
+ Write your answer:
42
+ </div>
43
+ <div class="form_row">
44
+ <%= text_area_tag :body, nil,:rows =>6, :cols=> 53, :class => "required form_tag" %>
45
+ </div>
46
+ <div class="actions center">
47
+ <%= submit_tag "Reply", :name => :reply_all,:class => "button" %>
48
+ </div>
49
+ </div>
50
+ <% end %>
51
+ <%end %>
52
+ </div>
@@ -1,4 +1,5 @@
1
1
  <% @conversations.each do |conversation| %>
2
- <%= render :partial => 'conversation', :object => conversation, :locals => {:active => cycle("active","inactive")} %>
2
+ <% read_class = conversation.is_unread?(@actor) ? 'unread' : '' %>
3
+ <%= render :partial => 'conversation', :object => conversation, :locals => {:read_class => read_class} %>
3
4
  <% end %>
4
5
  <%= will_paginate @conversations %>
@@ -0,0 +1,23 @@
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "messages.css", :media => "screen, projection" %>
3
+ <% end %>
4
+
5
+ <%= location(
6
+ link_to(image_tag("btn/message_" + @box + ".png", :class => "menu_icon")+t('message.' + @box), conversations_path(:box => @box),:remote => true)
7
+ ) %>
8
+
9
+
10
+ <% content_for :javascript do %>
11
+ $('.pagination a').attr('data-remote', 'true');
12
+ <% end %>
13
+
14
+ <br class="clearfloat" />
15
+ <div class="space_center">
16
+ </div>
17
+ <div class="space_center"></div>
18
+
19
+
20
+ <h2><%= t('message.' + @box) %></h2>
21
+ <div class="conversations">
22
+ <%= render :partial => 'conversations' %>
23
+ </div>
@@ -1,5 +1,5 @@
1
1
  <li>
2
- <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('message.other'), messages_path) %>
2
+ <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('message.other'), messages_path, :remote => :true) %>
3
3
  </li>
4
4
  <li>
5
5
  <ul>
@@ -7,7 +7,7 @@
7
7
  <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+ t('message.new'), new_message_path) %>
8
8
  </li>
9
9
  <li>
10
- <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('message.inbox')+" (" + @mailbox.inbox(:unread => true).count.to_s + ")", messages_path, :remote => true) %>
10
+ <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('message.inbox')+" (" + @mailbox.inbox(:unread => true).count.to_s + ")", messages_path, :remote => :true) %>
11
11
  </li>
12
12
  <li>
13
13
  <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('message.sentbox'), messages_path(:box => :sentbox), :remote => true) %>
@@ -0,0 +1,21 @@
1
+
2
+
3
+ <%= location(
4
+ link_to(image_tag("btn/message_" + @box + ".png", :class => "menu_icon")+t('message.' + @box), conversations_path(:box => @box),:remote => true),
5
+ link_to(image_tag("btn/message_conversation.png", :class => "menu_icon")+ truncate(@conversation.subject, :length => 45), conversation_path(@conversation.id,:box => @box,:page => params[:page]))
6
+ ) %>
7
+ <br class="clearfloat" />
8
+ <div class="space_center">
9
+ </div>
10
+ <div id="new_message">
11
+ <% if @box.present? %>
12
+ <%= link_to 'Back', conversations_path(:box => @box, :page => params[:page]), :remote => true %>
13
+ <% else %>
14
+ <%= link_to 'Back', conversations_path(:page => params[:page]), :remote => true %>
15
+ <% end %>
16
+ </div>
17
+ <div class="space_center">
18
+ </div>
19
+ <div class="conversation_full">
20
+ <%= render :partial => 'conversation_full', :locals =>{:conversation => @conversation} %>
21
+ </div>
File without changes
@@ -2,8 +2,6 @@
2
2
  <%= render :partial => 'home/sidebar' %>
3
3
  <% end %>
4
4
 
5
- <% toolbar :option => :messages do %>
6
- <%= render :partial => 'menu_options' %>
7
- <% end %>
5
+ <% toolbar %>
8
6
 
9
7
  <%= render :partial => 'index' %>
@@ -0,0 +1,7 @@
1
+ $("#content").html("<%=escape_javascript(render :partial => 'index') %>");
2
+
3
+ $('.pagination a').attr('data-remote', 'true');
4
+
5
+
6
+ $("head").append($("<%= escape_javascript(stylesheet_link_tag "messages.css", :media => "screen, projection") %>"));
7
+
@@ -0,0 +1,47 @@
1
+ <% content_for :sidebar do %>
2
+ <%= render :partial => 'home/sidebar' %>
3
+ <% end %>
4
+
5
+ <% toolbar %>
6
+
7
+ <% content_for :headers do %>
8
+ <%= stylesheet_link_tag "messages.css", :media => "screen, projection" %>
9
+ <%= javascript_include_tag 'ckeditor/ckeditor.js','ckeditor/adapters/jquery.js','jquery.scrollTo.min.js', 'jquery.validate' %>
10
+ <% end %>
11
+
12
+ <% content_for :javascript do %>
13
+ $('.cont_conversation').validate();
14
+ <% unless @box.eql?'trash' %>
15
+ $('#body').ckeditor(
16
+ function(){
17
+ $('#cke_top_body').click(updateTextArea);
18
+ var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
19
+ if (message_hash && message_hash.length > 0){
20
+ $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
21
+ }else{
22
+ $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
23
+ }}
24
+ ,{ width:525 }
25
+ );
26
+ var editor = $('#body').ckeditorGet();
27
+ editor.on("instanceReady", function(){
28
+ this.document.on("keyup", updateTextArea);
29
+ this.document.on("paste", updateTextArea);
30
+ this.document.on("mousedown", updateTextArea);
31
+ });
32
+
33
+ var updateTextArea = function (){
34
+ editor.updateElement();
35
+ $("#body").trigger('keyup');
36
+ }
37
+ <% else %>
38
+ var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
39
+ if (message_hash && message_hash > 0){
40
+ $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
41
+ }else{
42
+ $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
43
+ }
44
+ <% end %>
45
+ <% end %>
46
+
47
+ <%= render :partial => 'show' %>
@@ -0,0 +1,39 @@
1
+ $("#content").html("<%= escape_javascript(render :partial => 'show') %>");
2
+
3
+ $("head").append($("<%= escape_javascript(stylesheet_link_tag "messages.css", :media => "screen, projection") %>"));
4
+
5
+ $("head").append($("<%= escape_javascript(javascript_include_tag 'ckeditor/ckeditor.js','ckeditor/adapters/jquery.js','jquery.scrollTo.min.js', 'jquery.validate') %>"));
6
+
7
+ $('.cont_conversation').validate();
8
+ <% unless @box.eql?'trash' %>
9
+ $('#body').ckeditor(
10
+ function(){$('#cke_top_body').click( updateTextArea);
11
+ var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
12
+ if (message_hash && message_hash.length > 0){
13
+ $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
14
+ }else{
15
+ $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
16
+ }
17
+ },
18
+ { width:525, customConfig:'/javascripts/ckeditor/config.js',skin:'../javascripts/ckeditor/skins/kama'}
19
+ );
20
+ var editor = $('#body').ckeditorGet();
21
+ editor.on("instanceReady", function(){
22
+ this.document.on("keyup", updateTextArea);
23
+ this.document.on("paste", updateTextArea);
24
+ this.document.on("mousedown", updateTextArea);
25
+ }
26
+ );
27
+
28
+ var updateTextArea = function (){
29
+ editor.updateElement();
30
+ $("#body").trigger('keyup');
31
+ }
32
+ <% else %>
33
+ var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
34
+ if (message_hash && message_hash.length > 0){
35
+ $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
36
+ }else{
37
+ $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
38
+ }
39
+ <% end %>
@@ -10,9 +10,13 @@
10
10
  <%= f.submit t(:sign_in), :class => 'other_blue'%>
11
11
  <% end -%>
12
12
  <div class="subtexto">
13
- <%= link_to t('sign_in'), new_user_registration_path, :class => "register_link" %>
13
+ <%= link_to t('sign_up'), new_user_registration_path, :class => "register_link" %>
14
14
  <span>|</span>
15
15
  <%= link_to t('forgot_password'), new_user_password_path, :class => "register_link" %>
16
+ <span>|</span>
17
+ <%= link_to image_tag('/images/btn/facebook.png'), user_omniauth_authorize_path(:facebook), :class => "menu_icon" %>
18
+
19
+ <%= link_to image_tag('/images/btn/linkedin.png'), user_omniauth_authorize_path(:linked_in), :class => "menu_icon" %>
16
20
  </div>
17
21
  </div>
18
22
  <br class="clearfloat" />
@@ -4,61 +4,63 @@
4
4
  <% end %>
5
5
 
6
6
  <% content_for :javascript do %>
7
- $(function() {
8
- $(".new_group").validate();
9
- });
10
- $("#group__participants").fcbkcomplete({
11
- json_url: "../contacts/index.json",
12
- cache: true,
13
- filter_case: true,
14
- filter_hide: true,
15
- newel: false,
16
- height: 6
17
- });
7
+ $(function() {
8
+ $(".new_group").validate();
9
+ });
10
+ $("#group__participants").fcbkcomplete({
11
+ json_url: "<%= contacts_path(:format => :json) %>",
12
+ cache: true,
13
+ filter_case: true,
14
+ filter_hide: true,
15
+ newel: false,
16
+ height: 6
17
+ });
18
18
  <% end %>
19
19
 
20
20
  <%= form_for @group do |f| %>
21
- <% f.object._founder = current_subject.slug %>
22
- <%= f.hidden_field :_founder %>
21
+ <% f.object._founder = current_subject.slug %>
22
+ <%= f.hidden_field :_founder %>
23
23
 
24
- <% if @group.errors.any? %>
25
- <div id="notice">
26
- <h2><%= pluralize(@group.errors.count, "error") %> prohibited this group from being saved:</h2>
27
- <ul>
28
- <% @group.errors.full_messages.each do |msg| %>
29
- <li>
30
- <%= msg %>
31
- </li>
32
- <% end %>
33
- </ul>
34
- </div>
35
- <% end %>
36
- <div class="block">
37
- <div class="form_row">
38
- <div class="form_label">
39
- <%= f.label t('group.new.name') %>
24
+ <% if @group.errors.any? %>
25
+ <div id="notice">
26
+ <h2><%= pluralize(@group.errors.count, "error") %> prohibited this group from being saved:</h2>
27
+ <ul>
28
+ <% @group.errors.full_messages.each do |msg| %>
29
+ <li>
30
+ <%= msg %>
31
+ </li>
32
+ <% end %>
33
+ </ul>
40
34
  </div>
41
- <div class="form_field">
42
- <%= f.text_field :name, :class => "required form_tag" %>
35
+ <% end %>
36
+ <div class="block">
37
+ <div class="form_row center">
38
+ <h2><%= t('group.new.action') %></h2>
39
+ </div>
40
+ <div class="form_row">
41
+ <div class="form_label">
42
+ <%= f.label t('group.new.name') %>
43
+ </div>
44
+ <div class="form_field">
45
+ <%= f.text_field :name, :class => "required form_tag" %>
46
+ </div>
43
47
  </div>
44
- </div>
45
- <div class="form_row">
46
- <div class="form_label">
47
- <%= f.label t('group.new.participants') %>
48
+ <div class="form_row">
49
+ <div class="form_label">
50
+ <%= f.label t('group.new.participants') %>
51
+ </div>
52
+ <div class="form_field">
53
+ <%= f.select :_participants, [], :class => "form_tag" %>
54
+ </div>
48
55
  </div>
49
- <div class="form_field">
50
- <%= f.select :_participants, [], :class => "form_tag" %>
56
+ <div class="form_row form_label">
57
+ <%= f.label :description %>
58
+ </div>
59
+ <div class="form_row">
60
+ <%= f.text_area :description, :rows =>6, :cols=> 53, :class => "form_tag" %>
61
+ </div>
62
+ <div class="actions center">
63
+ <%= f.submit :class => "button" %>
51
64
  </div>
52
65
  </div>
53
- <div class="form_row form_label">
54
-
55
- <%= f.label :description %>
56
- </div>
57
- <div class="form_row">
58
- <%= f.text_area :description, :rows =>6, :cols=> 53, :class => "form_tag" %>
59
- </div>
60
- <div class="actions center">
61
- <%= f.submit :class => "button" %>
62
- </div>
63
- </div>
64
66
  <% end %>