diff --git a/src/zabapgit_css_common.w3mi.data.css b/src/zabapgit_css_common.w3mi.data.css
index 053a3501e..584ca974e 100644
--- a/src/zabapgit_css_common.w3mi.data.css
+++ b/src/zabapgit_css_common.w3mi.data.css
@@ -62,6 +62,8 @@ input:focus, textarea:focus {
.pad4px { padding: 4px; }
.w100 { width: 100%; }
.w40 { width: 40%; }
+.float-right { float: right; }
+.pad-right { padding-right: 6px; }
/* STRUCTURE DIVS, HEADER & FOOTER */
div#header {
@@ -126,6 +128,7 @@ div.repo {
margin-top: 3px;
background-color: #f2f2f2;
padding: 0.5em 1em 0.5em 1em;
+ position: relative;
}
.repo_name span.name {
font-weight: bold;
@@ -744,47 +747,47 @@ div.tutorial h2 {
.nav-container ul ul li.separator:hover { background-color: inherit; }
/* News Announcement */
-.news {
+
+div.news {
position: absolute;
z-index: 99;
- top: 50%;
+ top: 36px;
left: 50%;
width: 40em;
- margin-top: -12em;
margin-left: -20em;
- border: 1px solid #ccc;
background-color: white;
+ box-shadow: 1px 1px 3px 2px #dcdcdc;
+}
+
+div.news div.headbar {
+ text-transform: uppercase;
+ font-size: small;
+ padding: 4px 6px;
+}
+
+div.news div.title {
+ color: #f8f8f8;
+ background-color: #888;
+}
+
+div.news div.title a { color: #c6d6ec; }
+div.news div.important { color: #e8961b; }
+
+div.news div.newslist {
padding: 0.5em;
+ color: #444;
}
-.news .title {
- color: #888888;
- font-weight: bold;
- font-size: 16px;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-
-.news .attention {
- background-color: #ff9800;
- color: white;
- padding: 10px;
-}
-
-.news li {
- margin: 4px;
+div.news li {
padding-left: 10px;
- font-size: 15px;
list-style-type: none;
}
-.news p.versionHeader {
- font-size: 16px;
- color: #888888;
- font-weight: bold;
- text-align: left;
- padding-top: 8px;
- padding-bottom: 8px;
- border-bottom: 1px #ddd solid;
- margin: 4px;
+div.news h1:first-child { margin: auto; }
+div.news h1 {
+ font-size: inherit;
+ padding: 6px 4px;
+ margin: 4px auto auto;
+ text-decoration: underline;
+ font-weight: normal;
}
diff --git a/src/zabapgit_html_chunks.prog.abap b/src/zabapgit_html_chunks.prog.abap
index 5db3a7f55..7b6238512 100644
--- a/src/zabapgit_html_chunks.prog.abap
+++ b/src/zabapgit_html_chunks.prog.abap
@@ -80,9 +80,10 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
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 = 'history/dark' ) ).
+ 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.
IF abap_true = lcl_app=>user( )->is_favorite_repo( io_repo->get_key( ) ).
@@ -231,44 +232,39 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
METHOD render_news.
DATA lt_log TYPE lcl_news=>tt_log.
+ FIELD-SYMBOLS: LIKE LINE OF lt_log.
CREATE OBJECT ro_html.
- IF io_news IS NOT BOUND.
- RETURN.
- ELSEIF io_news->has_news( ) = abap_true.
- lt_log = io_news->get_log( ).
- ELSE.
+ IF io_news IS NOT BOUND OR io_news->has_news( ) = abap_false.
RETURN.
ENDIF.
- FIELD-SYMBOLS: LIKE LINE OF lt_log.
+ lt_log = io_news->get_log( ).
- ro_html->add( '' ).
+ ro_html->add( ' ' ).
- ro_html->add( ' ' ).
- ro_html->add( '' ).
- ro_html->add( 'Announcement of the latest changes' ).
- ro_html->add( ' | ' ).
- ro_html->add( '' ).
- ro_html->add( 'close' ).
- ro_html->add( ' | ' ).
- ro_html->add( '
' ).
+ ro_html->add( ' Announcement of the latest changes'
+ && ' '
+ && ' ' ).
IF io_news->has_important_news( ) = abap_true.
- ro_html->add( ' '
- && 'Some changes mentioned in this announcement might be critical !'
+ ro_html->add( ' '
+ && lcl_html=>icon( iv_name = 'alert' iv_class = 'pad-right' )
+ && 'Please note changes marked with "!"'
&& ' ' ).
ENDIF.
" Generate news
+ ro_html->add( | | ).
LOOP AT lt_log ASSIGNING .
IF -header = 'X'.
- ro_html->add( || ).
+ ro_html->add( |{ -text }| ).
ELSE.
- ro_html->add( | { -text } | ).
+ ro_html->add( |{ -text }| ).
ENDIF.
ENDLOOP.
+ ro_html->add( ' ' ).
ro_html->add( ' ' ).
diff --git a/src/zabapgit_news.prog.abap b/src/zabapgit_news.prog.abap
index bed394801..c872439fd 100644
--- a/src/zabapgit_news.prog.abap
+++ b/src/zabapgit_news.prog.abap
@@ -21,12 +21,13 @@ CLASS lcl_news DEFINITION FRIENDS ltcl_news.
tt_log TYPE STANDARD TABLE OF ty_log WITH DEFAULT KEY.
CONSTANTS:
- c_log_filename TYPE string VALUE '/',
- c_log_path TYPE string VALUE 'changelog.txt'.
+ c_log_path TYPE string VALUE '/',
+ c_log_filename TYPE string VALUE 'changelog.txt'.
CLASS-METHODS create
IMPORTING io_repo TYPE REF TO lcl_repo
- RETURNING VALUE(ro_instance) TYPE REF TO lcl_news.
+ RETURNING VALUE(ro_instance) TYPE REF TO lcl_news
+ RAISING lcx_exception.
METHODS:
constructor
@@ -71,8 +72,8 @@ ENDCLASS. "lcl_news
CLASS lcl_news IMPLEMENTATION.
METHOD constructor.
- DATA:
- lt_lines TYPE string_table,
+
+ DATA: lt_lines TYPE string_table,
lv_string TYPE string.
lv_string = lcl_convert=>xstring_to_string_utf8( iv_rawdata ).
@@ -83,8 +84,7 @@ CLASS lcl_news IMPLEMENTATION.
METHOD create.
- DATA:
- lt_remote TYPE ty_files_tt,
+ DATA: lt_remote TYPE ty_files_tt,
lo_repo_online TYPE REF TO lcl_repo_online.
FIELD-SYMBOLS LIKE LINE OF lt_remote.
@@ -96,12 +96,14 @@ CLASS lcl_news IMPLEMENTATION.
IF lo_repo_online->get_url( ) CS '/abapGit.git'.
lt_remote = io_repo->get_files_remote( ).
- READ TABLE lt_remote ASSIGNING WITH KEY path = c_log_filename
- filename = c_log_path.
+ READ TABLE lt_remote ASSIGNING
+ WITH KEY path = c_log_path filename = c_log_filename.
+
IF sy-subrc = 0.
- CREATE OBJECT ro_instance EXPORTING
- iv_rawdata = -data
- iv_version = gc_abap_version.
+ CREATE OBJECT ro_instance EXPORTING
+ iv_rawdata = -data
+ iv_version = gc_abap_version.
+* iv_version = 'v1.30.0'. " for debug
ENDIF.
ENDIF.
ENDIF.
@@ -360,13 +362,13 @@ CLASS ltcl_news IMPLEMENTATION.
" Generate test data
APPEND '======' TO lt_lines.
APPEND '------' TO lt_lines.
- APPEND ' ' TO lt_lines.
+ APPEND ` ` TO lt_lines.
APPEND 'abapGit changelog' TO lt_lines.
APPEND '2017-02-13 v1.28.0' TO lt_lines.
APPEND '------------------' TO lt_lines.
APPEND '+ Staging page redesigned' TO lt_lines.
APPEND '! Support for core data services' TO lt_lines.
- APPEND ' ' TO lt_lines.
+ APPEND ` ` TO lt_lines.
APPEND '2017-01-25 v1.27.0' TO lt_lines.
APPEND '------------------' TO lt_lines.
APPEND '+ Two factor authentication with github.com' TO lt_lines.
|