Skip to content

Commit

Permalink
All views converted over to haml.
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Feb 2, 2009
1 parent f7c22a0 commit 0b44dcc
Show file tree
Hide file tree
Showing 135 changed files with 1,801 additions and 1,665 deletions.
27 changes: 0 additions & 27 deletions app/views/admin/categories/_category.html.erb

This file was deleted.

18 changes: 18 additions & 0 deletions app/views/admin/categories/_category.html.haml
@@ -0,0 +1,18 @@
%tr
%td.icon
= link_to theme_image_tag("edit.jpg"), edit_admin_category_path(category)
= link_to theme_image_tag("delete.jpg"), admin_category_path(category), :method => "delete", :confirm => t(:confirm_category_deletion)
%td{ :style => "text-align:left !important" }
= theme_image_tag("extender.jpg", :style => "padding-left:#{depth*20}px") if extender
= link_to category.name, admin_category_path(category)
%td
= link_to(pluralize(category.forums.count, "forum"), admin_category_path(category))
%td
- unless category.first?
= link_to theme_image_tag("top.jpg"), move_to_top_admin_category_path(category), :method => :put
= link_to theme_image_tag("up.jpg"), move_up_admin_category_path(category), :method => :put
= category.position
- unless category.last?
= link_to theme_image_tag("down.jpg"), move_down_admin_category_path(category), :method => :put
= link_to theme_image_tag("bottom.jpg"), move_to_bottom_admin_category_path(category), :method => :put
= render :partial => category.children.sort_by(&:position), :locals => { :extender => true, :depth => depth+1 }
6 changes: 0 additions & 6 deletions app/views/admin/categories/_form.html.erb

This file was deleted.

6 changes: 6 additions & 0 deletions app/views/admin/categories/_form.html.haml
@@ -0,0 +1,6 @@
%tbody
%tr
%td
= f.label "name"
%td
= f.text_field "name"
11 changes: 0 additions & 11 deletions app/views/admin/categories/edit.html.erb

This file was deleted.

22 changes: 22 additions & 0 deletions app/views/admin/categories/edit.html.haml
@@ -0,0 +1,22 @@
= link_to t(:admin_section), admin_root_path
\->
= link_to(t(:Categories), admin_categories_path)
\->
= t(:Editing_a_category)
\:
= @category.name
= error_messages_for :category
- form_for [:admin, @category] do |f|
%table.action-box{ :cellspacing => "0", :cellpadding => "2", :width => "100%" }
%thead
%tr
%td{ :colspan => "2" }
%h2
= t(:Editing_a_category)
\:
= @category.name
= render :partial => "form", :locals => { :f => f }
%tfoot
%tr
%td{ :colspan => "2" }
= f.submit t(:Update)
24 changes: 0 additions & 24 deletions app/views/admin/categories/index.html.erb

This file was deleted.

26 changes: 26 additions & 0 deletions app/views/admin/categories/index.html.haml
@@ -0,0 +1,26 @@
= link_to t(:admin_section), admin_root_path
\->
= t(:Categories)
%h2
= t(:Categories)
= link_to t(:New_Category), new_admin_category_path
%table.list-table{ :cellspacing => "0", :rules => "groups", :cellpadding => "3", :width => "100%" }
- unless @categories.empty?
%thead
%tr
%td
\ 
%td
= t(:Name)
%td
= t(:Forums)
%td
= t(:Position)
%tbody
= render :partial => @categories, :locals => { :depth => 0, :extender => false }
- else
%thead
%tr
%td{ :align => "center", :colspan => "3" }
= t(:no_categories)
= link_to t(:user_should_create), new_admin_category_path
11 changes: 0 additions & 11 deletions app/views/admin/categories/new.html.erb

This file was deleted.

18 changes: 18 additions & 0 deletions app/views/admin/categories/new.html.haml
@@ -0,0 +1,18 @@
= link_to t(:admin_section), admin_root_path
\->
= link_to(t(:Categories), admin_categories_path)
\->
= t(:Creating_a_category)
= error_messages_for :category
- form_for [:admin, @category] do |f|
%table.action-box{ :cellspacing => "0", :cellpadding => "2", :width => "100%" }
%thead
%tr
%td{ :colspan => "2" }
%h2
= t(:Creating_a_category)
= render :partial => "form", :locals => { :f => f }
%tfoot
%tr
%td{ :colspan => "2" }
= f.submit t(:Create)
4 changes: 0 additions & 4 deletions app/views/admin/categories/show.html.erb

This file was deleted.

6 changes: 6 additions & 0 deletions app/views/admin/categories/show.html.haml
@@ -0,0 +1,6 @@
%h2
= t(:Forums)
= t(:for)
= @category.name
= link_to t(:New_Forum), new_admin_category_forum_path(@category)
= render :partial => "admin/forums/forums"
35 changes: 0 additions & 35 deletions app/views/admin/forums/_form.html.erb

This file was deleted.

27 changes: 27 additions & 0 deletions app/views/admin/forums/_form.html.haml
@@ -0,0 +1,27 @@
%tbody
%tr
%td= f.label :title, t(:Title)
%td= f.text_field "title"
%tr
%td{ :valign => "top" }= f.label :description, t(:Description)
%td= f.text_area "description", :cols => 40, :rows => 5
%tr
%td= f.label :is_visible_to_id, t(:Is_visible_to)
%td= f.select "is_visible_to_id", @user_levels.map { |u| [u.name, u.id] }
%tr
%td
= f.label :topics_created_by_id, t(:Topics_created_by)
%td
= f.select "topics_created_by_id", @user_levels.map { |u| [u.name, u.id] }
- unless @forums.empty?
%tr
%td
= f.label :parent_id, t(:Child_of)
%td
= f.select "parent_id", @forums.map { |forum| [select_display(forum),forum.id] }, :include_blank => true
- unless @category
%tr
%td
= f.label :category_id, t(:Category)
%td
= f.select "category_id", @categories.map { |category| [select_display(category, 'name'), category.id] }, :include_blank => true
22 changes: 0 additions & 22 deletions app/views/admin/forums/_forum.html.erb

This file was deleted.

24 changes: 24 additions & 0 deletions app/views/admin/forums/_forum.html.haml
@@ -0,0 +1,24 @@
%tr
%td.icon
= link_to theme_image_tag("edit.jpg"), edit_admin_forum_path(forum)
= link_to theme_image_tag("delete.jpg"), admin_forum_path(forum), :method => "delete", :confirm => t(:confirm_forum_deletion)
%td{ :style => "text-align:left !important" }
= theme_image_tag("extender.jpg", :style => "padding-left:#{depth*20}px") if extender
= link_to forum.title, forum_path(forum)
%td
= forum.is_visible_to
%td
= forum.topics_created_by
%td
= forum.topics.size
%td
= forum.posts.size
%td
- unless forum.first?
= link_to theme_image_tag("top.jpg"), move_to_top_admin_forum_path(forum), :method => :put
= link_to theme_image_tag("up.jpg"), move_up_admin_forum_path(forum), :method => :put
= forum.position
- unless forum.last?
= link_to theme_image_tag("down.jpg"), move_down_admin_forum_path(forum), :method => :put
= link_to theme_image_tag("bottom.jpg"), move_to_bottom_admin_forum_path(forum), :method => :put
= render :partial => forum.children.sort_by(&:position), :locals => { :extender => true, :depth => depth+1 }
24 changes: 0 additions & 24 deletions app/views/admin/forums/_forums.html.erb

This file was deleted.

19 changes: 19 additions & 0 deletions app/views/admin/forums/_forums.html.haml
@@ -0,0 +1,19 @@
%table.list-table{ :cellspacing => "0", :rules => "groups", :cellpadding => "3", :width => "100%" }
- unless @forums.empty?
%thead
%tr
%td  
%td= t(:Title)
%td= t(:Is_visible_to)
%td= t(:Creator)
%td= t(:Topics)
%td= t(:Posts)
%td= t(:Position)
%tbody
= render :partial => "admin/forums/forum", :collection => @forums, :locals => { :depth => 0, :extender => false }
- else
%thead
%tr
%td{ :align => "center", :colspan => "3" }
= t(:no_forums)
= link_to t(:user_should_create), @category.nil? ? new_admin_forum_path : new_admin_category_forum_path(@category)
15 changes: 0 additions & 15 deletions app/views/admin/forums/edit.html.erb

This file was deleted.

22 changes: 22 additions & 0 deletions app/views/admin/forums/edit.html.haml
@@ -0,0 +1,22 @@
= link_to t(:admin_section), admin_root_path
\->
= link_to(t(:Forums), admin_forums_path)
\->
= t(:Editing_a_forum)
\:
= @forum.title
= error_messages_for :forum
- form_for [:admin, @forum] do |f|
%table.action-box{ :cellspacing => "0", :cellpadding => "2", :width => "100%" }
%thead
%tr
%td{ :colspan => "2" }
%h2
= t(:Editing_a_forum)
\:
= @forum.title
= render :partial => "form", :locals => { :f => f }
%tfoot
%tr
%td{ :colspan => "2" }
= submit_tag(t(:Update))

0 comments on commit 0b44dcc

Please sign in to comment.