From 7e5e3ca609e3c3cb40b197fe9b5b9c1265ad0000 Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Sat, 3 Mar 2012 04:24:57 +0400 Subject: [PATCH] [issue #195] Fixed another creating bug... I feel like a slipper-man... --- app/views/projects/_form.html.haml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index fe9d5a284..0c0c1fb58 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -15,12 +15,16 @@ = f.label :owner_id, t("activerecord.attributes.project.owner"), :class => :label .rightlist = label_tag t("activerecord.attributes.project.who_owns.me") - - if Group.can_own_project(User.find(6)).count > 0 - = radio_button_tag :who_owns, 'me'#, {}.merge( (@who_owns == :me ? {:checked => 'checked'} : {}) ) + - if Group.can_own_project(current_user).count > 0 + = radio_button_tag :who_owns, 'me', @who_owns == :me #{}.merge( (@who_owns == :me) ? {:checked => 'checked'} : {} ) + - puts @who_owns.inspect + - puts @who_owns == :group = label_tag t("activerecord.attributes.project.who_owns.group") - = radio_button_tag :who_owns, 'group'#, {}.merge( (@who_owns == :group ? {:checked => 'checked'} : {}) ) + = radio_button_tag :who_owns, 'group', @who_owns == :group #{}.merge( (@who_owns == :group) ? {:checked => 'checked'} : {} ) -# TODO: Make our own select_box helper with new design, blackjack and bitches! = select_tag :owner_id, options_for_select( Group.can_own_project(current_user) ) + - else + = hidden_field_tag :who_owns, :me .both -#- if [:new, :create].include? act -# .leftlist