publish.html.erb
2.91 KB
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
<div class="select-publish-target">
<h2><%= _('Where do you want to publish this article?') %></h2>
<% if !@failed.blank? %>
<div class="errorExplanation" id="errorExplanation">
<p><%=_("There were errors with the following communities: ")%></p>
<% @failed.each do |error, communities|%>
<strong> <%= error %>: </strong>
<ul>
<% communities.each do |community| %>
<li> <%= community %> </li>
<% end %>
</ul>
<% end %>
</div>
<% end %>
<ul class='publish-targets'>
<% if profile != user %>
<li onmouseover="javascript: jQuery(this).addClass('mouseover')" onmouseout="jQuery(this).removeClass('mouseover')">
<strong><%= _("Publish this article on your profile") %></strong>
<div class='description'><%= _('You can publish this article on your profile where your friends and followers will see.') %></div>
<%= form_tag do %>
<%= hidden_field_tag :back_to, @back_to %>
<%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %>
<% button_bar do %>
<%= submit_button 'spread', _('Spread this') %>
<% end %>
<% end %>
</li>
<% end %>
<% if user.communities.present? %>
<li onmouseover="javascript: jQuery(this).addClass('mouseover')" onmouseout="jQuery(this).removeClass('mouseover')">
<strong><%= _("Publish this article on communities you are part of") %></strong>
<div class='description'><%= _('You can submit this article to one or more communities you are a member of, just search for the community below.') %></div>
<%= form_tag :action => 'publish_on_communities', :id => @article.id do %>
<%= hidden_field_tag :back_to, @back_to %>
<% search_action = url_for(:action => 'search_communities_to_publish') %>
<%= token_input_field_tag(:q, 'search-communities-to-publish', search_action, { :hint_text => _('Type in a search for your community'), :zindex => 10000, :focus => false }) %>
<%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %>
<% button_bar do %>
<%= submit_button 'spread', _('Spread this') %>
<% end %>
<% end %>
</li>
<% end %>
<% if environment.portal_enabled %>
<li onmouseover="javascript: jQuery(this).addClass('mouseover')" onmouseout="jQuery(this).removeClass('mouseover')">
<strong><%= _("Publish your article on portal community") %></strong>
<div class='description'><%= _('You can suggest this article to the portal community, where it can show up on the homepage.') %></div>
<%= form_tag :action => 'publish_on_portal_community', :id => @article.id do %>
<%= hidden_field_tag :back_to, @back_to %>
<%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %>
<% button_bar do %>
<%= submit_button 'spread', _('Spread this') %>
<% end %>
<% end %>
</li>
<% end %>
</ul>
</div>