Modify

Opened 8 years ago

Last modified 8 years ago

#12836 new enhancement

Cards table size should allow dynamic sizes

Reported by: anonymous Owned by: Peter Suter
Priority: normal Component: CardsPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

Right now, the width of the table defaults to 400 pixels, and can be set to any other fixed amount.

I would love to set it to 100%.

(I want the table as wide as possible, but cannot set it wider than the smallest screens width in my team)

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by Peter Suter

Can you try this patch?

# HG changeset patch
# User Peter Suter <petsuter@gmail.com>
# Date 1470202880 -7200
#      Wed Aug 03 07:41:20 2016 +0200
# Node ID 11458f22904524a4e7064cbcfb45c55ed0503820
# Parent  5942962dcfeac6ed00786a51ae5082bb54f76793
CardsPlugin: Allow specifying width in percent.
(see #12836)

diff -r 5942962dcfea -r 11458f229045 cards/macro.py
--- a/cards/macro.py	Fri Nov 27 15:21:08 2015 +0100
+++ b/cards/macro.py	Wed Aug 03 07:41:20 2016 +0200
@@ -52,7 +52,9 @@
         labels = [label for label in kw.get('label', '').split('|') if label]
         labels = dict(zip(stack_names, labels + stack_names[len(labels):]))
 
-        width = int(kw.get('width', 400))
+        width = kw.get('width', '400')
+        if not width.endswith('%'):
+            width = width + 'px'
 
         req = formatter.req
         context = formatter.context
diff -r 5942962dcfea -r 11458f229045 cards/templates/cards_macro.html
--- a/cards/templates/cards_macro.html	Fri Nov 27 15:21:08 2015 +0100
+++ b/cards/templates/cards_macro.html	Wed Aug 03 07:41:20 2016 +0200
@@ -8,7 +8,7 @@
 
   <div class='trac-cards-board'
        id='trac-cards-${board_data_id}'
-       style='width:${width}px'>
+       style='width:${width}'>
     <div class='trac-cards-board-buttons inlinebuttons'>
       <input class="trac-cards-reload" type="submit" name="refresh" value="Refresh"/>
       <input class="trac-cards-export-board" type="submit" name="export-all" value="Export"/>

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Peter Suter.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.