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
@@ -7,5 +7,5 @@
7
7
  <%= render :partial => 'ties/pendings' %>
8
8
  <% end %>
9
9
 
10
- <%= render :partial => 'groups/profile' %>
10
+
11
11
 
@@ -1,7 +1,7 @@
1
1
  <% content_for :headers do -%>
2
+ <%= javascript_include_tag 'jqcloud-0.1.3.min','jquery.ba-url','ajax.paginate' %>
2
3
  <%= stylesheet_link_tag 'smoothness/jquery-ui-1.8.4.custom' %>
3
4
  <% end -%>
4
- <% javascript_include_tag 'jqcloud-0.1.3.min','ajax.paginate','jquery.min.js' %>
5
5
 
6
6
  <% toolbar if user_signed_in? %>
7
7
 
@@ -1,3 +1,8 @@
1
- <% toolbar :option => :groups %>
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "fcbkComplete.css", :media => "screen, projection" %>
3
+ <%= javascript_include_tag 'jquery.fcbkcomplete.min', 'jquery.validate' %>
4
+ <% end %>
5
+
6
+ <% toolbar%>
2
7
 
3
8
  <%= render :partial => 'new' %>
@@ -13,6 +13,4 @@
13
13
  <div class="space_center">
14
14
  </div>
15
15
 
16
- <%= render :partial => "activities/activities",
17
- :locals => { :activities => @group.profile_wall(current_subject),
18
- :owner => @group } %>
16
+ <%= render :partial => 'activities/walls', :locals => { :owner => @group } %>
@@ -0,0 +1,46 @@
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "menu", :media => "screen, projection" %>
3
+ <%= javascript_include_tag 'menu' %>
4
+ <% end %>
5
+
6
+ <ul id="menu">
7
+ <li>
8
+ <a href="#">Weblog Tools</a>
9
+ <ul>
10
+ <li><a href="http://www.pivotx.net/">PivotX</a></li>
11
+ <li><a href="http://www.wordpress.org/">WordPress</a></li>
12
+ <li><a href="http://www.textpattern.com/">Textpattern</a></li>
13
+ <li><a href="http://typosphere.org/">Typo</a></li>
14
+ </ul>
15
+ </li>
16
+ <li>
17
+ <a href="#">Programming Languages</a>
18
+ <ul>
19
+ <li><a href="http://www.php.net/">PHP</a></li>
20
+ <li><a href="http://www.ruby-lang.org/en/">Ruby</a></li>
21
+ <li><a href="http://www.python.org/">Python</a></li>
22
+ <li><a href="http://www.perl.org/">PERL</a></li>
23
+ <li><a href="http://java.sun.com/">Java</a></li>
24
+ <li><a href="http://en.wikipedia.org/wiki/C_Sharp">C#</a></li>
25
+ </ul>
26
+ </li>
27
+ <li><a href="http://www.i-marco.nl/weblog/">Marco's blog (no submenu)</a></li>
28
+ <li>
29
+ <a href="#">Cool Stuff</a>
30
+ <ul>
31
+ <li><a href="http://www.apple.com/">Apple</a></li>
32
+ <li><a href="http://www.nikon.com/">Nikon</a></li>
33
+ <li><a href="http://www.xbox.com/en-US/">XBOX360</a></li>
34
+ <li><a href="http://www.nintendo.com/">Nintendo</a></li>
35
+ </ul>
36
+ </li>
37
+ <li>
38
+ <a href="#">Search Engines</a>
39
+ <ul>
40
+ <li><a href="http://search.yahoo.com/">Yahoo!</a></li>
41
+ <li><a href="http://www.google.com/">Google</a></li>
42
+ <li><a href="http://www.ask.com/">Ask.com</a></li>
43
+ <li><a href="http://www.live.com/?searchonly=true">Live Search</a></li>
44
+ </ul>
45
+ </li>
46
+ </ul>
@@ -2,3 +2,15 @@
2
2
  <%= render :partial => "ties/suggestions" %>
3
3
  <div class="space_center"></div>
4
4
  <%= render :partial => 'ties/pendings' %>
5
+
6
+ <% content_for :javascript do %>
7
+
8
+ $(".suggestions .tie_close").livequery("click",function(){
9
+ temp = $(this);
10
+ $.get("<%=suggestion_ties_path%>", function(data) {
11
+ temp.parents(".tie").replaceWith(data);
12
+ });
13
+
14
+ });
15
+
16
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :sidebar do %>
2
- <%= render :partial => 'sidebar' %>
2
+ <% render :partial => 'sidebar' %>
3
3
  <% end %>
4
4
 
5
5
  <% toolbar %>
@@ -16,6 +16,6 @@
16
16
  </div>
17
17
  <% end %>
18
18
 
19
- <%= render :partial => "activities/activities",
20
- :locals => { :activities => current_subject.home_wall,
19
+ <%= render :partial => "activities/index",
20
+ :locals => { :activities => current_subject.wall(:home).paginate(:page => params[:page]),
21
21
  :owner => current_subject } %>
@@ -5,7 +5,7 @@
5
5
  <title><%= yield(:title) || t('socialstream') %></title>
6
6
  <%= stylesheet_link_tag "base", "header","home","footer",
7
7
  :media => "screen, projection" %>
8
- <%= javascript_include_tag 'jquery.min', 'jquery-ui.min','rails', 'jquery.livequery', 'menu', 'ui.dropdownchecklist'%>
8
+ <%= javascript_include_tag 'jquery.min', 'jquery-ui.min','rails', 'jquery.livequery', 'ui.dropdownchecklist'%>
9
9
 
10
10
  <%= yield :headers %>
11
11
 
@@ -1,44 +1,61 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
- <html lang="en">
3
- <head><title>100% Height CSS Layout</title>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <style type="text/css">
6
- * {
7
- padding: 0;
8
- margin: 0;
9
- }
10
- html, body {
11
- height: 100%;
12
- }
13
- body {
14
- font-family: "lucida sans", verdana, arial, helvetica, sans-serif;
15
- font-size: 75%;
16
- }
17
- h1 {
18
- font-size: 1.4em;
19
- padding: 10px 10px 0;
20
- }
21
- p {
22
- padding: 0 10px 1em;
23
- }
24
- #container {
25
- min-height: 100%;
26
- background-color: #DDD;
27
- border-left: 2px solid #666;
28
- border-right: 2px solid #666;
29
- width: 676px;
30
- margin: 0 auto;
31
- }
32
- * html #container {
33
- height: 100%;
34
- }</style>
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-EN">
3
+ <head>
4
+ <script src="jquery-1.2.1.min.js" type="text/javascript"></script>
5
+ <script src="menu.js" type="text/javascript"></script>
6
+ <link rel="stylesheet" type="text/css" href="style.css" />
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
8
+ <title>Simple JQuery Accordion menu</title>
9
+ <!--[if lt IE 8]>
10
+ <style type="text/css">
11
+ li a {display:inline-block;}
12
+ li a {display:block;}
13
+ </style>
14
+ <![endif]-->
35
15
  </head>
36
16
  <body>
37
- <div id="container">
38
- <h1>100% Height Demo</h1>
39
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque tempor. Nam in libero vel nisi accumsan euismod. Quisque quis neque. Donec condimentum, enim convallis vestibulum varius, quam mi accumsan diam, sollicitudin ultricies odio ante vitae purus. Etiam ultricies quam. Vestibulum turpis turpis, fermentum ut, accumsan quis, tempor at, ipsum. Nam felis elit, sollicitudin id, ultrices faucibus, fringilla vel, dui. Aliquam tincidunt iaculis eros. Sed in lorem. Nullam eu enim. Quisque tristique pretium diam. Fusce tempor sollicitudin ligula. Donec purus eros, mattis quis, mattis vestibulum, congue quis, felis. Nulla facilisi. Nam ultricies posuere justo. In feugiat.</p>
40
- <p>Ut lacus neque, interdum in, nonummy ac, placerat a, lorem. In interdum vulputate lectus. Aenean libero elit, eleifend id, tincidunt id, tristique eu, tortor. Pellentesque urna dolor, placerat a, pharetra eget, congue ut, ligula. Sed mi. Nunc volutpat. Donec pharetra accumsan lacus. Integer pede orci, vehicula vitae, porttitor id, pulvinar vel, nisi. Aliquam mauris ligula, eleifend sit amet, eleifend sit amet, luctus at, turpis. Sed neque orci, tincidunt id, tempus condimentum, eleifend a, nisl. Etiam auctor. Donec lectus lacus, consequat ac, ultrices venenatis, imperdiet vel, erat. In porttitor augue at tellus commodo pharetra.</p>
41
- <p>Sed non nibh. Sed sapien ipsum, fringilla condimentum, consectetuer vitae, convallis eu, urna. Aenean id elit eu nulla aliquet congue. Sed fringilla nonummy nisi. Donec aliquet. Quisque varius. Vivamus ut nulla. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer lacinia. In leo nulla, molestie ac, dignissim sed, pulvinar at, odio. Duis sit amet augue.</p>
42
- </div>
17
+
18
+ <ul id="menu">
19
+ <li>
20
+ <a href="#">Weblog Tools</a>
21
+ <ul>
22
+ <li><a href="http://www.pivotx.net/">PivotX</a></li>
23
+ <li><a href="http://www.wordpress.org/">WordPress</a></li>
24
+ <li><a href="http://www.textpattern.com/">Textpattern</a></li>
25
+ <li><a href="http://typosphere.org/">Typo</a></li>
26
+ </ul>
27
+ </li>
28
+ <li>
29
+ <a href="#">Programming Languages</a>
30
+ <ul>
31
+ <li><a href="http://www.php.net/">PHP</a></li>
32
+ <li><a href="http://www.ruby-lang.org/en/">Ruby</a></li>
33
+ <li><a href="http://www.python.org/">Python</a></li>
34
+ <li><a href="http://www.perl.org/">PERL</a></li>
35
+ <li><a href="http://java.sun.com/">Java</a></li>
36
+ <li><a href="http://en.wikipedia.org/wiki/C_Sharp">C#</a></li>
37
+ </ul>
38
+ </li>
39
+ <li><a href="http://www.i-marco.nl/weblog/">Marco's blog (no submenu)</a></li>
40
+ <li>
41
+ <a href="#">Cool Stuff</a>
42
+ <ul>
43
+ <li><a href="http://www.apple.com/">Apple</a></li>
44
+ <li><a href="http://www.nikon.com/">Nikon</a></li>
45
+ <li><a href="http://www.xbox.com/en-US/">XBOX360</a></li>
46
+ <li><a href="http://www.nintendo.com/">Nintendo</a></li>
47
+ </ul>
48
+ </li>
49
+ <li>
50
+ <a href="#">Search Engines</a>
51
+ <ul>
52
+ <li><a href="http://search.yahoo.com/">Yahoo!</a></li>
53
+ <li><a href="http://www.google.com/">Google</a></li>
54
+ <li><a href="http://www.ask.com/">Ask.com</a></li>
55
+ <li><a href="http://www.live.com/?searchonly=true">Live Search</a></li>
56
+ </ul>
57
+ </li>
58
+ </ul>
59
+
43
60
  </body>
44
- </html>
61
+ </html>
@@ -0,0 +1,3 @@
1
+ <div id="map_location" class="content_size">
2
+ <%= raw(location_body) %>
3
+ </div>
@@ -1,57 +1,10 @@
1
- <% content_for :headers do %>
2
- <%= stylesheet_link_tag "fcbkComplete.css", :media => "screen, projection" %>
3
- <%= javascript_include_tag 'jquery.fcbkcomplete.min','jquery.validate','ckeditor/ckeditor.js','ckeditor/adapters/jquery.js' %>
4
- <% end %>
5
-
6
- <% content_for :javascript do %>
7
-
8
- var recipients = $("#_recipients").fcbkcomplete({
9
- json_url: "../../contacts/index.json",
10
- cache: true,
11
- filter_case: true,
12
- filter_hide: true,
13
- newel: false,
14
- height: 6
15
- });
16
-
17
-
18
- $('#body').ckeditor(
19
- function(){
20
- $('#cke_top_body').click( updateTextArea);
21
- },
22
- { width:493 }
23
- );
24
-
25
- var editor = $('#body').ckeditorGet();
26
-
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
-
38
-
39
- <% unless @recipient.nil? %>
40
- $("#_recipients").trigger("addItem",[{"title": "<%= @recipient.name %>", "value": "<%= @recipient.id %>"}]);
41
- <% end %>
42
-
43
- $(".new_message").validate();
44
-
45
- <% end %>
46
-
47
-
48
1
  <h2>New Message</h2>
49
2
  <%= form_tag messages_path, :method => :post , :class => "new_message" do %>
50
- <% if @conversation and @conversation.errors.any? %>
51
- <div id="notice">
52
- <h2><%= pluralize(@conversation.errors.count, "error") %> prohibited this message from being sent:</h2>
3
+ <% if @receipt and @receipt.errors.any? %>
4
+ <div class="error">
5
+ <h2><%= pluralize(@receipt.errors.count, "error") %> prohibited this message from being sent:</h2>
53
6
  <ul>
54
- <% @conversation.errors.full_messages.each do |msg| %>
7
+ <% @receipt.errors.full_messages.each do |msg| %>
55
8
  <li>
56
9
  <%= msg %>
57
10
  </li>
@@ -83,4 +36,4 @@
83
36
  <%= submit_tag "Send Message", :name => :send_message, :class => "button" %>
84
37
  </div>
85
38
  </div>
86
- <% end %>
39
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <%= div_for(message, :class => read_class) do%>
2
+ <div class="sender_photo">
3
+ <%= link_to image_tag(message.sender.logo.url(:actor),
4
+ :title => message.sender.name, :alt => message.sender.name),
5
+ message.sender.subject %>
6
+ </div>
7
+ <div class="container">
8
+ <div class="header">
9
+ <div class="content_left">
10
+ <div class="sender_name">
11
+ <%= link_to message.sender.name, message.sender.subject %>
12
+ </div>
13
+ <div class="date">
14
+ <%= t('time.ago', :time => time_ago_in_words(message.updated_at)) %>
15
+ </div>
16
+ </div>
17
+ <div class="content_right">
18
+ <div class="subject">
19
+ <%= truncate(message.subject, :length => 70) %>
20
+ </div>
21
+ </div>
22
+ <div class="clearfloat">
23
+ </div>
24
+ </div>
25
+ <div class="body">
26
+ <%= raw(message.body) %>
27
+ </div>
28
+ </div>
29
+ <div class="clearfloat">
30
+ </div>
31
+ <% end %>
@@ -1,21 +1,15 @@
1
- <% content_for :headers do %>
2
- <%= stylesheet_link_tag "messages.css", :media => "screen, projection" %>
3
- <% end %>
1
+
2
+ <%= location(
3
+ link_to(image_tag("btn/new.png", :class => "menu_icon")+t('message.other'), conversations_path,:remote => true),
4
+ link_to(image_tag("btn/message_new.png", :class => "menu_icon")+ t('message.new'), new_message_path, :remote => true)
5
+ ) %>
6
+
4
7
 
5
8
  <br class="clearfloat" />
6
- <div class="space_center">
7
- </div>
8
- <div id="new_message">
9
- <% if @box.present? %>
10
- <%= link_to 'Back', messages_path(:box => @box) %>
11
- <% else %>
12
- <%= link_to 'Back', messages_path %>
13
- <% end %>
14
- </div>
15
- <div class="space_center">
16
- </div>
17
- <div class="space_center">
18
- </div>
9
+ <div class="space_center"></div>
10
+ <div class="space_center"></div>
11
+
12
+
19
13
  <div id="conversation">
20
14
  <%= render :partial => 'form' %>
21
15
  </div>
@@ -2,9 +2,54 @@
2
2
  <%= render :partial => 'home/sidebar' %>
3
3
  <% end %>
4
4
 
5
- <% toolbar :option => :messages do %>
6
- <%= render :partial => 'menu_options' %>
5
+ <% toolbar %>
6
+
7
+ <% content_for :headers do %>
8
+ <%= stylesheet_link_tag "messages.css", :media => "screen, projection" %>
9
+ <%= stylesheet_link_tag "fcbkComplete.css", :media => "screen, projection" %>
10
+ <%= javascript_include_tag 'jquery.fcbkcomplete.min','jquery.validate','ckeditor/ckeditor.js','ckeditor/adapters/jquery.js' %>
11
+
12
+ <% end %>
13
+
14
+ <% content_for :javascript do %>
15
+
16
+ var recipients = $("#_recipients").fcbkcomplete({
17
+ json_url: "<%= contacts_path(:format => :json) %>",
18
+ cache: true,
19
+ filter_case: true,
20
+ filter_hide: true,
21
+ newel: false,
22
+ height: 6
23
+ });
24
+
25
+
26
+ $('#body').ckeditor(
27
+ function(){
28
+ $('#cke_top_body').click( updateTextArea);
29
+ },
30
+ { width:493 }
31
+ );
32
+
33
+ var editor = $('#body').ckeditorGet();
34
+
35
+ editor.on("instanceReady", function(){
36
+ this.document.on("keyup", updateTextArea);
37
+ this.document.on("paste", updateTextArea);
38
+ this.document.on("mousedown", updateTextArea);
39
+ });
40
+
41
+ var updateTextArea = function (){
42
+ editor.updateElement();
43
+ $("#body").trigger('keyup');
44
+ }
45
+
46
+
47
+ <% unless @recipient.nil? %>
48
+ $("#_recipients").trigger("addItem",[{"title": "<%= @recipient.name %>", "value": "<%= @recipient.id %>"}]);
49
+ <% end %>
50
+
51
+ $(".new_message").validate();
52
+
7
53
  <% end %>
8
54
 
9
- <%= render :partial => 'location' %>
10
55
  <%= render :partial => 'new' %>
@@ -1 +1,38 @@
1
- $("#content").html("<%=escape_javascript(render :partial => 'new') %>");
1
+ $("#content").html("<%= escape_javascript(render :partial => 'new') %>");
2
+
3
+ $("head").append($("<%= escape_javascript(stylesheet_link_tag "messages.css", :media => "screen, projection") %>"));
4
+ $("head").append($("<%= escape_javascript(stylesheet_link_tag "fcbkComplete.css", :media => "screen, projection") %>"));
5
+
6
+ $("head").append($("<%= escape_javascript(javascript_include_tag 'jquery.fcbkcomplete.min','jquery.validate','ckeditor/ckeditor.js','ckeditor/adapters/jquery.js') %>"));
7
+
8
+ var recipients = $("#_recipients").fcbkcomplete({
9
+ json_url: "<%= contacts_path(:format => :json) %>",
10
+ cache: true,
11
+ filter_case: true,
12
+ filter_hide: true,
13
+ newel: false,
14
+ height: 6
15
+ });
16
+
17
+
18
+ $('#body').ckeditor(
19
+ );
20
+
21
+ var editor = $('#body').ckeditorGet();
22
+
23
+ editor.on("instanceReady", function(){
24
+ this.document.on("keyup", updateTextArea);
25
+ this.document.on("paste", updateTextArea);
26
+ this.document.on("mousedown", updateTextArea);
27
+ });
28
+
29
+ var updateTextArea = function (){
30
+ editor.updateElement();
31
+ $("#body").trigger('keyup');
32
+ }
33
+
34
+ <% unless @recipient.nil? %>
35
+ $("#_recipients").trigger("addItem",[{"title": "<%= @recipient.name %>", "value": "<%= @recipient.id %>"}]);
36
+ <% end %>
37
+
38
+ $(".new_message").validate();