From 12c3c3bbe19009db751c8a96e051c003161c4f8a Mon Sep 17 00:00:00 2001 From: sbcgua Date: Sat, 18 Feb 2017 11:20:23 +0200 Subject: [PATCH] stage: move filter right, fix stage tab width, css --- src/zabapgit_css_common.w3mi.data.css | 8 ++- src/zabapgit_page_stage.prog.abap | 85 +++++++++++++++++---------- 2 files changed, 60 insertions(+), 33 deletions(-) diff --git a/src/zabapgit_css_common.w3mi.data.css b/src/zabapgit_css_common.w3mi.data.css index bf3130107..4ab352f62 100644 --- a/src/zabapgit_css_common.w3mi.data.css +++ b/src/zabapgit_css_common.w3mi.data.css @@ -47,7 +47,9 @@ input:focus, textarea:focus { .crossout { text-decoration: line-through !important; } .right { text-align:right; } .paddings { padding: 0.5em 0.5em; } -.pad-sides { padding: 0 0.3em; } +.pad-sides { padding-left: 0.3em; padding-right: 0.3em; } +.margin-v5 { margin-top: 0.5em; margin-bottom: 0.5em; } +.indent5em { padding-left: 0.5em; } .pad4px { padding: 4px; } .w100 { width: 100%; } .w40 { width: 40%; } @@ -360,6 +362,9 @@ table.repo_tab { } /* STAGE */ +div.stage-container { width: 850px; } +input.stage-filter { width: 18em; } + .stage_tab { border: 1px solid #DDD; background: #fff; @@ -388,6 +393,7 @@ table.repo_tab { color: #444 !important; font-weight: bold; } + .stage_tab td.cmd { cursor: pointer; } .stage_tab td.cmd a { padding: 0px 4px; } .stage_tab th.cmd a { padding: 0px 4px; } diff --git a/src/zabapgit_page_stage.prog.abap b/src/zabapgit_page_stage.prog.abap index 4151272a7..32098bace 100644 --- a/src/zabapgit_page_stage.prog.abap +++ b/src/zabapgit_page_stage.prog.abap @@ -31,22 +31,26 @@ CLASS lcl_gui_page_stage DEFINITION FINAL INHERITING FROM lcl_gui_page. METHODS: render_list RETURNING VALUE(ro_html) TYPE REF TO lcl_html, + render_file IMPORTING iv_context TYPE string is_file TYPE ty_file is_item TYPE ty_item OPTIONAL RETURNING VALUE(ro_html) TYPE REF TO lcl_html, - render_menu + + render_actions RETURNING VALUE(ro_html) TYPE REF TO lcl_html, + read_last_changed_by IMPORTING is_file TYPE ty_file - RETURNING VALUE(rv_user) TYPE xubname. + RETURNING VALUE(rv_user) TYPE xubname, - METHODS process_stage_list - IMPORTING it_postdata TYPE cnht_post_data_tab - RAISING lcx_exception. - METHODS build_menu - RETURNING VALUE(ro_menu) TYPE REF TO lcl_html_toolbar. + process_stage_list + IMPORTING it_postdata TYPE cnht_post_data_tab + RAISING lcx_exception, + + build_menu + RETURNING VALUE(ro_menu) TYPE REF TO lcl_html_toolbar. ENDCLASS. @@ -162,19 +166,21 @@ CLASS lcl_gui_page_stage IMPLEMENTATION. CREATE OBJECT ro_html. - ro_html->add( '' ). + ro_html->add( '
' ). " Local changes LOOP AT ms_files-local ASSIGNING . AT FIRST. - ro_html->add(''). - ro_html->add(''). - ro_html->add('' ). - ro_html->add(''). - ro_html->add('' ). " Status - ro_html->add('' ). - ro_html->add(''). - ro_html->add(''). + ro_html->add( '' ). + ro_html->add( '' ). + ro_html->add( '' ). + ro_html->add( '' ). + ro_html->add( '' ). " Status + ro_html->add( '' ). + ro_html->add( '' ). + ro_html->add( '' ). ENDAT. ro_html->add( render_file( @@ -194,8 +200,9 @@ CLASS lcl_gui_page_stage IMPLEMENTATION. ro_html->add( '' ). " Type ro_html->add( '' ). ro_html->add( '' ). " Status - ro_html->add( '' ). + ro_html->add( '' ). ro_html->add( '' ). ro_html->add( '' ). ENDAT. @@ -252,38 +259,52 @@ CLASS lcl_gui_page_stage IMPLEMENTATION. ro_html->add( '
' ). ro_html->add( lcl_gui_chunk_lib=>render_repo_top( mo_repo ) ). ro_html->add( lcl_gui_chunk_lib=>render_js_error_banner( ) ). - ro_html->add( render_menu( ) ). + + ro_html->add( '
' ). + ro_html->add( render_actions( ) ). ro_html->add( render_list( ) ). ro_html->add( '
' ). + ro_html->add( '
' ). + ENDMETHOD. "render_content - METHOD render_menu. + METHOD render_actions. - DATA lv_local_count TYPE i. + DATA: lv_local_count TYPE i, + lv_add_all_txt TYPE string. CREATE OBJECT ro_html. lv_local_count = lines( ms_files-local ). + IF lv_local_count > 0. + lv_add_all_txt = |Add all and commit ({ lv_local_count })|. + " Otherwise empty, but the element (id) is preserved for JS + ENDIF. - ro_html->add( '
' ). + ro_html->add( '
TypeFiles to add (click to see diff)Changed byadd/reset
TypeFiles to add (click to see diff)Changed by' ). + ro_html->add( 'addreset↓' ). + ro_html->add( '
Files to remove or non-code' && - '↓ignoreremovereset' ). + ro_html->add( 'ignoreremovereset↓' ). + ro_html->add( '
' ). + + " Action buttons + ro_html->add( '' ). - ro_html->add( '
' ). - ro_html->add( '' ). - ro_html->add( '
' ). + " Filter bar + ro_html->add( '' ). - ENDMETHOD. "render_menu + ro_html->add( '
' ). ro_html->add_a( iv_act = 'errorStub(event)' " Will be reinit by JS iv_typ = gc_action_type-onclick iv_id = 'commitButton' iv_style = 'display: none' iv_txt = 'Commit ()' iv_opt = gc_html_opt-strong ) ##NO_TEXT. - IF lv_local_count > 0. - ro_html->add_a( iv_act = |{ c_action-stage_all }| - iv_id = 'commitAllButton' - iv_txt = |Add all and commit ({ lv_local_count })| ) ##NO_TEXT. - ENDIF. - ro_html->add( '' ). + ro_html->add_a( iv_act = |{ c_action-stage_all }| + iv_id = 'commitAllButton' + iv_txt = lv_add_all_txt ) ##NO_TEXT. + ro_html->add( '' ). + ro_html->add( '' ). + ro_html->add( '
' ). + + ENDMETHOD. "render_actions METHOD scripts.