Skip to content

Commit

Permalink
Major design revamp. Look at those rounded corners, alternating table…
Browse files Browse the repository at this point in the history
… rows... woah!
  • Loading branch information
radar committed Feb 3, 2010
1 parent 5807a54 commit 0f89ae0
Show file tree
Hide file tree
Showing 44 changed files with 460 additions and 457 deletions.
3 changes: 3 additions & 0 deletions app/models/message.rb
@@ -1,6 +1,9 @@
class Message < ActiveRecord::Base
belongs_to :to, :class_name => "User", :foreign_key => :to_id
belongs_to :from, :class_name => "User", :foreign_key => :from_id

# Used for the message view to provide a checkbox.
attr_accessor :selected

validates_presence_of :text

Expand Down
6 changes: 3 additions & 3 deletions app/views/admin/categories/_category.html.haml
@@ -1,7 +1,7 @@
%tr
%tr{ :class => stripe }
%td.icon
= link_to theme_image_tag("edit.jpg"), edit_admin_category_path(category), :id => "edit_category_#{category.id}"
= link_to theme_image_tag("delete.jpg"), admin_category_path(category), :method => "delete", :confirm => t(:confirm_deletion, :thing => "category")
= link_to theme_image_tag("edit.jpg", :alt => t(:Edit), :title => t(:Edit)), edit_admin_category_path(category), :id => "edit_category_#{category.id}"
= link_to theme_image_tag("delete.jpg", :alt => t(:Delete), :title => t(:Delete)), admin_category_path(category), :method => "delete", :confirm => t(:confirm_deletion, :thing => "category")
%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)
Expand Down
17 changes: 5 additions & 12 deletions app/views/admin/categories/edit.html.haml
@@ -1,16 +1,9 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{link_to(t(:Categories), admin_categories_path)} &raquo; #{t(:Editing_a_category)}: #{@category.name}
%span &raquo; #{link_to(t(:Categories), admin_categories_path)} &raquo; #{t(:Editing, :thing => @category.name)}
= error_messages_for :category
- form_for [:admin, @category] do |f|
%table.action-box{:cellpadding => "2", :cellspacing => "0", :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)
%h2
= t(:Editing, :thing => @category.name)
= render :partial => "form", :locals => { :f => f }
= f.submit t(:Update)
4 changes: 2 additions & 2 deletions app/views/admin/categories/index.html.haml
@@ -1,6 +1,6 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{t(:Categories)}
%span &raquo; #{t(:Categories)}
%h2= t(:Categories)
= link_to t(:New, :thing => "Category"), new_admin_category_path
%table.listing.categories{:cellpadding => "3", :cellspacing => "0", :rules => "groups", :width => "100%"}
Expand All @@ -17,6 +17,6 @@
- else
%thead
%tr
%td{:align => "center", :colspan => "3"}
%td{:align => "center", :colspan => "3", :class => "even"}
= t(:no_categories)
= link_to t(:user_should_create), new_admin_category_path
2 changes: 1 addition & 1 deletion app/views/admin/categories/new.html.haml
@@ -1,6 +1,6 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{link_to(t(:Categories), admin_categories_path)} &raquo; #{t(:Creating_a_category)}
%span &raquo; #{link_to(t(:Categories), admin_categories_path)} &raquo; #{t(:Creating_a_category)}
= error_messages_for :category
- form_for [:admin, @category] do |f|
%h2= t(:Creating_a_category)
Expand Down
7 changes: 3 additions & 4 deletions app/views/admin/configurations/index.html.haml
@@ -1,18 +1,17 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{t(:Configuration_Settings)}
%span &raquo; #{t(:Configuration_Settings)}
%h2= t(:Configuration_Settings)
= link_to t(:New, :thing => "Group"), new_admin_group_path
- form_for :configurations, :url => update_all_admin_configurations_path, :html => { :method => :put } do
%table.list-table{:cellpadding => "2", :cellspacing => "0", :rules => "groups", :width => "100%"}
%table.listing{:cellpadding => "2", :cellspacing => "0", :rules => "groups", :width => "100%"}
%thead
%tr
%td Title
%td Value
%td Submit
%tbody
- for configuration in @configurations
%tr
%tr{ :class => stripe}
%td.lalign
%strong= configuration.title
%br
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/forums/_forum.html.haml
@@ -1,4 +1,4 @@
%tr
%tr{ :class => stripe }
%td.icon
= link_to theme_image_tag("edit.jpg"), edit_admin_forum_path(forum)
= link_to theme_image_tag("delete.png"), admin_forum_path(forum), :method => "delete", :confirm => t(:confirm_deletion, :thing => "forum")
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/forums/_forums.html.haml
Expand Up @@ -12,6 +12,6 @@
- else
%thead
%tr
%td{:align => "center", :colspan => "3"}
%td{:align => "center", :colspan => "3", :class => "even"}
= t(:no_forums)
= link_to t(:user_should_create), @category.nil? ? new_admin_forum_path : new_admin_category_forum_path(@category)
2 changes: 1 addition & 1 deletion app/views/admin/forums/edit.html.haml
@@ -1,6 +1,6 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{link_to(t(:Forums), admin_forums_path)} &raquo; #{t(:Editing_a_forum)}: #{@forum.title}
%span &raquo; #{link_to(t(:Forums), admin_forums_path)} &raquo; #{t(:Editing_a_forum)}: #{@forum.title}
= error_messages_for :forum
- form_for [:admin, @forum] do |f|
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/forums/new.html.haml
@@ -1,6 +1,6 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{link_to(t(:Forums), admin_forums_path)} &raquo; #{t(:Creating_a_forum)}
%span &raquo; #{link_to(t(:Forums), admin_forums_path)} &raquo; #{t(:Creating_a_forum)}
- if @category
= t(:for)
= @category.name
Expand Down
18 changes: 7 additions & 11 deletions app/views/admin/groups/_form.html.haml
@@ -1,15 +1,11 @@
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%thead
%tr
%td{:colspan => "6"}
%h2= t(:Editing_a_group)
%tbody
%tr
%td{:colspan => "2"}= f.label :name, t(:Name)
%td{:colspan => "4"}= f.text_field "name"
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%p
= f.label :name, t(:Name)
%br
= f.text_field "name"

%table.listing{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%thead
%tr
%td{:colspan => "10"}
%h2= t(:Global_Permissions)
%h3= t(:Global_Permissions)
= render :partial => "admin/permissions/form"
8 changes: 2 additions & 6 deletions app/views/admin/groups/edit.html.haml
@@ -1,11 +1,7 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{link_to(t(:Groups), admin_groups_path)} &raquo; #{t(:Editing_a_group)}
%span &raquo; #{link_to(t(:Groups), admin_groups_path)} &raquo; #{t(:Editing_a_group)}
= error_messages_for :group
- form_for [:admin, @group] do |f|
= render :partial => "form", :locals => { :f => f }
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%tfoot
%tr
%td{:colspan => "6"}
= submit_tag t(:Update)
= submit_tag t(:Update)
9 changes: 4 additions & 5 deletions app/views/admin/groups/index.html.haml
@@ -1,9 +1,9 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{t(:Groups)}
%span &raquo; #{t(:Groups)}
%h2= t(:Groups)
= link_to t(:New, :thing => "Group"), new_admin_group_path
%table.list-table{:cellpadding => "2", :cellspacing => "0", :rules => "groups", :width => "100%"}
%table.groups.listing{:cellpadding => "2", :cellspacing => "0", :rules => "groups", :width => "100%"}
%thead
%tr
%td &nbsp;
Expand All @@ -12,11 +12,10 @@
%td Members
%tbody
- for group in @groups
%tr
%tr{ :class => stripe }
%td
= link_to theme_image_tag("permissions.jpg", :alt => t(:Permissions), :title => t(:Permissions)), admin_group_permissions_path(group)
= link_to theme_image_tag("edit.jpg", :alt => t(:Edit), :title => t(:Edit)), edit_admin_group_path(group)
= link_to theme_image_tag("delete.jpg", :alt => t(:Edit), :title => t(:Edit)), admin_group_path(group), :method => "delete", :confirm => t(:confirm_deletion, :thing => "group")
= link_to theme_image_tag("delete.jpg", :alt => t(:Delete), :title => t(:Delete)), admin_group_path(group), :method => "delete", :confirm => t(:confirm_deletion, :thing => "group")
%td= group.name
%td= link_to group.owner, admin_user_path(group.owner) unless group.owner.nil?
%td= link_to pluralize(group.users.count, "member"), admin_group_users_path(group), :id => "members_for_#{group.identifier}"
2 changes: 1 addition & 1 deletion app/views/admin/groups/new.html.haml
@@ -1,6 +1,6 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{link_to(t(:Groups), admin_groups_path)} &raquo; #{t(:Creating_a_group)}
%span &raquo; #{link_to(t(:Groups), admin_groups_path)} &raquo; #{t(:Creating_a_group)}
= error_messages_for :group
- form_for [:admin, @group] do |f|
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/ips/index.html.haml
@@ -1,5 +1,5 @@
.breadcrumbs
""#{link_to t(:Administration_Section), admin_root_path} &raquo; #{link_to t(:Users), admin_users_path} &raquo; #{link_to @user, admin_user_path(@user)} &raquo; #{t(:IPs)}
#{link_to t(:Administration_Section), admin_root_path} &raquo; #{link_to t(:Users), admin_users_path} &raquo; #{link_to @user, admin_user_path(@user)} &raquo; #{t(:IPs)}
%h2
= t(:IPs)
= t(:for)
Expand Down
49 changes: 24 additions & 25 deletions app/views/admin/permissions/_form.html.haml
@@ -1,42 +1,41 @@
- if params[:type] == "category"
%tr
%td= f.label "category_id", t(:Category)
%td{:colspan => "7"}= f.select "category_id", @categories.map { |c| [c.name, c.id] }
%td{:class => stripe }= f.label "category_id", t(:Category)
%td{:class => stripe, :colspan => "9"}= f.select "category_id", @categories.map { |c| [c.name, c.id] }
- elsif params[:type] == "forum"
%tr
%td= f.label "forum_id", t(:Forum)
%td{:colspan => "7"}= f.select "forum_id", @forums.map { |c| [c.title, c.id] }
%td{:class => stripe }= f.label "forum_id", t(:Forum)
%td{:class => stripe, :colspan => "9"}= f.select "forum_id", @forums.map { |c| [c.title, c.id] }
- fields_for @permission do |permission|
- ## Global only permissions
- if params[:type] || @permission.new_record?
- if !params[:type]
%tr
%td{:colspan => "10"}
%h3 Section Access
%td{:colspan => "10", :class => "header"}
%h3= t(:Section_access)
- sections.in_groups_of(5, false) do |sections|
%tr
- for section in sections
%td{:width => "20px", :class => stripe }= permission.check_box "can_access_#{section}_section"
%td{ :class => stripe }= permission.label "can_access_#{section}_section", t("can_access_#{section}_section?")
- for management in managements[0..2]
= render :partial => "admin/permissions/management", :locals => { :management => management, :permission => permission }
- managements[2..-1].in_groups_of(5, false) do |managements|
%tr
- for management in managements
= render :partial => "admin/permissions/management", :locals => { :management => management, :permission => permission }
%tr
- sections.each_with_index do |section, count|
%td{:width => "20px"}= permission.check_box "can_access_#{section}_section"
%td= permission.label "can_access_#{section}_section", t("can_access_#{section}_section?")
= break_row(count)
- managements.each_with_index do |management, count|
%td{:width => "20px"}= permission.check_box "can_manage_#{management}"
%td= permission.label "can_manage_#{management}", t("can_manage_#{management}?")
- ## Magic number "3" is because of 5 columns - the 2 sections = 3
= break_row(3)
- 4.times do
%td &nbsp;
%tr
%td{:colspan => "10"}
%td{:colspan => "10", :class => "header"}
%h3= t(:Systemwide_Permissions)
- global_permissions.each_with_index do |action, count|
%td{:width => "20px"}= permission.check_box action
%td= permission.label action, t("#{action}?")
%td{:width => "20px", :class => stripe }= permission.check_box action
%td{ :class => stripe }= permission.label action, t("#{action}?")
= break_row(count)
- ## Global or local permissions
%tr
%td{:colspan => "10"}
%td{:colspan => "10", :class => "header"}
%h3= t(:Forum_Permissions)
%tr
- forum_permissions.each_with_index do |action, count|
%td{:width => "20px"}= permission.check_box action
%td= permission.label action, t("#{action}?")
%td{ :class => stripe, :width => "20px"}= permission.check_box action
%td{ :class => stripe }= permission.label action, t("#{action}?")
= break_row(count)
6 changes: 3 additions & 3 deletions app/views/admin/permissions/index.html.haml
Expand Up @@ -7,15 +7,15 @@
- if @object.is_a?(Group)
%h3= t(:Global_Permissions)
= link_to "Edit Global Permissions", edit_admin_group_path(@object)
%table.list-table{:cellpadding => "3", :cellspacing => "0", :rules => "groups", :width => "100%"}
%table.listing{:cellpadding => "3", :cellspacing => "0", :rules => "groups", :width => "100%"}
%thead
%tr
%td= t(:can_see_forum?)
%td= t(:can_see_category?)
%td= t(:can_reply_to_topics?)
%td= t(:can_start_new_topics?)
%tbody
%tr
%tr{ :class => "even"}
%td= theme_image_tag(@object.permissions.global.can_see_forum?.to_s + ".jpg")
%td= theme_image_tag(@object.permissions.global.can_see_category?.to_s + ".jpg")
%td= theme_image_tag(@object.permissions.global.can_reply_to_topics?.to_s + ".jpg")
Expand All @@ -25,7 +25,7 @@
%h3= t(:No_forums_to_assign_specific_permissions_to)
%h3= t(:Forum_specific_permissions)
= link_to t(:New, :thing => t(:Forum_specific_permissions)), new_admin_group_permission_path(@object, :type => "forum")
%table.list-table{:cellpadding => "3", :cellspacing => "0", :rules => "groups", :width => "100%"}
%table.listing{:cellpadding => "3", :cellspacing => "0", :rules => "groups", :width => "100%"}
- if @object.permissions.forums.empty?
%thead
%tr
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/permissions/new.html.haml
@@ -1,6 +1,6 @@
- form_for [:admin, @object, @permission] do |f|
= error_messages_for :permission
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%table.listing.permissions{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%thead
%tr
%td{:colspan => "10"}
Expand Down
8 changes: 4 additions & 4 deletions app/views/admin/ranks/index.html.haml
@@ -1,9 +1,9 @@
.breadcrumbs
= link_to t(:Administration_Section), admin_root_path
\&raquo; #{t(:Ranks)}
%span &raquo; #{t(:Ranks)}
%h2 Ranks
= link_to t(:New, :thing => "Rank"), new_admin_rank_path
%table.list-table{:cellpadding => "5", :cellspacing => "0", :rules => "groups", :width => "100%"}
%table.listing.ranks{:cellpadding => "3", :cellspacing => "0", :rules => "groups", :width => "100%"}
%thead
%tr
%td &nbsp;
Expand All @@ -13,7 +13,7 @@
%tbody
- unless @ranks.empty?
- for rank in @ranks
%tr
%tr{ :class => stripe }
%td.icon
= link_to(theme_image_tag("edit.jpg"), edit_admin_rank_path(rank))
= link_to(theme_image_tag("delete.jpg"), admin_rank_path(rank), :method => "delete", :confirm => t(:confirm_deletion, :thing => "rank"))
Expand All @@ -22,7 +22,7 @@
%td= rank.custom ? t(:yes) : t(:no)
- else
%tr
%td{:colspan => "4"}
%td{:colspan => "4", :align => "center", :class => "even"}
%b
= t(:no_ranks)
= link_to t(:user_should_create), new_admin_rank_path
6 changes: 3 additions & 3 deletions app/views/admin/themes/index.html.haml
Expand Up @@ -2,21 +2,21 @@
= link_to t(:Administration_Section)
\&raquo; #{t(:Themes)}
%h2= t(:Themes)
%table.list-table{:cellpadding => "2", :cellspacing => "0", :rules => "groups", :width => "100%"}
%table.listing.themes{:cellpadding => "2", :cellspacing => "0", :rules => "groups", :width => "100%"}
%thead
%tr
%td= t(:Name)
%td= t(:Is_default)
%tbody
- unless @themes.empty?
- for theme in @themes
%tr
%tr{ :class => stripe }
%td= theme.name
%td
- if theme.is_default?
= t(:yes)
- else
= link_to t(:make_default), make_default_admin_theme_path(theme), :method => "put"
= link_to t(:Make_default), make_default_admin_theme_path(theme), :method => "put"
- else
%tr
%td{:colspan => "4"}= t(:no_themes)
36 changes: 13 additions & 23 deletions app/views/admin/users/ban_ip.html.haml
@@ -1,28 +1,18 @@
- form_for @banned_ip, :url => ban_ip_admin_users_path do |f|
= error_messages_for :banned_ip
%table.action-box{:cellpadding => "2", :cellspacing => "0", :width => "100%"}
%thead
%tr
%td{:colspan => "2"}
%h2= t(:Ban_an_ip)
%tbody
%tr
%td= f.label "ip", t(:IP)
%td
= f.text_field "ip", :value => params[:ip]
= t(:accepts_wildcard)
%tr
%td= f.label "ban_time", t(:Ban_time)
%td
= f.text_field "ban_time"
= observe_field("banned_ip_ban_time", :frequency => 0.5, :url => admin_chronic_path, :with => "duration", :update => "date")
#date
%tr
%td= f.label "reason", t(:Reason)
%td= f.text_field "reason"
%tfoot
%tr
%td{:colspan => "2"}= submit_tag(t(:Ban_this_range))
%h2= t(:Ban_an_ip)
%p
= f.label "ip", t(:IP)
= f.text_field "ip", :value => params[:ip]
= t(:accepts_wildcard)
%p
= f.label "ban_time", t(:Ban_time)
= f.text_field "ban_time"
= observe_field("banned_ip_ban_time", :frequency => 0.5, :url => admin_chronic_path, :with => "duration", :update => "date")
%p
= f.label "reason", t(:Reason)
= f.text_field "reason"
= submit_tag(t(:Ban_this_range))
%h2= t(:Banned_IPs)
- unless @banned.empty?
%ul
Expand Down

0 comments on commit 0f89ae0

Please sign in to comment.