mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
news finetuning
This commit is contained in:
parent
30f89dc9b5
commit
782aa27d98
|
@ -62,6 +62,8 @@ input:focus, textarea:focus {
|
||||||
.pad4px { padding: 4px; }
|
.pad4px { padding: 4px; }
|
||||||
.w100 { width: 100%; }
|
.w100 { width: 100%; }
|
||||||
.w40 { width: 40%; }
|
.w40 { width: 40%; }
|
||||||
|
.float-right { float: right; }
|
||||||
|
.pad-right { padding-right: 6px; }
|
||||||
|
|
||||||
/* STRUCTURE DIVS, HEADER & FOOTER */
|
/* STRUCTURE DIVS, HEADER & FOOTER */
|
||||||
div#header {
|
div#header {
|
||||||
|
@ -126,6 +128,7 @@ div.repo {
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
padding: 0.5em 1em 0.5em 1em;
|
padding: 0.5em 1em 0.5em 1em;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.repo_name span.name {
|
.repo_name span.name {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -744,47 +747,47 @@ div.tutorial h2 {
|
||||||
.nav-container ul ul li.separator:hover { background-color: inherit; }
|
.nav-container ul ul li.separator:hover { background-color: inherit; }
|
||||||
|
|
||||||
/* News Announcement */
|
/* News Announcement */
|
||||||
.news {
|
|
||||||
|
div.news {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
top: 50%;
|
top: 36px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 40em;
|
width: 40em;
|
||||||
margin-top: -12em;
|
|
||||||
margin-left: -20em;
|
margin-left: -20em;
|
||||||
border: 1px solid #ccc;
|
|
||||||
background-color: white;
|
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;
|
padding: 0.5em;
|
||||||
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news .title {
|
div.news li {
|
||||||
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;
|
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
font-size: 15px;
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news p.versionHeader {
|
div.news h1:first-child { margin: auto; }
|
||||||
font-size: 16px;
|
div.news h1 {
|
||||||
color: #888888;
|
font-size: inherit;
|
||||||
font-weight: bold;
|
padding: 6px 4px;
|
||||||
text-align: left;
|
margin: 4px auto auto;
|
||||||
padding-top: 8px;
|
text-decoration: underline;
|
||||||
padding-bottom: 8px;
|
font-weight: normal;
|
||||||
border-bottom: 1px #ddd solid;
|
|
||||||
margin: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,9 +80,10 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
||||||
ro_html->add( '<td class="repo_attr right">' ).
|
ro_html->add( '<td class="repo_attr right">' ).
|
||||||
|
|
||||||
IF io_news IS BOUND AND io_news->has_news( ) = abap_true.
|
IF io_news IS BOUND AND io_news->has_news( ) = abap_true.
|
||||||
ro_html->add_a( iv_act = 'displayNews()'
|
ro_html->add_a( iv_act = 'displayNews()'
|
||||||
iv_typ = gc_action_type-onclick
|
iv_typ = gc_action_type-onclick
|
||||||
iv_txt = lcl_html=>icon( iv_name = 'history/dark' ) ).
|
iv_txt = lcl_html=>icon( iv_name = 'pulse/blue'
|
||||||
|
iv_hint = 'Display changelog' ) ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
IF abap_true = lcl_app=>user( )->is_favorite_repo( io_repo->get_key( ) ).
|
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.
|
METHOD render_news.
|
||||||
|
|
||||||
DATA lt_log TYPE lcl_news=>tt_log.
|
DATA lt_log TYPE lcl_news=>tt_log.
|
||||||
|
FIELD-SYMBOLS: <line> LIKE LINE OF lt_log.
|
||||||
|
|
||||||
CREATE OBJECT ro_html.
|
CREATE OBJECT ro_html.
|
||||||
|
|
||||||
IF io_news IS NOT BOUND.
|
IF io_news IS NOT BOUND OR io_news->has_news( ) = abap_false.
|
||||||
RETURN.
|
|
||||||
ELSEIF io_news->has_news( ) = abap_true.
|
|
||||||
lt_log = io_news->get_log( ).
|
|
||||||
ELSE.
|
|
||||||
RETURN.
|
RETURN.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
FIELD-SYMBOLS: <line> LIKE LINE OF lt_log.
|
lt_log = io_news->get_log( ).
|
||||||
|
|
||||||
ro_html->add( '<div id="news" class="news">' ).
|
ro_html->add( '<div id="news" class="news" style="display:none">' ).
|
||||||
|
|
||||||
ro_html->add( '<table class="w100"><tr>' ).
|
ro_html->add( '<div class="headbar title">Announcement of the latest changes'
|
||||||
ro_html->add( '<td class="title">' ).
|
&& '<div class="float-right"><a onclick="displayNews()">close</a></div>'
|
||||||
ro_html->add( 'Announcement of the latest changes' ).
|
&& '</div>' ).
|
||||||
ro_html->add( '</td>' ).
|
|
||||||
ro_html->add( '<td class="right">' ).
|
|
||||||
ro_html->add( '<a onclick="displayNews()">close</a>' ).
|
|
||||||
ro_html->add( '</td>' ).
|
|
||||||
ro_html->add( '</tr></table>' ).
|
|
||||||
|
|
||||||
IF io_news->has_important_news( ) = abap_true.
|
IF io_news->has_important_news( ) = abap_true.
|
||||||
ro_html->add( '<div class="attention">'
|
ro_html->add( '<div class="headbar important">'
|
||||||
&& 'Some changes mentioned in this announcement might be critical !'
|
&& lcl_html=>icon( iv_name = 'alert' iv_class = 'pad-right' )
|
||||||
|
&& 'Please note changes marked with <b>"!"</b>'
|
||||||
&& '</div>' ).
|
&& '</div>' ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
" Generate news
|
" Generate news
|
||||||
|
ro_html->add( |<div class="newslist">| ).
|
||||||
LOOP AT lt_log ASSIGNING <line>.
|
LOOP AT lt_log ASSIGNING <line>.
|
||||||
IF <line>-header = 'X'.
|
IF <line>-header = 'X'.
|
||||||
ro_html->add( |<p class="versionHeader"> { <line>-text } </p>| ).
|
ro_html->add( |<h1>{ <line>-text }</h1>| ).
|
||||||
ELSE.
|
ELSE.
|
||||||
ro_html->add( |<li> { <line>-text } </li>| ).
|
ro_html->add( |<li>{ <line>-text }</li>| ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
ro_html->add( '</div>' ).
|
||||||
|
|
||||||
ro_html->add( '</div>' ).
|
ro_html->add( '</div>' ).
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,13 @@ CLASS lcl_news DEFINITION FRIENDS ltcl_news.
|
||||||
tt_log TYPE STANDARD TABLE OF ty_log WITH DEFAULT KEY.
|
tt_log TYPE STANDARD TABLE OF ty_log WITH DEFAULT KEY.
|
||||||
|
|
||||||
CONSTANTS:
|
CONSTANTS:
|
||||||
c_log_filename TYPE string VALUE '/',
|
c_log_path TYPE string VALUE '/',
|
||||||
c_log_path TYPE string VALUE 'changelog.txt'.
|
c_log_filename TYPE string VALUE 'changelog.txt'.
|
||||||
|
|
||||||
CLASS-METHODS create
|
CLASS-METHODS create
|
||||||
IMPORTING io_repo TYPE REF TO lcl_repo
|
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:
|
METHODS:
|
||||||
constructor
|
constructor
|
||||||
|
@ -71,8 +72,8 @@ ENDCLASS. "lcl_news
|
||||||
CLASS lcl_news IMPLEMENTATION.
|
CLASS lcl_news IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD constructor.
|
METHOD constructor.
|
||||||
DATA:
|
|
||||||
lt_lines TYPE string_table,
|
DATA: lt_lines TYPE string_table,
|
||||||
lv_string TYPE string.
|
lv_string TYPE string.
|
||||||
|
|
||||||
lv_string = lcl_convert=>xstring_to_string_utf8( iv_rawdata ).
|
lv_string = lcl_convert=>xstring_to_string_utf8( iv_rawdata ).
|
||||||
|
@ -83,8 +84,7 @@ CLASS lcl_news IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD create.
|
METHOD create.
|
||||||
|
|
||||||
DATA:
|
DATA: lt_remote TYPE ty_files_tt,
|
||||||
lt_remote TYPE ty_files_tt,
|
|
||||||
lo_repo_online TYPE REF TO lcl_repo_online.
|
lo_repo_online TYPE REF TO lcl_repo_online.
|
||||||
|
|
||||||
FIELD-SYMBOLS <file> LIKE LINE OF lt_remote.
|
FIELD-SYMBOLS <file> LIKE LINE OF lt_remote.
|
||||||
|
@ -96,12 +96,14 @@ CLASS lcl_news IMPLEMENTATION.
|
||||||
IF lo_repo_online->get_url( ) CS '/abapGit.git'.
|
IF lo_repo_online->get_url( ) CS '/abapGit.git'.
|
||||||
lt_remote = io_repo->get_files_remote( ).
|
lt_remote = io_repo->get_files_remote( ).
|
||||||
|
|
||||||
READ TABLE lt_remote ASSIGNING <file> WITH KEY path = c_log_filename
|
READ TABLE lt_remote ASSIGNING <file>
|
||||||
filename = c_log_path.
|
WITH KEY path = c_log_path filename = c_log_filename.
|
||||||
|
|
||||||
IF sy-subrc = 0.
|
IF sy-subrc = 0.
|
||||||
CREATE OBJECT ro_instance EXPORTING
|
CREATE OBJECT ro_instance EXPORTING
|
||||||
iv_rawdata = <file>-data
|
iv_rawdata = <file>-data
|
||||||
iv_version = gc_abap_version.
|
iv_version = gc_abap_version.
|
||||||
|
* iv_version = 'v1.30.0'. " for debug
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
@ -360,13 +362,13 @@ CLASS ltcl_news IMPLEMENTATION.
|
||||||
" Generate test data
|
" Generate test data
|
||||||
APPEND '======' TO lt_lines.
|
APPEND '======' TO lt_lines.
|
||||||
APPEND '------' TO lt_lines.
|
APPEND '------' TO lt_lines.
|
||||||
APPEND ' ' TO lt_lines.
|
APPEND ` ` TO lt_lines.
|
||||||
APPEND 'abapGit changelog' TO lt_lines.
|
APPEND 'abapGit changelog' TO lt_lines.
|
||||||
APPEND '2017-02-13 v1.28.0' TO lt_lines.
|
APPEND '2017-02-13 v1.28.0' TO lt_lines.
|
||||||
APPEND '------------------' TO lt_lines.
|
APPEND '------------------' TO lt_lines.
|
||||||
APPEND '+ Staging page redesigned' TO lt_lines.
|
APPEND '+ Staging page redesigned' TO lt_lines.
|
||||||
APPEND '! Support for core data services' 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 '2017-01-25 v1.27.0' TO lt_lines.
|
||||||
APPEND '------------------' TO lt_lines.
|
APPEND '------------------' TO lt_lines.
|
||||||
APPEND '+ Two factor authentication with github.com' TO lt_lines.
|
APPEND '+ Two factor authentication with github.com' TO lt_lines.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user