social_stream 0.16.3 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. data/LICENSE +1 -1
  2. data/README.rdoc +1 -0
  3. data/base/LICENSE +1 -1
  4. data/base/README.rdoc +1 -1
  5. data/base/app/assets/stylesheets/header.css.scss +9 -7
  6. data/base/app/controllers/groups_controller.rb +3 -4
  7. data/base/app/controllers/settings_controller.rb +14 -3
  8. data/base/app/controllers/users_controller.rb +3 -4
  9. data/base/app/helpers/permissions_helper.rb +2 -1
  10. data/base/app/models/activity_object.rb +29 -28
  11. data/base/app/models/actor.rb +27 -19
  12. data/base/app/models/channel.rb +48 -0
  13. data/base/app/views/contacts/_pendings.html.erb +1 -1
  14. data/base/app/views/devise/registrations/_edit_user.html.erb +0 -25
  15. data/base/app/views/devise/registrations/edit.html.erb +1 -0
  16. data/base/app/views/layouts/_footer.html.erb +1 -1
  17. data/base/app/views/layouts/_header_dropdown_menu_sessions.html.erb +5 -2
  18. data/base/app/views/settings/_language.html.erb +32 -0
  19. data/base/app/views/settings/_notifications.html.erb +1 -1
  20. data/base/config/locales/en.yml +5 -0
  21. data/base/config/locales/es.yml +7 -0
  22. data/base/db/migrate/20120103103125_add_channels.rb +88 -0
  23. data/base/db/migrate/20120109081509_update_notify_permissions.rb +15 -0
  24. data/base/lib/social_stream-base.rb +7 -4
  25. data/base/lib/social_stream/base/engine.rb +10 -2
  26. data/base/lib/social_stream/base/version.rb +1 -1
  27. data/base/lib/social_stream/controllers/i18n_integration.rb +29 -0
  28. data/base/lib/social_stream/controllers/subjects.rb +19 -0
  29. data/base/lib/social_stream/models/object.rb +12 -26
  30. data/base/lib/social_stream/models/subject.rb +2 -24
  31. data/base/lib/social_stream/models/subtype.rb +80 -0
  32. data/base/lib/social_stream/models/supertype.rb +16 -3
  33. data/base/lib/social_stream/views/settings/base.rb +5 -0
  34. data/base/lib/tasks/db/populate.rake +1 -0
  35. data/base/spec/controllers/settings_controller_spec.rb +1 -1
  36. data/base/spec/spec_helper.rb +3 -0
  37. data/documents/app/assets/stylesheets/documents.css.scss +9 -0
  38. data/documents/app/controllers/documents_controller.rb +3 -2
  39. data/documents/app/models/document.rb +1 -1
  40. data/documents/app/views/documents/_new_activity_fields.html.erb +14 -0
  41. data/documents/app/views/videos/_video_show.html.erb +23 -19
  42. data/documents/config/locales/en.yml +6 -2
  43. data/documents/config/locales/es.yml +6 -2
  44. data/documents/db/migrate/20120109155431_document_object_type.rb +16 -0
  45. data/documents/lib/social_stream/documents/version.rb +1 -1
  46. data/documents/social_stream-documents.gemspec +2 -2
  47. data/documents/spec/dummy/Rakefile +1 -1
  48. data/documents/spec/dummy/app/assets/javascripts/application.js +9 -0
  49. data/documents/spec/dummy/app/assets/stylesheets/application.css +7 -0
  50. data/documents/spec/dummy/app/views/layouts/application.html.erb +3 -3
  51. data/documents/spec/dummy/config/application.rb +8 -8
  52. data/documents/spec/dummy/config/database.yml +3 -0
  53. data/documents/spec/dummy/config/environments/development.rb +7 -2
  54. data/documents/spec/dummy/config/environments/production.rb +23 -12
  55. data/documents/spec/dummy/config/environments/test.rb +5 -3
  56. data/documents/spec/dummy/config/initializers/secret_token.rb +1 -1
  57. data/documents/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  58. data/documents/spec/dummy/config/locales/en.yml +1 -1
  59. data/documents/spec/dummy/config/routes.rb +1 -1
  60. data/documents/spec/dummy/db/schema.rb +6 -0
  61. data/events/app/assets/stylesheets/events.css.scss +3 -0
  62. data/events/app/helpers/events_helper.rb +11 -1
  63. data/events/app/models/event.rb +12 -1
  64. data/events/lib/social_stream/events/models/actor.rb +6 -0
  65. data/events/lib/social_stream/events/version.rb +1 -1
  66. data/events/lib/social_stream/views/sidebar/events.rb +4 -2
  67. data/events/social_stream-events.gemspec +2 -2
  68. data/lib/generators/social_stream/install_generator.rb +1 -0
  69. data/lib/social_stream.rb +2 -0
  70. data/lib/social_stream/version.rb +1 -1
  71. data/lib/tasks/migrations.rake +14 -0
  72. data/linkser/app/assets/javascripts/linkser.js.erb +3 -3
  73. data/linkser/lib/social_stream/linkser/version.rb +1 -1
  74. data/linkser/social_stream-linkser.gemspec +2 -2
  75. data/presence/lib/social_stream/presence/version.rb +1 -1
  76. data/presence/social_stream-presence.gemspec +1 -1
  77. data/social_stream.gemspec +9 -6
  78. data/spec/dummy/config/application.rb +5 -5
  79. data/spec/dummy/config/environments/development.rb +3 -0
  80. data/spec/dummy/config/environments/production.rb +10 -4
  81. data/spec/dummy/config/initializers/secret_token.rb +1 -1
  82. data/spec/dummy/config/initializers/wrap_parameters.rb +5 -3
  83. data/spec/dummy/db/schema.rb +2 -8
  84. data/spec/dummy/script/rails +0 -0
  85. data/spec/spec_helper.rb +3 -0
  86. data/spec/support/db.rb +1 -1
  87. metadata +51 -31
  88. data/base/spec/dummy/app/helpers/application_helper.rb +0 -2
  89. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  90. data/spec/dummy/app/mailers/.gitkeep +0 -0
  91. data/spec/dummy/app/models/.gitkeep +0 -0
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Universidad Politécnica de Madrid
1
+ Copyright (c) 2012 Universidad Politécnica de Madrid
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -56,6 +56,7 @@ Current Social Stream distribution includes:
56
56
  activities on files
57
57
  * {Social Stream Events}[https://github.com/ging/social_stream/tree/master/events], sheduled events with calendar
58
58
  * {Social Stream Linkser}[https://github.com/ging/social_stream/tree/master/linkser], advanced management of links to other webpages
59
+ * {Social Stream Presence}[https://github.com/ging/social_stream/tree/master/presence], XMPP based chat support
59
60
 
60
61
  = Documentation
61
62
 
data/base/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Universidad Politécnica de Madrid
1
+ Copyright (c) 2012 Universidad Politécnica de Madrid
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/base/README.rdoc CHANGED
@@ -10,7 +10,7 @@ network environment see https://github.com/ging/social_stream
10
10
  * Social network infraestructure
11
11
  * Activity streams infraestructure
12
12
  * Subjects: {User} and {Group}
13
- * Objects: {Post} and {Commment}
13
+ * Objects: {Post} and {Comment}
14
14
  * Private messages and notifications, by {Mailboxer}[https://github.com/ging/mailboxer]
15
15
  * Avatars, by {Avatars For Rails}[https://github.com/ging/avatars_for_rails]
16
16
 
@@ -25,11 +25,13 @@
25
25
  .div_login .options{ height:20px; font-size: 11px;}
26
26
  .div_login .a_border{ border-right:thin solid; padding-right:7px; text-decoration:underline; }
27
27
  #new_representation { display: inline-block;}
28
- #header_notifications a{color: white; padding: 4px 10px 6px 11px;
28
+ #header_notifications a{color: $text-over-main; padding: 4px 10px 6px 11px;
29
29
  background: transparent url('btn/header_notifications.png') no-repeat center center;}
30
- #header_inbox_count a{ color: white; background-color: $header-notification-color; padding: 2px 7px 2px 7px;}
30
+ #header_inbox_count a{ color: $text-over-main; background-color: $header-notification-color; padding: 2px 7px 2px 7px;}
31
31
  #representation { display: inline; padding-left:3px; padding-right:3px;}
32
- .switch_pending_count { color: white; background-color: $header-notification-color; padding: 2px 7px 2px 7px !important; margin-left: 5px !important; float: right; }
32
+ .switch_pending_count { color: $text-over-main; text-align: right;
33
+ background: transparent url('btn/header_notifications.png') no-repeat center center;
34
+ padding: 2px 10px 4px 11px !important; margin: 0 5px 0 5px !important; float: right; }
33
35
  .txt_config {color: $text-over-main; vertical-align: top; display: inline; padding-top: 2px;
34
36
  border-right: thin solid; padding-right: 3px;}
35
37
  .txt_config2 {color: $text-over-main; vertical-align: top; display: inline; padding-top: 2px; padding-right: 3px;}
@@ -37,7 +39,7 @@
37
39
 
38
40
  /******** MENU HEADER *******/
39
41
  #menu_home, .menu_home {vertical-align: top; }
40
- #menu_home a {color:white;}
42
+ #menu_home a {color:$text-over-main;}
41
43
  #menu_home a:hover {text-decoration: none;}
42
44
  #menu_home ul {list-style: none; margin: 0px; float:left;}
43
45
  #menu_home ul li {line-height:20px; vertical-align:top;}
@@ -49,9 +51,9 @@
49
51
  #header_dropdown_menu ul li a{padding: .40em 1em .70em 2.5em;}
50
52
  #header_dropdown_menu ul li a:hover{color:$main-color;}
51
53
  #header_dropdown_menu ul li ul li a{padding: .40em 1em .70em 1em;}
52
- #header_dropdown_menu ul li ul li ul li {width: 160px;}
53
- #header_dropdown_menu ul li ul li ul li a{padding: .40em 1em .70em 2.5em;}
54
- #header_dropdown_menu ul li ul li ul{position: absolute; left: -160px;}
54
+ #header_dropdown_menu ul li ul li ul li {width: 170px;}
55
+ #header_dropdown_menu ul li ul li ul li a{padding: .40em 1em .70em 2.5em; display:inline;}
56
+ #header_dropdown_menu ul li ul li ul{position: absolute; left: -170px;}
55
57
  #header_dropdown_menu a.session_change{background: transparent url('btn/arrow_session_change.png') no-repeat 3px 6px;}
56
58
 
57
59
  #menu_home ul li.pipe,#menu_account ul li.pipe{padding:0; margin:0;font-size: 20px;font-weight: bold;}
@@ -1,4 +1,6 @@
1
- class GroupsController < InheritedResources::Base
1
+ class GroupsController < ApplicationController
2
+ include SocialStream::Controllers::Subjects
3
+
2
4
  before_filter :authenticate_user!, :except => [ :index, :show ]
3
5
 
4
6
  # Set group founder to current_subject
@@ -19,9 +21,6 @@ class GroupsController < InheritedResources::Base
19
21
 
20
22
  end
21
23
 
22
- def show
23
- end
24
-
25
24
  def create
26
25
  create! do |success, failure|
27
26
  success.html {
@@ -22,13 +22,22 @@ class SettingsController < ApplicationController
22
22
  end
23
23
  end
24
24
 
25
+ #Updating language
26
+ if section.eql? "language"
27
+ #Preferred language setting
28
+ if params[:language].present?
29
+ lang = params[:language].to_s
30
+ current_user.language = lang[0..1]
31
+ end
32
+ end
33
+
25
34
  #Here sections to add
26
35
  #if section.eql? "section_name"
27
36
  # blah blah blah
28
37
  #end
29
38
 
30
- #Was everything ok?
31
- success = current_subject.save
39
+ # Was everything ok?
40
+ success = current_subject.save && current_user.save
32
41
  end
33
42
 
34
43
  #Flashing and redirecting
@@ -37,7 +46,9 @@ class SettingsController < ApplicationController
37
46
  else
38
47
  flash[:error] = t('settings.error')
39
48
  end
40
- render :action => :index
49
+ # render :action => :index
50
+
51
+ redirect_to settings_path
41
52
  end
42
53
 
43
54
  end
@@ -1,4 +1,6 @@
1
- class UsersController < InheritedResources::Base
1
+ class UsersController < ApplicationController
2
+ include SocialStream::Controllers::Subjects
3
+
2
4
  load_and_authorize_resource
3
5
 
4
6
  respond_to :html, :xml, :js
@@ -13,9 +15,6 @@ class UsersController < InheritedResources::Base
13
15
 
14
16
  end
15
17
 
16
- def show
17
- end
18
-
19
18
  # Supported through devise
20
19
  def new; end; def create; end
21
20
  # Not supported yet
@@ -4,7 +4,8 @@ module PermissionsHelper
4
4
  [ "read", "activity" ],
5
5
  [ "create", "activity" ],
6
6
  [ "follow", nil ],
7
- [ "represent", nil ]
7
+ [ "represent", nil ],
8
+ [ "notify", nil ]
8
9
  ]
9
10
 
10
11
  def default_permissions
@@ -9,27 +9,26 @@
9
9
  # Objects are added to +config/initializers/social_stream.rb+
10
10
  #
11
11
  class ActivityObject < ActiveRecord::Base
12
- @subtypes_name = :object
13
- include SocialStream::Models::Supertype
12
+ # ActivityObject is a subtype of Channel
13
+ # Author, owner and user_author of this ActivityObject are defined in its channel
14
+ subtype_of :channel,
15
+ :belongs => { :dependent => nil }
16
+ # ActivityObject is a supertype of SocialStream.objects
17
+ supertype_of :object
14
18
 
15
19
  acts_as_taggable
16
-
17
- # Author can be any type of Actor: User, Group, etc.
18
- belongs_to :author,
19
- :class_name => "Actor"
20
- # Owner is the wall's subject this object is posted to
21
- belongs_to :owner,
22
- :class_name => "Actor"
23
-
24
- # UserAuthor is the real user behind the Author
25
- belongs_to :user_author,
26
- :class_name => "Actor"
27
20
 
28
21
  has_many :activity_object_activities, :dependent => :destroy
29
22
  has_many :activities, :through => :activity_object_activities
30
23
 
31
24
  validates_presence_of :object_type
32
25
 
26
+ scope :authored_by, lambda { |subject|
27
+ joins(:channel).merge(Channel.authored_by(subject))
28
+ }
29
+
30
+ before_validation :check_existing_channel
31
+
33
32
  # The object of this activity object
34
33
  def object
35
34
  subtype_instance.is_a?(Actor) ?
@@ -37,21 +36,6 @@ class ActivityObject < ActiveRecord::Base
37
36
  subtype_instance
38
37
  end
39
38
 
40
- # The {SocialStream::Models::Subject subject} author
41
- def author_subject
42
- author.subject
43
- end
44
-
45
- # The {SocialStream::Models::Subject subject} owner
46
- def owner_subject
47
- owner.subject
48
- end
49
-
50
- # The {SocialStream::Models::Subject subject} user actor
51
- def user_author_subject
52
- user_author.subject
53
- end
54
-
55
39
  # The activity in which this activity_object was created
56
40
  def post_activity
57
41
  activities.includes(:activity_verb).where('activity_verbs.name' => 'post').first
@@ -61,4 +45,21 @@ class ActivityObject < ActiveRecord::Base
61
45
  def acts_as_actor?
62
46
  object_type == "Actor"
63
47
  end
48
+
49
+ protected
50
+
51
+ def check_existing_channel
52
+ return unless channel!.new_record?
53
+
54
+ existing_channel =
55
+ Channel.
56
+ where(:author_id => author_id,
57
+ :owner_id => owner_id,
58
+ :user_author_id => user_author_id).
59
+ first
60
+
61
+ return if existing_channel.blank?
62
+
63
+ self.channel = existing_channel
64
+ end
64
65
  end
@@ -15,11 +15,13 @@
15
15
  #
16
16
  #
17
17
  class Actor < ActiveRecord::Base
18
- @subtypes_name = :subject
19
- include SocialStream::Models::Supertype
18
+ # Actor is a supertype of all subjects defined in SocialStream.subjects
19
+ supertype_of :subject
20
+
20
21
  include SocialStream::Models::Object
21
22
 
22
- validates_presence_of :name, :subject_type
23
+ validates_presence_of :name, :message => ''
24
+ validates_presence_of :subject_type
23
25
 
24
26
  acts_as_messageable
25
27
 
@@ -62,13 +64,13 @@ class Actor < ActiveRecord::Base
62
64
  has_many :relations,
63
65
  :dependent => :destroy
64
66
 
65
- has_many :authored_objects,
66
- :class_name => "ActivityObject",
67
+ has_many :authored_channels,
68
+ :class_name => "Channel",
67
69
  :foreign_key => :author_id,
68
70
  :dependent => :destroy
69
71
 
70
- has_many :owned_objects,
71
- :class_name => "ActivityObject",
72
+ has_many :owned_channels,
73
+ :class_name => "Channel",
72
74
  :foreign_key => :owner_id,
73
75
  :dependent => :destroy
74
76
 
@@ -162,19 +164,20 @@ class Actor < ActiveRecord::Base
162
164
  return "#{name} <#{email}>" if email.present?
163
165
  #If actor is a Group, has enabled emails but no mail we return the highest_rank ones.
164
166
  if (group = self.subject).is_a? Group
165
- relation = group.relation_customs.sort.first
166
- receivers = group.contact_actors(:direction => :sent, :relations => relation)
167
167
  emails = Array.new
168
- receivers.each do |receiver|
169
- next unless Actor.normalize(receiver).subject_type.eql?("User")
170
-
171
- receiver_emails = receiver.mailboxer_email(object)
172
- case receiver_emails
173
- when String
174
- emails << receiver_emails
175
- when Array
176
- receiver_emails.each do |receiver_email|
177
- emails << receiver_email
168
+ group.relation_notifys.each do |relation|
169
+ receivers = group.contact_actors(:direction => :sent, :relations => relation)
170
+ receivers.each do |receiver|
171
+ next unless Actor.normalize(receiver).subject_type.eql?("User")
172
+
173
+ receiver_emails = receiver.mailboxer_email(object)
174
+ case receiver_emails
175
+ when String
176
+ emails << receiver_emails
177
+ when Array
178
+ receiver_emails.each do |receiver_email|
179
+ emails << receiver_email
180
+ end
178
181
  end
179
182
  end
180
183
  end
@@ -197,6 +200,11 @@ class Actor < ActiveRecord::Base
197
200
  relation_customs.find_by_name(name)
198
201
  end
199
202
 
203
+ # All {Relation relations} with the 'notify' permission
204
+ def relation_notifys
205
+ relations.joins(:relation_permissions => :permission).where('permissions.action' => 'notify')
206
+ end
207
+
200
208
  # The {Relation::Public} for this {Actor}
201
209
  def relation_public
202
210
  Relation::Public.of(self)
@@ -0,0 +1,48 @@
1
+ # A {Channel} is the union of the three {Actors} that are involved in an {Activity}:
2
+ #
3
+ # * The author that creates a post, comment, etc. This can be a {User}, {Group}
4
+ # or any kind of {SocialStream::Models::Subject subject}
5
+ # * The user_author representing the author. When users change session and
6
+ # act in behalf of a {Group}, Social Stream still records which user is responsible
7
+ # for an {Activity}
8
+ # * The owner in whose wall the Activity is performed.
9
+ #
10
+ class Channel < ActiveRecord::Base
11
+ # Author can be any type of Actor: User, Group, etc.
12
+ belongs_to :author,
13
+ :class_name => "Actor"
14
+ # Owner is the wall's subject this object is posted to
15
+ belongs_to :owner,
16
+ :class_name => "Actor"
17
+
18
+ # UserAuthor is the real user behind the Author
19
+ belongs_to :user_author,
20
+ :class_name => "Actor"
21
+
22
+ has_many :activity_objects
23
+
24
+ validates_uniqueness_of :author_id, :scope => [ :owner_id, :user_author_id ]
25
+ validates_uniqueness_of :owner_id, :scope => [ :author_id, :user_author_id ]
26
+ validates_uniqueness_of :user_author_id, :scope => [ :author_id, :owner_id ]
27
+
28
+ scope :authored_by, lambda { |subject|
29
+ id = Actor.normalize_id subject
30
+
31
+ where(arel_table[:author_id].eq(id).or(arel_table[:user_author_id].eq(id)))
32
+ }
33
+
34
+ # The {SocialStream::Models::Subject subject} author
35
+ def author_subject
36
+ author.subject
37
+ end
38
+
39
+ # The {SocialStream::Models::Subject subject} owner
40
+ def owner_subject
41
+ owner.subject
42
+ end
43
+
44
+ # The {SocialStream::Models::Subject subject} user actor
45
+ def user_author_subject
46
+ user_author.subject
47
+ end
48
+ end
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
  </div>
9
9
  <div class="content">
10
- <%= render current_subject.pending_contacts.shuffle.first(2) %>
10
+ <%= render :partial => 'contacts/contact', :collection => current_subject.pending_contacts.shuffle.first(2) %>
11
11
  <div class="row more_pending">
12
12
  <%= link_to t('contact.pending.all_n', :count => current_subject.pending_contacts_count), pending_contacts_path %>
13
13
  </div>
@@ -85,29 +85,4 @@ $(".user_edit").validate({errorClass: "validation_error"});
85
85
  <% end%>
86
86
  </div>
87
87
  </div>
88
- <div class="block" id="lang_form">
89
- <div class="header">
90
- <div class="header_text">
91
- <%= t("account.lang.change")%>
92
- </div>
93
- <div class="header_icon_right">
94
- <%= link_to (image_tag('btn/edit.png')), "javascript:showSettings(\"lang_form\");" %>
95
- </div>
96
- </div>
97
- <div id="lang_form_briefing" class="settings_briefing content">
98
- <div class="form_row">
99
- <%= t('settings.lang_change.briefing')%>
100
- </div>
101
- </div>
102
- <div class="content settings_content" id="lang_form_content" style="display:none;">
103
- <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :id => 'form_lang' }) do |f| %>
104
- <div class="form_row">
105
- <div class="form_label"><%= f.label :language %></div>
106
- <div class="form_field">
107
- <%= f.select :language, I18n.available_locales.map{|l| [ l.to_s, l.to_s ] }, { }, { :class => 'form_lang', :onchange => "$(\'#form_lang\').submit();" } %>
108
- </div>
109
- </div>
110
- <% end%>
111
- </div>
112
- </div>
113
88
 
@@ -13,6 +13,7 @@
13
13
  </div>
14
14
  <%= render :partial => "edit_user"%>
15
15
 
16
+ <%= render :partial => "settings/language" %>
16
17
  <%= render :partial => "settings/notifications" %>
17
18
  <% if current_subject.respond_to? :authentication_token%>
18
19
  <%= render :partial => "settings/api_key" %>
@@ -6,7 +6,7 @@
6
6
  <%= link_to(image_tag('HTML5_Semantics.png'),'http://jigsaw.w3.org/css-validator/check/referer') %>
7
7
  </div>
8
8
  <ul>
9
- <li>2011 © </li>
9
+ <li><%= Date.today.year %> © </li>
10
10
  <li id="trade_mark"><%= link_to t('site.name'), 'http://social-stream.dit.upm.es/' %></li>
11
11
  </ul>
12
12
  </div>
@@ -5,8 +5,11 @@
5
5
  <ul>
6
6
  <% representations.each do |representation| %>
7
7
  <li>
8
- <% pending_total = representation.mailbox.notifications.not_trashed.unread.count %>
9
- <%= link_to truncate_name(representation.name, :length => 15) + (content_tag(:span, pending_total.to_s, :class => "switch_pending_count") if pending_total > 0), { :s => representation.slug }, { :style => "background: transparent url('#{ image_path representation.logo.url(:representation)}') no-repeat left center;margin-left:2px;" } %>
8
+ <%= content_tag :span do %>
9
+ <%= link_to truncate_name(representation.name, :length => 15), { :s => representation.slug }, { :style => "background: transparent url('#{ image_path representation.logo.url(:representation)}') no-repeat left center;margin-left:2px;" } %>
10
+ <% pending_total = representation.mailbox.notifications.not_trashed.unread.count %>
11
+ <%= link_to content_tag(:span, pending_total.to_s, :class => "switch_pending_count"), notifications_path(:s => representation.slug), { :style => 'margin: 1px; padding: 0;' } if pending_total > 0 %>
12
+ <% end %>
10
13
  </li>
11
14
  <% end %>
12
15
  </ul>
@@ -0,0 +1,32 @@
1
+ <div class="block" id="language_settings">
2
+ <div class="header">
3
+ <div class="header_text">
4
+ <%= t("account.lang.change")%>
5
+ </div>
6
+ <div class="header_icon_right">
7
+ <%= link_to (image_tag('btn/edit.png')), "javascript:showSettings(\"language_settings\");" %>
8
+ </div>
9
+ </div>
10
+ <div id="lang_form_briefing" class="settings_briefing content">
11
+ <div class="form_row">
12
+ <%= t('settings.lang_change.briefing')%>
13
+ </div>
14
+ </div>
15
+ <div class="content settings_content" id="language_settings_content" style="display:none;">
16
+ <%= form_tag update_all_settings_path, :method => :put, :id => 'form_lang', :remote => false do %>
17
+ <div class="form_row">
18
+ <div class="form_label"><%= label_tag :language, t('settings.lang_change.name') %></div>
19
+ <div class="form_field">
20
+ <%= select_tag(:language, options_for_select(I18n.available_locales.map{|l| [ l.to_s, l.to_s ] }, current_user.language), :class => 'form_tag', :onchange => "$(\'#form_lang\').submit();" )%>
21
+ </div>
22
+ </div>
23
+ <div class="actions center">
24
+ <%= hidden_field_tag :settings_section, :language %>
25
+ <noscript>
26
+ <%= submit_tag "Update Settings", :class => "button" %>
27
+ </noscript>
28
+ </div>
29
+ <% end%>
30
+ </div>
31
+ </div>
32
+