From b2e51e71121b798a53ec6a60891bdcce08df2eeb Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 2 Sep 2013 11:26:23 +0200 Subject: [PATCH] =?utf8?q?Pflichtenhefte:=20in=20Zeitabsch=C3=A4tzungsmask?= =?utf8?q?e=20erste=20Selectbox=20focussen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpec.pm | 3 +++ .../requirement_spec/_edit_time_and_cost_estimate_item.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index f99e0bf4d..ee0a94f25 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -120,11 +120,14 @@ sub action_ajax_edit_time_and_cost_estimate { my ($self) = @_; my $html = $self->render('requirement_spec/_edit_time_and_cost_estimate', { output => 0 }); + my $first = ($self->requirement_spec->sections_sorted || [])->[0]; + $first = ($first->children_sorted || [])->[0] if $first; $self->js ->hide('#time_cost_estimate') ->after('#time_cost_estimate', $html) ->on('#time_cost_estimate INPUT[type=text]', 'keydown', 'kivi.requirement_spec.time_cost_estimate_input_key_down') + ->action_if($first && $first->id, 'focus', '#time_and_cost_estimate_form_complexity_id_' . $first->id) ->render($self); } diff --git a/templates/webpages/requirement_spec/_edit_time_and_cost_estimate_item.html b/templates/webpages/requirement_spec/_edit_time_and_cost_estimate_item.html index e3975a999..593de9a0c 100644 --- a/templates/webpages/requirement_spec/_edit_time_and_cost_estimate_item.html +++ b/templates/webpages/requirement_spec/_edit_time_and_cost_estimate_item.html @@ -6,10 +6,10 @@ [%- P.simple_format(item.fb_number _ ": " _ item.description) -%] - [%- L.select_tag('requirement_spec_items[].complexity_id', SELF.complexities, id=id_prefix _ '_complexity_id', title_key='description', default=item.complexity_id, style="width: 100%") %]
+ [%- L.select_tag('requirement_spec_items[].complexity_id', SELF.complexities, id=id_prefix _ '_complexity_id_' _ item.id, title_key='description', default=item.complexity_id, style="width: 100%") %]
- [%- L.select_tag('requirement_spec_items[].risk_id', SELF.risks, id=id_prefix _ '_risk_id', title_key='description', default=item.risk_id, style="width: 100%") %]
+ [%- L.select_tag('requirement_spec_items[].risk_id', SELF.risks, id=id_prefix _ '_risk_id_' _ item.id, title_key='description', default=item.risk_id, style="width: 100%") %]
[%- IF !item.children.size -%] [%- P.man_days_tag('requirement_spec_items[].time_estimation', item, id=id_prefix _ '_time_estimation') %] -- 2.20.1