From 7f1a77bae476d8074c04d1e8d10a4ee23eeae4e5 Mon Sep 17 00:00:00 2001 From: Alexander Tsybulsky Date: Wed, 19 Apr 2017 21:13:03 +0300 Subject: [PATCH 1/3] #714 new improvements (almost done) --- src/zabapgit_css_common.w3mi.data.css | 31 +- src/zabapgit_html_chunks.prog.abap | 64 +++- src/zabapgit_news.prog.abap | 488 ++++++++++++++++---------- src/zabapgit_page_main.prog.abap | 7 +- src/zabapgit_persistence.prog.abap | 35 +- src/zabapgit_unit_test.prog.abap | 27 ++ src/zabapgit_util.prog.abap | 19 + 7 files changed, 459 insertions(+), 212 deletions(-) diff --git a/src/zabapgit_css_common.w3mi.data.css b/src/zabapgit_css_common.w3mi.data.css index 584ca974e..ebf3ad6cb 100644 --- a/src/zabapgit_css_common.w3mi.data.css +++ b/src/zabapgit_css_common.w3mi.data.css @@ -42,6 +42,7 @@ input:focus, textarea:focus { /* COLOR PALETTE */ .grey { color: lightgrey !important; } .grey70 { color: #b3b3b3 !important; } +.grey80 { color: #ccc !important; } .bgorange { background-color: orange; } .darkgrey { color: #808080 !important; } .attention { color: red !important; } @@ -49,6 +50,7 @@ input:focus, textarea:focus { .warning { color: #efb301 !important; } .blue { color: #5e8dc9 !important; } .red { color: red !important; } +.white { color: white !important; } /* MODIFIERS */ .emphasis { font-weight: bold !important; } @@ -535,8 +537,8 @@ table.db_tab th { } table.db_tab td { color: #333; - padding: 0.5em; - vertical-align: top; + padding: 4px 8px; + vertical-align: middle; } table.db_tab td.data { color: #888; @@ -770,9 +772,15 @@ div.news div.title { background-color: #888; } -div.news div.title a { color: #c6d6ec; } -div.news div.important { color: #e8961b; } +div.news div.title a.close-btn { + color: #d8d8d8; + padding-left: 12px; + padding-right: 2px; + position: relative; + bottom: 1px; +} +div.news div.important { color: #aaa; } div.news div.newslist { padding: 0.5em; color: #444; @@ -791,3 +799,18 @@ div.news h1 { text-decoration: underline; font-weight: normal; } + +div.news .version-marker { + color: #888; + display: inline-block; + margin-left: 16px; +} + +div.news .version-marker > .version-tag { + background-color: #ccc; + border: #c0c0c0 1px solid; + border-radius: 3px; + padding: 0px 6px; + color: white; + margin-left: 8px; +} diff --git a/src/zabapgit_html_chunks.prog.abap b/src/zabapgit_html_chunks.prog.abap index 7b6238512..621139fb1 100644 --- a/src/zabapgit_html_chunks.prog.abap +++ b/src/zabapgit_html_chunks.prog.abap @@ -69,23 +69,33 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION. ro_html->add( '' ). ro_html->add( '' ). ro_html->add( '
' ). + + " Repo type and name ro_html->add_icon( iv_name = lv_icon iv_hint = lv_hint ). ro_html->add( |{ io_repo->get_name( ) }| ). IF io_repo->is_offline( ) = abap_false. lo_repo_online ?= io_repo. ro_html->add( |{ lo_repo_online->get_url( ) }| ). ENDIF. + + " News + IF io_news IS BOUND AND io_news->has_news( ) = abap_true. + IF io_news->has_updates( ) = abap_true. + lv_icon = 'arrow-up/warning'. + ELSE. + lv_icon = 'arrow-up/grey80'. + ENDIF. + ro_html->add_a( iv_act = 'displayNews()' + iv_typ = gc_action_type-onclick + iv_txt = lcl_html=>icon( iv_name = lv_icon + iv_class = 'pad-sides' + iv_hint = 'Display changelog' ) ). + ENDIF. ro_html->add( '' ). - IF io_news IS BOUND AND io_news->has_news( ) = abap_true. - ro_html->add_a( iv_act = 'displayNews()' - iv_typ = gc_action_type-onclick - iv_txt = lcl_html=>icon( iv_name = 'pulse/blue' - iv_hint = 'Display changelog' ) ). - ENDIF. - + " Fav IF abap_true = lcl_app=>user( )->is_favorite_repo( io_repo->get_key( ) ). lv_icon = 'star/blue' ##NO_TEXT. ELSE. @@ -96,14 +106,17 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION. iv_class = 'pad-sides' iv_hint = 'Click to toggle favorite' ) ). + " BG IF lo_pback->exists( io_repo->get_key( ) ) = abap_true. ro_html->add( 'BG' ). ENDIF. + " Write protect IF io_repo->is_write_protected( ) = abap_true. ro_html->add_icon( iv_name = 'lock/darkgrey' iv_hint = 'Locked from pulls' ). ENDIF. + " Branch IF io_repo->is_offline( ) = abap_false. lo_repo_online ?= io_repo. IF iv_show_branch = abap_true. @@ -119,6 +132,7 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION. ENDIF. ENDIF. + " Package IF iv_show_package = abap_true. ro_html->add_icon( iv_name = 'package/darkgrey' iv_hint = 'SAP package' ). ro_html->add( '' ). @@ -231,7 +245,10 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION. METHOD render_news. - DATA lt_log TYPE lcl_news=>tt_log. + DATA: lv_text TYPE string, + lv_display TYPE string, + lt_log TYPE lcl_news=>tt_log. + FIELD-SYMBOLS: LIKE LINE OF lt_log. CREATE OBJECT ro_html. @@ -242,24 +259,41 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION. lt_log = io_news->get_log( ). - ro_html->add( '