social_stream 2.0.4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.rdoc +2 -1
- data/base/README.rdoc +2 -0
- data/base/app/assets/javascripts/social_stream/relation_customs.js +8 -3
- data/base/app/assets/javascripts/social_stream/timeline.js +1 -2
- data/base/app/assets/javascripts/social_stream/wall.js +11 -0
- data/base/app/assets/stylesheets/social_stream/base/contacts/_contacts.css.sass +1 -0
- data/base/app/assets/stylesheets/social_stream/base/contacts/layouts/_contacts.css.sass +1 -42
- data/base/app/assets/stylesheets/social_stream/base/footer/layout/_footer.css.sass +3 -2
- data/base/app/assets/stylesheets/social_stream/base/layouts/_layout.css.sass +4 -1
- data/base/app/assets/stylesheets/social_stream/base/mixins/_layout.css.sass +48 -0
- data/base/app/assets/stylesheets/social_stream/base/profile/_profile.css.sass +21 -25
- data/base/app/assets/stylesheets/social_stream/base/sidebar/_sidebar.css.sass +1 -27
- data/base/app/assets/stylesheets/social_stream/base/sidebar/layout/_sidebar.css.sass +1 -24
- data/base/app/assets/stylesheets/social_stream/base/toolbar/_toolbar.css.sass +2 -11
- data/base/app/assets/stylesheets/social_stream/base/toolbar/layout/_toolbar.css.sass +18 -5
- data/base/app/controllers/contacts_controller.rb +17 -22
- data/base/app/controllers/permissions_controller.rb +3 -1
- data/base/app/helpers/contacts_helper.rb +9 -14
- data/base/app/models/actor.rb +28 -2
- data/base/app/models/contact.rb +18 -1
- data/base/app/models/permission.rb +21 -1
- data/base/app/models/relation.rb +14 -15
- data/base/app/models/relation/custom.rb +27 -24
- data/base/app/views/activities/_new.html.erb +1 -1
- data/base/app/views/contacts/{_link_custom.html.erb → _button.html.erb} +0 -0
- data/base/app/views/contacts/_contact.html.erb +1 -1
- data/base/app/views/contacts/index.html.erb +1 -1
- data/base/app/views/devise/passwords/new.html.erb +6 -8
- data/base/app/views/devise/registrations/new.html.erb +5 -7
- data/base/app/views/layouts/application.html.erb +7 -8
- data/base/app/views/permissions/_index.html.erb +12 -12
- data/base/app/views/permissions/_list.html.erb +10 -0
- data/base/app/views/permissions/index.js.erb +1 -15
- data/base/app/views/posts/create.js.erb +5 -4
- data/base/app/views/profiles/_personal.html.erb +2 -2
- data/base/app/views/relation/customs/_custom.html.erb +2 -27
- data/base/app/views/relation/customs/_form.html.erb +1 -1
- data/base/app/views/relation/customs/_index.html.erb +1 -1
- data/base/app/views/relation/customs/_list.html.erb +5 -4
- data/base/app/views/relation/customs/index.html.erb +1 -1
- data/base/app/views/relations/_relation.html.erb +33 -0
- data/base/config/locales/en.yml +10 -5
- data/base/config/locales/es.yml +20 -40
- data/base/config/locales/pt.yml +5 -1
- data/base/config/locales/zh.yml +17 -9
- data/base/lib/generators/social_stream/base/install_generator.rb +0 -4
- data/base/lib/generators/social_stream/base/templates/initializer.rb +24 -0
- data/base/lib/social_stream/base.rb +70 -0
- data/base/lib/social_stream/base/ability.rb +13 -1
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/test_helpers/controllers.rb +12 -6
- data/base/social_stream-base.gemspec +1 -1
- data/base/spec/controllers/permissions_controller_spec.rb +2 -6
- data/documents/app/assets/stylesheets/social_stream-documents.css.sass +2 -0
- data/documents/app/assets/stylesheets/social_stream/documents/explore/_explore-documents.css.sass +1 -2
- data/documents/app/assets/stylesheets/social_stream/documents/explore/layout/_explore-documents.css.sass +2 -13
- data/documents/app/assets/stylesheets/social_stream/documents/mixins/_mixins.css.sass +19 -0
- data/documents/lib/social_stream-documents.rb +0 -2
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/social_stream-documents.gemspec +1 -1
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/linkser/app/assets/javascripts/social_stream/linkser.wall.js +11 -14
- data/linkser/app/views/links/create.js.erb +3 -4
- data/linkser/lib/social_stream/linkser/version.rb +1 -1
- data/linkser/social_stream-linkser.gemspec +1 -1
- data/oauth2_server/app/assets/stylesheets/social_stream-oauth2_server.css.sass +1 -1
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/applications/_applications-oauth2server.css.sass +1 -1
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/applications/layout/_applications-oauth2server.css.sass +4 -0
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/create/_create-oauth2server.css.sass +3 -7
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/mixins/_mixin.css.sass +10 -0
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/show/layout/_show-oauth2server.css.sass +15 -6
- data/oauth2_server/app/controllers/site/clients_controller.rb +14 -11
- data/oauth2_server/app/models/relation/manager.rb +19 -0
- data/oauth2_server/app/models/site/client.rb +10 -6
- data/oauth2_server/app/views/site/clients/_avatar.html.erb +15 -0
- data/oauth2_server/app/views/site/clients/_edit.html.erb +6 -0
- data/oauth2_server/app/views/site/clients/_edit_step_2.html.erb +11 -0
- data/oauth2_server/app/views/site/clients/_edit_step_3.html.erb +10 -0
- data/oauth2_server/app/views/site/clients/_list.html.erb +20 -17
- data/oauth2_server/app/views/site/clients/edit.html.erb +5 -6
- data/oauth2_server/app/views/site/clients/index.html.erb +1 -1
- data/oauth2_server/app/views/site/clients/new.html.erb +4 -2
- data/oauth2_server/app/views/site/clients/show.html.erb +49 -42
- data/oauth2_server/config/locales/en.yml +21 -3
- data/oauth2_server/config/locales/es.yml +26 -11
- data/oauth2_server/config/locales/zh.yml +25 -0
- data/oauth2_server/db/migrate/20130619134332_site_client_admin_to_manager.rb +24 -0
- data/oauth2_server/lib/social_stream-oauth2_server.rb +1 -19
- data/oauth2_server/lib/social_stream/oauth2_server.rb +33 -5
- data/oauth2_server/lib/social_stream/oauth2_server/ability.rb +23 -0
- data/oauth2_server/lib/social_stream/oauth2_server/engine.rb +6 -0
- data/oauth2_server/lib/social_stream/oauth2_server/models/actor.rb +2 -2
- data/oauth2_server/lib/social_stream/oauth2_server/version.rb +1 -1
- data/oauth2_server/social_stream-oauth2_server.gemspec +1 -1
- data/oauth2_server/spec/controllers/site_clients_controller_authorization_spec.rb +112 -0
- data/oauth2_server/spec/factories/site_client.rb +2 -2
- data/oauth2_server/spec/models/site/client_authorization_spec.rb +20 -0
- data/ostatus/lib/social_stream-ostatus.rb +0 -4
- data/ostatus/lib/social_stream/ostatus/engine.rb +11 -0
- data/ostatus/lib/social_stream/ostatus/version.rb +1 -1
- data/ostatus/social_stream-ostatus.gemspec +1 -1
- data/places/config/locales/en.yml +0 -1
- data/places/config/locales/es.yml +1 -2
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/presence/social_stream-presence.gemspec +1 -1
- data/social_stream.gemspec +7 -7
- metadata +30 -26
- data/base/app/helpers/permissions_helper.rb +0 -21
- data/base/lib/generators/social_stream/base/templates/relations.yml +0 -39
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/mixins/_mixins.css.sass +0 -5
- data/oauth2_server/app/models/relation/admin.rb +0 -9
- data/oauth2_server/app/views/site/clients/_form_step1.html.erb +0 -7
- data/oauth2_server/app/views/site/clients/_form_step2.html.erb +0 -20
- data/ostatus/app/decorators/social_stream/base/relation/custom_decorator.rb +0 -3
- data/ostatus/lib/social_stream/ostatus/models/relation/custom.rb +0 -22
- data/spec/dummy/config/relations.yml +0 -39
@@ -1,4 +1,4 @@
|
|
1
|
-
@import "social_stream/oauth2_server/mixins/
|
1
|
+
@import "social_stream/oauth2_server/mixins/mixin"
|
2
2
|
|
3
3
|
@import "social_stream/oauth2_server/applications/applications-oauth2server"
|
4
4
|
@import "social_stream/oauth2_server/applications/layout/applications-oauth2server"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// menu horizontal
|
2
|
+
// ----------------------------------
|
3
|
+
|
4
|
+
@mixin principal-box
|
5
|
+
@include border-radius(5px)
|
6
|
+
@include box-shadow (1px 1px 15px 0px rgba(50, 50, 50, 0.1))
|
7
|
+
border: 1px solid
|
8
|
+
border-color: rgba(0,0,0, 0.1)
|
9
|
+
background-color: $auxiliarColor
|
10
|
+
border-color: rgba(0,0,0, 0.1)
|
@@ -34,8 +34,8 @@
|
|
34
34
|
margin-left: 2.85%
|
35
35
|
.site_client
|
36
36
|
width: 95%
|
37
|
-
padding
|
38
|
-
|
37
|
+
padding: 0 2.5%
|
38
|
+
margin-bottom: 30px
|
39
39
|
display: inline-block
|
40
40
|
h1
|
41
41
|
@include clearfix
|
@@ -56,6 +56,9 @@
|
|
56
56
|
margin-top: -50px
|
57
57
|
h4
|
58
58
|
margin-bottom: 0px
|
59
|
+
font-size: 18px
|
60
|
+
color: $principalColor
|
61
|
+
font-family: $serifFontFamily
|
59
62
|
.name,
|
60
63
|
.url,
|
61
64
|
.users
|
@@ -69,21 +72,27 @@
|
|
69
72
|
margin-left: 20px
|
70
73
|
padding-top: 5px
|
71
74
|
border-top: 1px solid #C1C1C1
|
75
|
+
color: #929292
|
76
|
+
font-size: 17px
|
72
77
|
.btn-group
|
73
78
|
@include btn-primary
|
74
79
|
@include border-radius(5px)
|
75
80
|
@include btn-add
|
81
|
+
float: right
|
76
82
|
.dropdown-menu
|
77
83
|
width: 300px
|
78
84
|
margin-left: -196px
|
85
|
+
padding: 10px 14px
|
86
|
+
color: $gray
|
79
87
|
li
|
80
|
-
word-break: break-all
|
81
|
-
overflow-y: hidden
|
82
|
-
overflow-x: scroll
|
83
88
|
h6
|
84
89
|
border-bottom: 1px solid #CCC
|
85
90
|
a
|
86
|
-
color: principalColor
|
91
|
+
color: $principalColor !important
|
92
|
+
li.client-secret
|
93
|
+
p
|
94
|
+
word-break: break-all
|
95
|
+
overflow-x: scroll
|
87
96
|
|
88
97
|
|
89
98
|
|
@@ -1,18 +1,12 @@
|
|
1
1
|
class Site::ClientsController < ApplicationController
|
2
2
|
before_filter :authenticate_user!
|
3
3
|
|
4
|
-
before_filter :set_author_ids, only: [ :create, :update ]
|
4
|
+
before_filter :set_author_ids, only: [ :new, :create, :update ]
|
5
5
|
|
6
|
-
|
7
|
-
@developer_clients = current_subject.developer_site_clients
|
8
|
-
end
|
9
|
-
|
10
|
-
def show
|
11
|
-
@client = Site::Client.find params[:id]
|
12
|
-
end
|
6
|
+
load_and_authorize_resource
|
13
7
|
|
14
|
-
def
|
15
|
-
@
|
8
|
+
def index
|
9
|
+
@clients = current_subject.managed_site_clients
|
16
10
|
end
|
17
11
|
|
18
12
|
def create
|
@@ -20,7 +14,9 @@ class Site::ClientsController < ApplicationController
|
|
20
14
|
|
21
15
|
if @client.save
|
22
16
|
respond_to do |format|
|
23
|
-
format.html {
|
17
|
+
format.html {
|
18
|
+
redirect_to edit_site_client_path(@client, step: 2)
|
19
|
+
}
|
24
20
|
end
|
25
21
|
else
|
26
22
|
respond_to do |format|
|
@@ -47,9 +43,16 @@ class Site::ClientsController < ApplicationController
|
|
47
43
|
end
|
48
44
|
end
|
49
45
|
|
46
|
+
def destroy
|
47
|
+
@client.destroy
|
48
|
+
|
49
|
+
redirect_to home_path
|
50
|
+
end
|
51
|
+
|
50
52
|
private
|
51
53
|
|
52
54
|
def set_author_ids
|
55
|
+
params[:site_client] ||= HashWithIndifferentAccess.new
|
53
56
|
params[:site_client][:author_id] = current_subject.actor_id
|
54
57
|
params[:site_client][:user_author_id] = current_user.actor_id
|
55
58
|
params[:site_client][:owner_id] = current_subject.actor_id
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Owner of client sites
|
2
|
+
class Relation::Manager < Relation::Single
|
3
|
+
PERMISSIONS =
|
4
|
+
[
|
5
|
+
[ 'manage', nil ],
|
6
|
+
[ 'manage', 'relation/custom' ],
|
7
|
+
[ 'manage', 'contact' ]
|
8
|
+
]
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def create_activity?
|
12
|
+
false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def available_permissions
|
17
|
+
Permission.instances PERMISSIONS
|
18
|
+
end
|
19
|
+
end
|
@@ -4,12 +4,13 @@ class Site::Client < Site
|
|
4
4
|
before_validation :set_secret,
|
5
5
|
on: :create
|
6
6
|
|
7
|
-
after_create :
|
7
|
+
after_create :set_manager
|
8
8
|
|
9
|
-
scope :
|
10
|
-
|
9
|
+
scope :managed_by, lambda { |actor|
|
10
|
+
select("DISTINCT sites.*").
|
11
|
+
joins(actor: :sent_permissions).
|
11
12
|
merge(Contact.received_by(actor)).
|
12
|
-
merge(
|
13
|
+
merge(Permission.where(action: 'manage', object: nil))
|
13
14
|
}
|
14
15
|
|
15
16
|
%w{ url callback_url secret }.each do |m|
|
@@ -32,7 +33,10 @@ class Site::Client < Site
|
|
32
33
|
self.secret = SecureRandom.hex(64)
|
33
34
|
end
|
34
35
|
|
35
|
-
def
|
36
|
-
|
36
|
+
def set_manager
|
37
|
+
c = sent_contacts.create! receiver_id: author.id,
|
38
|
+
user_author: author
|
39
|
+
|
40
|
+
c.relation_ids = [ ::Relation::Manager.instance.id ]
|
37
41
|
end
|
38
42
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<section class="avatar">
|
2
|
+
<% if can? :update, @profile %>
|
3
|
+
<header>
|
4
|
+
<%= render partial: 'edit_icon' %>
|
5
|
+
<h4>
|
6
|
+
<%= t('avatar.profile_change') %>
|
7
|
+
</h4>
|
8
|
+
</header>
|
9
|
+
<div class="update">
|
10
|
+
<%= render partial: 'avatars/form',
|
11
|
+
object: @profile.actor,
|
12
|
+
as: :avatarable %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
</section>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= image_tag 'step_2.png' %>
|
2
|
+
|
3
|
+
<section class="new_app">
|
4
|
+
<h1>Set the application's logo</h1>
|
5
|
+
|
6
|
+
<%= render partial: 'avatars/form',
|
7
|
+
object: @client,
|
8
|
+
as: :avatarable %>
|
9
|
+
|
10
|
+
<%= link_to "Next", edit_site_client_path(@client, step: 3) %>
|
11
|
+
</section>
|
@@ -1,24 +1,27 @@
|
|
1
1
|
<section class="site_clients_list">
|
2
|
-
|
2
|
+
<ul>
|
3
|
+
<% list.each do |client| %>
|
4
|
+
<li>
|
5
|
+
<%= image_tag client.logo.url(:small), style: "width: 40px; height: 40px;" %>
|
3
6
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<% end %>
|
7
|
+
<div class="name">
|
8
|
+
<%= link_to client.name, client %>
|
9
|
+
</div>
|
10
|
+
<div class="url">
|
11
|
+
<%= link_to client.url, client.url, target: '_blank' %>
|
12
|
+
</div>
|
13
|
+
<div class="users">
|
14
|
+
<span>
|
15
|
+
5
|
16
|
+
</span>
|
17
|
+
users
|
18
|
+
</div>
|
19
|
+
<hr class="soften">
|
20
|
+
</li>
|
21
|
+
<% end %>
|
20
22
|
|
21
23
|
<%= javascript_tag do %>
|
22
24
|
SocialStream.SiteClient.index();
|
23
25
|
<% end %>
|
26
|
+
</ul>
|
24
27
|
</section>
|
@@ -3,12 +3,11 @@
|
|
3
3
|
<%= render partial: 'toolbar/home' %>
|
4
4
|
|
5
5
|
<section class="edit_site_client" id="edit_<%= dom_id @client %>">
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
<%= render partial: '
|
10
|
-
|
11
|
-
</section>
|
6
|
+
<% if params[:step].present? %>
|
7
|
+
<%= render partial: "edit_step_#{ params[:step] }" %>
|
8
|
+
<% else %>
|
9
|
+
<%= render partial: 'edit' %>
|
10
|
+
<% end %>
|
12
11
|
</section>
|
13
12
|
</section>
|
14
13
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<%= Site::Client.human_attribute_name :description %>
|
21
21
|
</h4>
|
22
22
|
<div class="result">
|
23
|
-
<%=
|
23
|
+
<%= @client.description%>
|
24
24
|
</div>
|
25
25
|
|
26
26
|
<h4>
|
@@ -30,45 +30,52 @@
|
|
30
30
|
<%= link_to @client.url, @client.url%>
|
31
31
|
</div>
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
<% if can? :update, @client %>
|
34
|
+
<h4>
|
35
|
+
<%= Site::Client.human_attribute_name :callback_url %>
|
36
|
+
</h4>
|
37
|
+
<div class="result">
|
38
|
+
<%= @client.callback_url %>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
39
41
|
</div>
|
40
42
|
|
41
|
-
|
42
|
-
<
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<
|
48
|
-
<
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
43
|
+
<% if can? :update, @client %>
|
44
|
+
<div class="btn-group">
|
45
|
+
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
46
|
+
Credentials
|
47
|
+
<span class="caret"></span>
|
48
|
+
</a>
|
49
|
+
<ul class="dropdown-menu">
|
50
|
+
<li>
|
51
|
+
<h6>
|
52
|
+
<%= Site::Client.human_attribute_name :id %>
|
53
|
+
</h6>
|
54
|
+
<p>
|
55
|
+
<%= @client.id %>
|
56
|
+
</p>
|
57
|
+
</li>
|
58
|
+
|
59
|
+
<li class="client-secret">
|
60
|
+
<h6>
|
61
|
+
<%= Site::Client.human_attribute_name :secret %>
|
62
|
+
<a href="#" class="pull-right">refresh</a>
|
63
|
+
</h6>
|
64
|
+
<p>
|
65
|
+
<%= @client.secret %>
|
66
|
+
</p>
|
67
|
+
</li>
|
68
|
+
</ul>
|
69
|
+
</div>
|
70
|
+
<% end %>
|
64
71
|
</div>
|
65
72
|
</section>
|
66
73
|
|
67
74
|
<div class="tabbable"> <!-- Only required for left/right tabs -->
|
68
75
|
<ul class="nav nav-tabs">
|
69
|
-
<li class="active"><a href="#
|
70
|
-
<li><a href="#
|
71
|
-
<li><a href="#
|
76
|
+
<li class="active"><a href="#authorized" data-toggle="tab">Authorized</a></li>
|
77
|
+
<li><a href="#registered" data-toggle="tab">Registered</a></li>
|
78
|
+
<li><a href="#stats" data-toggle="tab">Stats</a></li>
|
72
79
|
</ul>
|
73
80
|
<div class="search-nav hidden-phone">
|
74
81
|
<%= form_tag search_path, method: 'get', class: "navbar-search pull-left" do %>
|
@@ -79,6 +86,7 @@
|
|
79
86
|
SocialStream.SearchHeader.show();
|
80
87
|
});
|
81
88
|
<% end %>
|
89
|
+
|
82
90
|
<div class="mat">
|
83
91
|
<%= render partial: 'layouts/loading' %>
|
84
92
|
|
@@ -97,18 +105,17 @@
|
|
97
105
|
|
98
106
|
|
99
107
|
<div class="tab-content">
|
100
|
-
<div class="tab-pane active" id="
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
</ul>
|
108
|
+
<div class="tab-pane active" id="authorized">
|
109
|
+
<%= render partial: 'contacts/contact',
|
110
|
+
collection: @client.sent_contacts.first(12) %>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div class="tab-pane" id="registered">
|
107
114
|
</div>
|
108
115
|
|
109
|
-
<div class="tab-pane" id="
|
116
|
+
<div class="tab-pane" id="stats">
|
110
117
|
</div>
|
111
118
|
</div>
|
112
119
|
</div>
|
113
120
|
|
114
|
-
</section>
|
121
|
+
</section>
|