2014-03-23 00:22:25 +00:00
|
|
|
<% if cuser %>
|
|
|
|
<% if cuser.banned? Ban::TYPE_MUTE %>
|
|
|
|
You have been muted.
|
|
|
|
<% else %>
|
|
|
|
<% scroll = shoutmsg.domain == "shoutbox" ? "" : "$('#{shoutmsg.domain}').scrollTop = $('#{shoutmsg.domain}').scrollHeight;" %>
|
2014-04-15 09:59:52 +00:00
|
|
|
<%= form_for(shoutmsg, remote: true, html: { id: "new_#{shoutmsg.domain}", class: 'new-shout' }) do |f| %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% if shoutmsg.shoutable %>
|
|
|
|
<%= f.hidden_field :shoutable_type %>
|
|
|
|
<%= f.hidden_field :shoutable_id %>
|
|
|
|
<% end %>
|
2014-04-09 00:50:07 +00:00
|
|
|
<div class="fields">
|
2014-04-05 00:03:13 +00:00
|
|
|
<%= f.text_field :text, size: 12, id: "#{shoutmsg.domain}_text", class: "shout_input" %>
|
2014-04-09 00:50:07 +00:00
|
|
|
</div>
|
|
|
|
<div class="controls">
|
2014-03-23 00:22:25 +00:00
|
|
|
<%= submit_tag "Shout!" %>
|
2014-04-09 00:50:07 +00:00
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2015-05-09 15:20:51 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
2015-05-09 15:43:02 +00:00
|
|
|
ShoutboxController({
|
2015-05-09 15:20:51 +00:00
|
|
|
context: $('<%= "#new_#{shoutmsg.domain}" %>')
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|