Permalink
Browse files

Fixed some regressions

  • Loading branch information...
brodock authored and stiff committed Dec 24, 2011
1 parent ab9a7fd commit e9048c66f06cd06b215de620017192dbd2f208ee
Showing with 38 additions and 82 deletions.
  1. +2 −2 app/views/topics/_form.html.erb
  2. +36 −80 app/views/topics/show.html.erb
@@ -6,11 +6,11 @@
<%= for_moderators_of @forum do %>
<label style="margin-left:1em;">
- <%= form.check_box :sticky %> <%= I18n.t('txt.sticky', :default => 'sticky') %>
+ <%= form.check_box :sticky %> <%= form.label :sticky, I18n.t('txt.sticky', :default => 'sticky') %>
</label>
<label style="margin-left:1em;">
- <%= form.check_box :locked %> <%= I18n.t('txt.locked', :default => 'locked') %>
+ <%= form.check_box :locked %> <%= form.label :locked, I18n.t('txt.locked', :default => 'locked') %>
</label>
<% end %>
</p>
@@ -1,17 +1,29 @@
<% @page_title = @topic.title %>
<% @monitoring = logged_in? && Monitorship.where(:user_id => current_user.id, :topic_id => @topic.id, :active => true).present? %>
+<% content_for :right do %>
+
+<h5><%= I18n.t 'txt.voices', :default => 'Voices' %></h5>
+<ul class="flat talking">
+<% @topic.voices.each do | user | %>
+ <li><%= link_to user.display_name, user_path(user) %></li>
+<% end %>
+</ul>
+
+
+<% end # right content %>
+
<% if logged_in? %>
- <%= form_tag monitorship_path(@forum, @topic), :style => 'margin-top:0em; float:right;' do %>
- <div>
- <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %>
- onclick="if (this.checked) {<%= remote_function :url => monitorship_path(@forum, @topic) %>} else {<%= remote_function :url => monitorship_path(@forum, @topic), :method => :delete %>}"/>
- <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? I18n.t('txt.monitoring_topic', :default => 'Monitoring topic') : I18n.t('txt.monitor_topic', :default => 'Monitor topic') %></label>
- <%= hidden_field_tag '_method', 'delete' if @monitoring %>
- <%= submit_tag :Set, :id => 'monitor_submit' %>
- </div>
- <% end %>
+<%= form_tag monitorship_path(@forum, @topic), :style => 'margin-top:0em; float:right;' do %>
+<div>
+ <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %>
+ onclick="if (this.checked) {<%= remote_function :url => monitorship_path(@forum, @topic) %>} else {<%= remote_function :url => monitorship_path(@forum, @topic), :method => :delete %>}" />
+ <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? I18n.t('txt.monitoring_topic', :default => 'Monitoring topic') : I18n.t('txt.monitor_topic', :default => 'Monitor topic') %></label>
+ <%= hidden_field_tag '_method', 'delete' if @monitoring %>
+ <%= submit_tag :Set, :id => 'monitor_submit' %>
+</div>
+<% end %>
<% end %>
@@ -22,18 +34,18 @@
<%
page=session[:forum_page] ? session[:forum_page][@topic.forum.id] : nil
if page and page!=1 %>
- <small style="color:#ccc">
- (<%= link_to t('txt.page_nr', :default => 'page %{nr}', :nr => page), forum_path(:id => @topic.forum, :page => page) %>)
- </small>
+ <small style="color:#ccc">
+ (<%= link_to I18n.t('txt.page_nr', :default => 'page %{nr}'), forum_path(:id => @topic.forum, :page => page) %>)
+ </small>
<% end %>
<span class="arrow">&rarr;</span>
</div>
-<h1 id="topic-title" style="margin-top:0.5em;">
+<h1 id="topic-title" style="margin-top:0.5em;"<%= %( onmouseover="$('topic_mod').show();" onmouseout="$('topic_mod').hide();") if logged_in? %>>
<%= @topic.title %>
<% if @topic.locked? %>
- <span>(<%= I18n.t 'txt.topic', :default => 'Topic' %> <%= t 'txt.locked', :default => 'locked' %>)</span>
+ <span>(<%= I18n.t 'txt.topic', :default => 'Topic' %> <%= I18n.t 'txt.locked', :default => 'locked' %>)</span>
<% end %>
<% if logged_in? %>
<span style="display:none;" id="topic_mod">
@@ -130,6 +142,8 @@
</p>
<% else %>
+<p><%= link_to I18n.t('txt.reply_to_topic', :default => 'Reply to topic'), "#reply", :class => "utility", :id => 'reply-link' %></p>
+
<div id="reply" class="editbox">
<div class="container">
<%= content_tag :p, flash[:bad_reply], :class => 'notice' if flash[:bad_reply] %>
@@ -139,81 +153,23 @@
<td rowspan="2" width="70%">
<%= f.text_area :body, :rows => 8 %>
</td>
- <td class="body entry-content" id="post-body-<%= post.id %>">
-
- <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply', :title => t('txt.reply_to_topic', :default => "Reply to topic")), "$('reply').toggle()" if logged_in? && @posts.first == post %>
-
- <% if post.user.active? %>
- <%= post.body_html.html_safe %>
- <% else %>
- <p>(<% I18n.t 'txt.suspended_user_post', :default => 'This post has been removed' %>)</p>
- <% end %>
+ <td valign="top">
+ <%= render :partial => "posts/formatting" %>
</td>
</tr>
- <% end %>
+ <tr>
+ <td valign="bottom" style="padding-bottom:15px;">
+ <%= submit_tag I18n.t('txt.views_topics.save_reply', :default => 'Save reply') %> <span class="button_or"><%= I18n.t 'txt.or', :default => 'or' %> <%= link_to link_to(I18n.t('txt.cancel', :default => 'cancel'), '#', :id => 'reply-cancel') %></span>
+ </td>
+ </tr>
</table>
<% end %>
</div>
</div>
<% end %>
-
-<% if logged_in? %>
- <div id="edit"></div>
- <% if @topic.locked? %>
-
- <p>
- <%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => t('txt.views_topics.topic_locked', :default => "Topic locked") %>
- <label>
- <%= I18n.t 'txt.views_topics.locked_topic', :default => 'This topic is locked.' %></label>
- </p>
-
- <% else %>
-
- <p><%= link_to I18n.t('txt.reply_to_topic', :default => 'Reply to topic'), "#reply", :class => "utility", :id => 'reply-link' %></p>
-
- <div id="reply" class="editbox">
- <div class="container">
- <%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %>
- <%= form_for :post, :url => forum_topic_posts_path(@forum, @topic, :page => @topic.last_page) do |f| %>
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td rowspan="2" width="70%">
- <%= f.text_area :body, :rows => 8 %>
- </td>
- <td valign="top">
- <%= render :partial => "posts/formatting" %>
- </td>
- </tr>
- <tr>
- <td valign="bottom" style="padding-bottom:15px;">
- <%= submit_tag I18n.t('txt.views_topics.save_reply', :default => 'Save reply') %> <span class="button_or"><%= I18n.t 'txt.or', :default => 'or' %> <%= link_to link_to(I18n.t('txt.cancel', :default => 'cancel'), '#', :id => 'reply-cancel') %></span>
- </td>
- </tr>
- </table>
- <% end %>
- </div>
- </div>
-
- <% end %>
<% end %>
<div class="crumbs" style="margin-top:1.1em;">
<%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
<%= link_to @topic.forum.name, forum_path(@topic.forum) %> <span class="arrow">&rarr;</span>
-</div>
-
-<%= javascript_tag(:defer => 'defer') do %>
-Event.observe(window, 'load', function() {
- $('topic-title').observe('mouseover', function(event) { $('topic_mod').show() });
- $('topic-title').observe('mouseout', function(event) { $('topic_mod').hide() });
-});
-<% end if logged_in? %>
-
-<% content_for :right do %>
- <h5><%= I18n.t 'txt.voices', :default => 'Voices' %></h5>
- <ul class="flat talking">
- <% @topic.voices.each do | user | %>
- <li><%= link_to h(user.display_name), user_path(user) %></li>
- <% end %>
- </ul>
-<% end %>
+</div>

0 comments on commit e9048c6

Please sign in to comment.