Skip to content

Commit

Permalink
Reverting HAML stuff, keeping the code around to add it back one day
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.typosphere.org/typo/trunk@1374 820eb932-12ee-0310-9ca8-eeb645f39767
  • Loading branch information
Frédéric de Villamil committed Feb 19, 2007
1 parent 852d867 commit 9f6fb53
Show file tree
Hide file tree
Showing 307 changed files with 495 additions and 8,756 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/content_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def category_remove

def preview
headers["Content-Type"] = "text/html; charset=utf-8"
@article = this_blog.articles.build
@article = this_blog.articles.build
@article.attributes = params[:article]
set_article_author
data = render_to_string(:layout => "minimal")
Expand Down
13 changes: 6 additions & 7 deletions app/helpers/articles_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def admin_tools_for(model)
tag << content_tag("div",
link_to_remote('nuke', {
:url => { :action => "nuke_#{type}", :id => model },
:complete => visual_effect(:puff, "#{type}_#{model.id}", :duration => 0.6),
:complete => visual_effect(:puff, "#{type}-#{model.id}", :duration => 0.6),
:confirm => "Are you sure you want to delete this #{type}?"
}, :class => "admintools") <<
link_to('edit', {
Expand All @@ -19,12 +19,11 @@ def admin_tools_for(model)
tag.join(" | ")
end

def admin_tools_mouseover(type, id = nil)
"if (getCookie('is_admin') == 'yes') { Element.show('admin_#{[type, id].compact.join('_')}'); }"
end

def admin_tools_mouseout(type, id = nil)
"Element.hide('admin_#{[type, id].compact.join('_')}');"
def onhover_show_admin_tools(type, id = nil)
tag = []
tag << %{ onmouseover="if (getCookie('is_admin') == 'yes') { Element.show('admin_#{[type, id].compact.join('_')}'); }" }
tag << %{ onmouseout="Element.hide('admin_#{[type, id].compact.join('_')}');" }
tag
end

def render_errors(obj)
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/content/_form.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</li>
<li>
<label for="article_body">Body:</label>
<%= markup_help_popup @article.text_filter, image_tag ('help.png', :alt => "markup help", :title => "Markup Help") %>
<%= markup_help_popup @article.text_filter, image_tag('help.png', :alt => "markup help", :title => "Markup Help") %>
<%= text_area 'article', 'body', :rows => 25, :style => 'width: 100%;' %>
</li>
<li id="extended"<%- if @article.extended.blank? -%> style="display:none;"<%- end -%>>
Expand Down
7 changes: 0 additions & 7 deletions app/views/admin/content/preview.haml

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/admin/content/preview.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h4><%= @article[:title] %></h4>

<%= @article.html %>
2 changes: 1 addition & 1 deletion app/views/admin/pages/_form.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</li>
<li>
<label for="page_body">Body:</label>
<%= markup_help_popup @page.text_filter, image_tag ('help.png', :alt => " markup help", :title => "Markup help") %>
<%= markup_help_popup @page.text_filter, image_tag('help.png', :alt => " markup help", :title => "Markup help") %>
<%= text_area 'page', 'body', :rows => 25, :style => 'width: 100%;' %>
</li>
</ul>
Expand Down
5 changes: 0 additions & 5 deletions app/views/articles/_article.haml

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/articles/_article.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h2><%= link_to_permalink article,article.title %></h2>
<p class="auth">Posted by <%= author_link(article) %>
<%= js_distance_of_time_in_words_to_now article.published_at %></p>
<%= html article, :body %>
19 changes: 0 additions & 19 deletions app/views/articles/_comment.haml

This file was deleted.

10 changes: 10 additions & 0 deletions app/views/articles/_comment.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<li id="comment-<%= comment.id %>" <%= 'class="author_comment"' if comment.user %> <%= 'style="display:none"' if controller.request.xhr? %><%= onhover_show_admin_tools(:comment, comment.id) %>>
<%= admin_tools_for comment %>
<a name="comment-<%= comment.id %>"></a>
<%= gravatar_tag(comment.email) if this_blog.use_gravatar and comment.email %>
<cite><strong><%= link_to_unless(comment.url.blank?, h(comment.author), comment.url) %></strong> </cite> said <%= distance_of_time_in_words comment.article.published_at, comment.created_at %> later:<br />
<%= comment.generate_html(:body) %>
<% unless comment.published -%>
<div class="spamwarning">This comment has been flagged for moderator approval. It won't appear on this blog until the author approves it.</div>
<% end -%>
</li>
44 changes: 0 additions & 44 deletions app/views/articles/_comment_box.haml

This file was deleted.

44 changes: 44 additions & 0 deletions app/views/articles/_comment_box.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<%= form_remote_tag :url => {:action => "comment", :id => @article},
:position=> :bottom,
:update => {:success => 'commentList'},
:loading => "loading()",
:complete => "complete(request)",
:failure => "failure(request)",
:html => {:id=>"commentform",:class=>"commentform"} %>


<div class="comment-box">
<div id="errors"></div>
<div id="preview" style="display: none"></div>

<a name="respond"></a>
<table cellpadding="4" cellspacing="0" class="frm-tbl">
<tr>
<td><p><label for="comment_author">Your name</label></p></td>
<td> <%= text_field "comment", "author", :size => 20 %> <small><%= link_to_function("(leave url/email &#187;)", "Element.toggle('guest_url'); Element.toggle('guest_email')") %></small></td>
</tr>
<tr id="guest_url" style="display:none;">
<td><p><label for="comment_url">Your blog</label></p></td>
<td> <%= text_field "comment", "url" %></td>
</tr>
<tr id="guest_email" style="display:none;">
<td><p><label for="comment_email">Your email</label></p></td>
<td> <%= text_field "comment", "email" %></td>
</tr>
<tr>
<td><p><label for="comment_body">Your message</label></p></td>
<td valign="top" colspan="2">
<%= text_area "comment", "body" %>
</td>
</tr>
<tr>
<td colspan="2" id="frm-btns">
<span id="comment_loading" style="display:none;"><%= image_tag "spinner.gif" %></span>&nbsp;&nbsp;
<%= markup_help_popup TextFilter.find_by_name(this_blog.comment_text_filter), "Comment Markup Help" %>
<a href="#" onclick="new Ajax.Updater('preview', '<%= url_for :action => 'comment_preview' %>', {asynchronous:true, evalScripts:true, parameters:Form.serialize('commentform'), onComplete:function(request){Element.show('preview')}}); return false;">Preview comment</a>
<input type="submit" name="submit" id="form-submit-button" value="submit" class="button" />
</td>
</tr>
</table>
</div>
<%= end_form_tag %>
1 change: 0 additions & 1 deletion app/views/articles/_comment_error.haml

This file was deleted.

1 change: 1 addition & 0 deletions app/views/articles/_comment_error.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= error_messages_for("comment") %>
9 changes: 0 additions & 9 deletions app/views/articles/_trackback.haml

This file was deleted.

7 changes: 7 additions & 0 deletions app/views/articles/_trackback.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<li id="trackback-<%= trackback.id %>"<%= onhover_show_admin_tools(:trackback, trackback.id) %>>
<%= admin_tools_for trackback %>
<a name="trackback-<%= trackback.id %>"></a>
From <strong><%= trackback.blog_name %></strong><br />
<a href="<%= trackback.url %>" rel="nofollow"><%=h trackback.title %></a><br/>
<%= trackback.excerpt %>
</li>
18 changes: 0 additions & 18 deletions app/views/articles/archives.haml

This file was deleted.

22 changes: 22 additions & 0 deletions app/views/articles/archives.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<% if @articles.to_a.empty? -%>
<div class="post">
<p>No articles found...</p>
</div>
<% else
currentmonth = 0
currentyear = 0
for article in @articles
if (article.published_at.month != currentmonth || article.published_at.year != currentyear)
currentmonth = article.published_at.month
currentyear = article.published_at.year -%>
<h3 class="archivemonth"><%= Date::MONTHNAMES[article.published_at.month] %> <%= article.published_at.year %></h3>
<% end -%>
<div class="archivepost">
<%= article.published_at.mday %> -
<%= link_to_permalink(article,h(article.title)) %>
<% if !article.categories.empty? %> posted in
<%= article.categories.collect {|c| link_to_permalink c,c.name }.join(", ") -%>
<% end -%>
</div>
<% end
end -%>
6 changes: 0 additions & 6 deletions app/views/articles/comment_preview.haml

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/articles/comment_preview.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%= gravatar_tag(@comment.email) if this_blog.use_gravatar and @comment.email %>
<cite><strong><%=h @comment[:author] %></strong></cite> is about to say:<br />
<%= @comment.html %>
2 changes: 0 additions & 2 deletions app/views/articles/error.haml

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/articles/error.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="post">
<p><%= @message %></p>
</div>
12 changes: 0 additions & 12 deletions app/views/articles/groupings.haml

This file was deleted.

14 changes: 14 additions & 0 deletions app/views/articles/groupings.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="entry">
<% unless @groupings.empty? -%>
<% max_counter = @groupings[0].article_counter -%>
<%= ul_tag_for @grouping_class %>
<% for grp in @groupings.sort_by{|grp|grp.display_name} -%>
<li class="<%= calc_distributed_class(grp.article_counter, max_counter, @grouping_class, 0, 10) %>">
<%= link_to_grouping(grp) %>
</li>
<% end -%>
</ul>
<% else -%>
<p>There are <%= @grouping_class.to_s.underscore.pluralize %>.</p>
<% end -%>
</div>
10 changes: 0 additions & 10 deletions app/views/articles/index.haml

This file was deleted.

11 changes: 11 additions & 0 deletions app/views/articles/index.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% for article in @articles -%>
<div class="post">
<%= render_partial "article", article %>
<%= link_to_permalink article,"Read more..." if article.extended? %>
<p class="meta"><%= article_links article %></p>
</div>
<% end -%>
<% unless @pages.item_count <= this_blog.limit_article_display %>
<p id="pagination">Older posts: <%= pagination_links @pages, :params => { :action => @controller.action_name } %></p>
<% end -%>
61 changes: 0 additions & 61 deletions app/views/articles/read.haml

This file was deleted.

Loading

0 comments on commit 9f6fb53

Please sign in to comment.