2014-12-19 18:26 EST

View Issue Details Jump to Notes ] Wiki ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0011995mantisbthtmlpublic2014-12-08 00:34
Reporterbrandonjackson 
Assigned Todaryn 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionfixed 
Product Versiongit trunk 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0011995: Add CSS IDs to html elements for styling and javascript access.
DescriptionI've added some ID's to several of the tables in the header to make CSS-based customizations easier. For example, by adding an id to the mantis logo it can be hidden using #logo-image{display: none;}, as opposed to editing config files and creating replacement html files. These changes should be completely unobtrusive, and are an easy step that can be taken to make Mantis designer friendly.

Also, I've created a div which encloses everything within the body tags with the ID of mantis. This was discussed in issue 2814. It will allow designers to distinguish between elements from mantis and their cms. Also, it allows mantis to have a fixed-width and centered layout if a designer so desires.
Tagspatch, redesign
Attached Files
  • patch file icon new-element-ids.patch (5,433 bytes) 2010-06-05 02:42 - 
    From 4e11175e96bc057f79f23e5c3be4d39e792ae547 Mon Sep 17 00:00:00 2001
    From: Brandon Jackson <brandonscottjackson@gmail.com>
    Date: Sat, 5 Jun 2010 00:28:03 -0500
    Subject: [PATCH 1/6] Added wrapper div
    
    ---
     core/html_api.php |    3 +++
     1 files changed, 3 insertions(+), 0 deletions(-)
    
    diff --git a/core/html_api.php b/core/html_api.php
    index 590b389..9f10ae5 100644
    --- a/core/html_api.php
    +++ b/core/html_api.php
    @@ -446,6 +446,7 @@ function html_body_begin() {
      * @return null
      */
     function html_header() {
    +	echo '<div class="wrapper">', "\n";
     	$t_title = config_get( 'page_title' );
     	if( !is_blank( $t_title ) ) {
     		echo '<div class="center"><span class="pagetitle">', string_display( $t_title ), '</span></div>', "\n";
    @@ -711,6 +712,8 @@ function html_footer( $p_file = null ) {
     	}
     
     	echo "</div>\n";
    +	echo "</div>\n";
    +
     }
     
     /**
    -- 
    1.7.0.3
    
    
    From 0794384deee4ab39ae00c6f24c59a8f40b734822 Mon Sep 17 00:00:00 2001
    From: Brandon Jackson <brandonscottjackson@gmail.com>
    Date: Sat, 5 Jun 2010 00:34:29 -0500
    Subject: [PATCH 2/6] Added menubar id
    
    ---
     core/html_api.php |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/core/html_api.php b/core/html_api.php
    index 9f10ae5..ebda025 100644
    --- a/core/html_api.php
    +++ b/core/html_api.php
    @@ -764,7 +764,7 @@ function print_menu() {
     		$t_protected = current_user_get_field( 'protected' );
     		$t_current_project = helper_get_current_project();
     
    -		echo '<table class="width100" cellspacing="0">';
    +		echo '<table id="menubar" class="width100" cellspacing="0">';
     		echo '<tr>';
     		echo '<td class="menu">';
     		$t_menu_options = array();
    -- 
    1.7.0.3
    
    
    From 3c1255c7595de49292d25acb9869490388f3a3fc Mon Sep 17 00:00:00 2001
    From: Brandon Jackson <brandonscottjackson@gmail.com>
    Date: Sat, 5 Jun 2010 00:35:33 -0500
    Subject: [PATCH 3/6] Changed wrapper identiftier from class to id
    
    ---
     core/html_api.php |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/core/html_api.php b/core/html_api.php
    index ebda025..19e80e8 100644
    --- a/core/html_api.php
    +++ b/core/html_api.php
    @@ -446,7 +446,7 @@ function html_body_begin() {
      * @return null
      */
     function html_header() {
    -	echo '<div class="wrapper">', "\n";
    +	echo '<div id="wrapper">', "\n";
     	$t_title = config_get( 'page_title' );
     	if( !is_blank( $t_title ) ) {
     		echo '<div class="center"><span class="pagetitle">', string_display( $t_title ), '</span></div>', "\n";
    -- 
    1.7.0.3
    
    
    From 550166551c5e43b3e895817c8b32c3b0e924e679 Mon Sep 17 00:00:00 2001
    From: Brandon Jackson <brandonscottjackson@gmail.com>
    Date: Sat, 5 Jun 2010 00:37:37 -0500
    Subject: [PATCH 4/6] Added IDs to logo and banner
    
    ---
     core/html_api.php |    6 +++---
     1 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/core/html_api.php b/core/html_api.php
    index 19e80e8..ce3bda3 100644
    --- a/core/html_api.php
    +++ b/core/html_api.php
    @@ -482,11 +482,11 @@ function html_top_banner() {
     			$t_align = 'left';
     		}
     
    -		echo '<div align="', $t_align, '">';
    +		echo '<div id="banner" align="', $t_align, '">';
     		if( $t_show_url ) {
    -			echo '<a href="', config_get( 'logo_url' ), '">';
    +			echo '<a id="logo-link" href="', config_get( 'logo_url' ), '">';
     		}
    -		echo '<img border="0" alt="Mantis Bug Tracker" src="' . helper_mantis_url( config_get( 'logo_image' ) ) . '" />';
    +		echo '<img border="0" id="logo-image" alt="Mantis Bug Tracker" src="' . helper_mantis_url( config_get( 'logo_image' ) ) . '" />';
     		if( $t_show_url ) {
     			echo '</a>';
     		}
    -- 
    1.7.0.3
    
    
    From c97f60e1f45c9e1c0d260bff446f2db2fefa24c0 Mon Sep 17 00:00:00 2001
    From: Brandon Jackson <brandonscottjackson@gmail.com>
    Date: Sat, 5 Jun 2010 00:49:49 -0500
    Subject: [PATCH 5/6] Finished adding IDs to header HTML
    
    ---
     core/html_api.php |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/core/html_api.php b/core/html_api.php
    index ce3bda3..95cefa5 100644
    --- a/core/html_api.php
    +++ b/core/html_api.php
    @@ -507,7 +507,7 @@ function html_login_info() {
     	$t_now = date( config_get( 'complete_date_format' ) );
     	$t_realname = current_user_get_field( 'realname' );
     
    -	echo '<table class="hide">';
    +	echo '<table class="hide" id="login-info">';
     	echo '<tr>';
     	echo '<td class="login-info-left">';
     	if( current_user_is_anonymous() ) {
    @@ -764,7 +764,7 @@ function print_menu() {
     		$t_protected = current_user_get_field( 'protected' );
     		$t_current_project = helper_get_current_project();
     
    -		echo '<table id="menubar" class="width100" cellspacing="0">';
    +		echo '<table id="menu-bar" class="width100" cellspacing="0">';
     		echo '<tr>';
     		echo '<td class="menu">';
     		$t_menu_options = array();
    -- 
    1.7.0.3
    
    
    From 2a6082fed74cc6e4c2056769aea70c6c7342b427 Mon Sep 17 00:00:00 2001
    From: Brandon Jackson <brandonscottjackson@gmail.com>
    Date: Sat, 5 Jun 2010 01:05:14 -0500
    Subject: [PATCH 6/6] Renamed wrapper to mantis
    
    ---
     core/html_api.php |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/core/html_api.php b/core/html_api.php
    index 95cefa5..29a67ce 100644
    --- a/core/html_api.php
    +++ b/core/html_api.php
    @@ -446,7 +446,7 @@ function html_body_begin() {
      * @return null
      */
     function html_header() {
    -	echo '<div id="wrapper">', "\n";
    +	echo '<div id="mantis">', "\n";
     	$t_title = config_get( 'page_title' );
     	if( !is_blank( $t_title ) ) {
     		echo '<div class="center"><span class="pagetitle">', string_display( $t_title ), '</span></div>', "\n";
    -- 
    1.7.0.3
    
    
    patch file icon new-element-ids.patch (5,433 bytes) 2010-06-05 02:42 + 

- Relationships
related to 0015721closedgrangeway Functionality to consider porting to master-2.0.x 
+ Relationships

-  Notes
User avatar

~0025850

djcarr (reporter)

Last edited: 2010-06-14 23:53

View 4 revisions

I too have spent some time getting CSS control over the print_menu() function.

Instead of printing the <a href>s out directly, could they perhaps call a new function eg:

function string_get_menu_option_link( $page_url, $lang_string ) {
    return [a href="' . helper_mantis_url( $page_url ) . '"]' . lang_get( $lang_string ) . '[/a]';
}

    (replace [] with <>)

Then it becomes quite trivial for a customisation effort to wrap this with span or other tags using the $lang_string as the identifier.

User avatar

~0026305

daryn (reporter)

Patch merged with following changes:

Modified mantis wrapper to include plugin output for the EVENT_LAYOUT_BODY_BEGIN
and EVENT_LAYOUT_BODY_END events.

Modified menu-bar to be a class and named it main-menu-container as it the main
menu may appear above and below the content and with new styling may not be a bar.

Added a content wrapper to isolate the content from the template elements.
User avatar

~0026453

daryn (reporter)

Added some ids on bug change status page.
User avatar

~0026463

daryn (reporter)

Added ids and classes on view all bug filter.
User avatar

~0036381

grangeway (reporter)

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch
+  Notes

- Related Changesets
MantisBT: master 0c379c9d
Timestamp: 2010-08-13 16:34:51
Author: daryn
Details ] Diff ]
Fix 0011995 - Merge patch for adding id's and classes to layout elements
with some minor changes. Added a content wrapper also.

Contributed-by: Brandon Jackson <brandonscottjackson@gmail.com
Signed-off-by: Daryn Warriner <daryn@iivip.com>
mod - core/html_api.php Diff ] File ]
MantisBT: master 729d5530
Timestamp: 2010-08-13 17:29:01
Author: daryn
Details ] Diff ]
Fix 0011995 - Add containers and ids to allow styling of various menus.
mod - core/html_api.php Diff ] File ]
MantisBT: master ca23cc99
Timestamp: 2010-08-24 14:23:37
Author: daryn
Details ] Diff ]
Bug 0011995 - Add a css id and name to bug change status form.
mod - bug_change_status_page.php Diff ] File ]
MantisBT: master a50748bb
Timestamp: 2010-08-24 14:24:37
Author: daryn
Details ] Diff ]
Bug 0011995 - Add css id to bugnote row on bug change status page. This should eventually
be a div rather than a table row.
mod - bug_change_status_page.php Diff ] File ]
MantisBT: master 6b5e037c
Timestamp: 2010-08-25 05:31:45
Author: daryn
Details ] Diff ]
Bug 0011826, Bug 0011995, Fix invalid html in the view all bug filter. Add divs, classes and id's
where necessary to facilitate moving style elements into css and inline
javascript into javascript files.
mod - css/default.css Diff ] File ]
mod - core/filter_api.php Diff ] File ]
mod - javascript/dev/common.js Diff ] File ]
mod - javascript/common.js Diff ] File ]
MantisBT: master 7ec1d497
Timestamp: 2010-08-27 17:00:51
Author: daryn
Details ] Diff ]
Issue 0011826 - Remove all inline JavaScript from MantisBT (use external scripts instead)
Issue 0011995 - Add CSS IDs to html elements for styling and javascript access.
mod - css/default.css Diff ] File ]
mod - core/html_api.php Diff ] File ]
mod - javascript/dev/common.js Diff ] File ]
mod - javascript/common.js Diff ] File ]

+ Related Changesets

- Issue History
Date Modified Username Field Change
2010-06-05 02:41 brandonjackson New Issue
2010-06-05 02:42 brandonjackson File Added: new-element-ids.patch
2010-06-05 02:43 brandonjackson Tag Attached: patch
2010-06-14 23:52 djcarr Note Added: 0025850
2010-06-14 23:52 djcarr Note Edited: 0025850 View Revisions
2010-06-14 23:53 djcarr Note Edited: 0025850 View Revisions
2010-06-14 23:53 djcarr Note Edited: 0025850 View Revisions
2010-08-13 12:49 daryn Changeset attached => MantisBT master 0c379c9d
2010-08-13 12:49 daryn Assigned To => daryn
2010-08-13 12:49 daryn Resolution open => fixed
2010-08-13 12:49 daryn Fixed in Version => 1.3.0-beta.1
2010-08-13 12:51 daryn Note Added: 0026305
2010-08-13 12:51 daryn Status new => assigned
2010-08-13 13:29 daryn Changeset attached => MantisBT master 729d5530
2010-08-24 10:25 daryn Changeset attached => MantisBT master a50748bb
2010-08-24 10:25 daryn Changeset attached => MantisBT master ca23cc99
2010-08-24 10:27 daryn Summary CSS IDs added to header => Add CSS IDs to html elements for styling and javascript access.
2010-08-24 10:27 daryn Note Added: 0026453
2010-08-25 02:05 daryn Changeset attached => MantisBT master 6b5e037c
2010-08-25 02:09 daryn Note Added: 0026463
2010-08-27 13:02 daryn Changeset attached => MantisBT master 7ec1d497
2010-09-28 20:12 daryn Tag Attached: redesign
2012-02-26 16:32 grangeway Status assigned => resolved
2013-04-05 17:57 grangeway Status resolved => acknowledged
2013-04-05 17:57 grangeway Note Added: 0036381
2013-04-05 18:14 grangeway Relationship added related to 0015721
2013-04-06 09:26 dregad Tag Attached: 2.0.x check
2013-04-06 09:26 dregad Status acknowledged => resolved
2013-04-27 17:47 atrol Target Version => 1.3.0-beta.1
2014-09-23 18:05 grangeway Tag Detached: 2.0.x check
2014-12-08 00:34 vboctor Status resolved => closed
+ Issue History