forked from tog/tog_social
/
show.html.erb
135 lines (121 loc) · 5.66 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<div class="detail detail1">
<div class="image"><%=icon_for_profile(@profile, 'small')%></div>
<div class="title"><%=@profile.full_name%></div>
<div class="subtitle"><%= I18n.t('tog_social.profiles.model.username') %>: <%=@profile.user.login%></div>
<% if current_user %>
<div>
<% form_for :shared_object, @shared_object, :url => member_create_shared_object_path(@profile.user.groups.first.id), :html => {:method => "post"} do |f| -%>
<fieldset>
<h2>Share, New Post <span style="font-weight:normal;font-size:80%;"> - message, blog, link etc.</span></h2>
<p>
<%= f.text_area :content, :class=>"fieldbox", :style=>"width:450px; height:100px;" -%>
<div style="margin:10px 0 0 0">
<%= submit_tag 'Share this!', :class => 'button mainaction' %>
<span style="margin:0 0 0 20px;">
<%= link_to 'Create using full editor', member_new_shared_object_path(@profile.user.groups.first.id) %>
<!-- option only available for federated user logged in with Twitter account -->
<% unless current_user.service_provider.nil? %>
<% if current_user.service_provider.include? 'twitter' %>
<span style="margin-left: 2em;"><%= check_box_tag :twitter %> Send to Twitter</span>
<% end %>
<% end %>
</span>
</div>
</p>
</fieldset>
<% end -%>
</div>
<% else %>
<div class="portletK">
<p><%= link_to I18n.t("tog_core.views.shared.header_options.login"), login_path %> to post something here.. </p>
</div>
<% end %>
<% if @profile.user.sharings.size == 0 %>
<div class="summary"><%= I18n.t('tog_social.profiles.site.summary') %></div>
<div class="portlet portletC" id="portlet_moreLinks">
<% if !@profile.user.groups.blank? %>
<h2><span><%= I18n.t('tog_social.groups.site.title') %></span></h2>
<div class="portlet_content">
<ul>
<% for group in @profile.user.groups[1..-1] %>
<li><%= link_to group.name, group_path(group) %></li>
<% end %>
</ul>
</div>
<% else %>
<% end %>
</div>
<div class="portlet portletC" id="portlet_moreLinks">
<h2><span><%= I18n.t('tog_social.more_links') %></span></h2>
<div class="portlet_content">
<ul>
<% if its_me? -%>
<li><%= link_to I18n.t('tog_social.profiles.site.edit_profile'), edit_member_profile_path(@profile) %></li>
<% else -%>
<li><%= link_to I18n.t('tog_social.profiles.site.send_message'), member_new_message_to_path(@profile.user) %></li>
<li><%= report_abuse_link @profile %></li>
<li><%= following_options(@profile) %></li>
<% end -%>
</ul>
</div>
</div>
<% end %>
<% for sharing in @sharings %>
<div id="sharing_<%= sharing.id %>" style="background-color:#ddd; padding: 1em 1em 0 1em; margin: 1em 0 0 0;">
<%= render :partial => '/shared/shared_object_properties_actions', :locals => {:sharing => sharing, :profile => @profile} %>
</div>
<div style="background-color:#eee; padding: 1em;">
<% if !sharing.shareable.title.blank? %>
<h3><%= link_to sharing.shareable.title, shared_object_path(sharing.shareable.id) %></h3>
<% end %>
<%= sanitize(textilize(sharing.shareable.content[0..500]), :tags => (Tog::Plugins.settings :tog_core, 'sanitized.comments.allowed_tags').split, :attributes => (Tog::Plugins.settings :tog_core, 'sanitized.comments.allowed_attributes').split) %> <%= link_to("More..", shared_object_path(sharing.shareable.id)) unless sharing.shareable.content.size < 500 %>
</div>
<% end %>
</div> <!-- /.detail1 -->
<% content_for :sidebar do %>
<%= render :partial => "shared/profiles_portlet", :locals => {
:items => @profile.friends,
:style => :portletG,
:title => I18n.t('tog_social.profiles.model.friends'),
:no_items => I18n.t('tog_social.profiles.model.friends_not_found', :profile_full_name => @profile.full_name)} %>
<%= render :partial => "shared/profiles_portlet", :locals => {
:items => @profile.followers,
:style => :portletG,
:title => I18n.t('tog_social.profiles.model.followers'),
:no_items => I18n.t('tog_social.profiles.model.followers_not_found', :profile_full_name => @profile.full_name) } %>
<%= render :partial => "shared/profiles_portlet", :locals => {
:items => @profile.followings,
:style => :portletG,
:title => I18n.t('tog_social.profiles.model.followings'),
:no_items => I18n.t('tog_social.profiles.model.followings_not_found', :profile_full_name => @profile.full_name) } %>
<% if @profile.user.sharings.size >= 1 %>
<!--div class="summary"><%= I18n.t('tog_social.profiles.site.summary') %></div-->
<div class="portlet portletC" id="portlet_moreLinks">
<% if !@profile.user.groups.blank? %>
<h2><span><%= I18n.t('tog_social.groups.site.title') %></span></h2>
<div class="portlet_content">
<ul>
<% for group in @profile.user.groups[1..-1] %>
<li><%= link_to group.name, group_path(group) %></li>
<% end %>
</ul>
</div>
<% else %>
<% end %>
</div>
<div class="portlet portletC" id="portlet_moreLinks">
<h2><span><%= I18n.t('tog_social.more_links') %></span></h2>
<div class="portlet_content">
<ul>
<% if its_me? -%>
<li><%= link_to I18n.t('tog_social.profiles.site.edit_profile'), edit_member_profile_path(@profile) %></li>
<% else -%>
<li><%= link_to I18n.t('tog_social.profiles.site.send_message'), member_new_message_to_path(@profile.user) %></li>
<li><%= report_abuse_link @profile %></li>
<li><%= following_options(@profile) %></li>
<% end -%>
</ul>
</div>
</div>
<% end %>
<% end %>