publish.html.erb
3.46 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<script type="text/javascript" charset="utf-8">
jQuery(document).ready( function() {
jQuery('.publish-article-title').find('label')
.click( function(event) {
if (this == event.target) {
jQuery(this).toggleClass('expanded');
jQuery(this).next('input').slideToggle();
}
return false;
}).addClass('collapsed').next('input').hide();
});
</script>
<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 %>
<div class='publish-article-title'>
<%= labelled_text_field _('Title'), 'name', @article.name %>
</div>
<% 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 }) %>
<div class='publish-article-title'>
<%= labelled_text_field _('Title'), 'name', @article.name %>
</div>
<% button_bar do %>
<%= submit_button 'spread', _('Spread this') %>
<% end %>
<% end %>
</li>
<% end %>
<% if @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 %>
<div class='publish-article-title'>
<%= labelled_text_field _('Title'), :name, @article.name %>
</div>
<% button_bar do %>
<%= submit_button 'spread', _('Spread this') %>
<% end %>
<% end %>
</li>
<% end %>
</ul>
</div>