matrix layout improvement

Enc0der

Joined: 2004-04-20
Posts: 23
Posted: Tue, 2005-01-11 08:35

Hi

here's a little change in /layouts/matrix/templates/albumBody.tpl that makes it better for showing the album's description in full width:

Change the entire <div class="gbTopFlag"> with this new code:

    <div class="gbTopFlag">
      <table class="gbTitleBanner" width="100%">
        <tr>
          <td>
            <h1 class="giTitle">
              {$layout.item.title|default:$layout.item.pathComponent|markup}
            </h1>
		  </td>
          <td>
            <ul class="giInfo">
              <li>
                {capture name=creationTimestamp}
                {g->date timestamp=$layout.item.creationTimestamp}
                {/capture}
                {g->text text="Date: %s" arg1=$smarty.capture.creationTimestamp}
              </li>
    
              <li>
                {g->text one="Size: %d item" many="Size: %d items"
                         count=$layout.childCount arg1=$layout.childCount}
                {if $layout.descendentCount > $layout.childCount}
                  {g->text one="(%d item total)" many="(%d items total)"
                           count=$layout.descendentCount arg1=$layout.descendentCount}
                {/if}
              </li>    
              {if $layout.showAlbumOwner}
              <li>
                {g->text text="Owner: %s" arg1=$layout.owner.fullName|default:$layout.owner.userName}
              </li>
              {/if}
            </ul>
          </td>
        <tr>
          <td colspan="2" width="100%">
            <p class="giDescription">
              {$layout.item.description|markup}
            </p>      
          </td>
        </tr>
      </table>
    </div>

That's all...

The current code show the description in only 50% width. the other 50% is taken by the album's info (date, etc) (?!)

I put the info in it's own row (with the album's title), and the description in it's own, full width, row.

have phun !

p.s.
I believe the code has already been changed from the alpha 4 version I have, so please implement the above changed on future versions.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2005-01-13 07:34

Can you give us a demo URL where we can see this? And it would be really cool if you could give us a patch to the latest nightly; then if it looks good we can roll it right in.

 
Enc0der

Joined: 2004-04-20
Posts: 23
Posted: Mon, 2005-05-23 10:18

Beta 3 - new function + screen shoots.

File: /gallery2/layouts/matrix/templates/albumBody.tpl

Original <div class="gbBlock gcBackground1">:

    <div class="gbBlock gcBackground1">
      <table width="100%">
	<tr><td style="width: 40%">
	  {if !empty($layout.item.title)}
	    <h2> {$layout.item.title|markup} </h2>
	  {/if}
	  {if !empty($layout.item.description)}
	    <p class="giDescription">
	      {$layout.item.description|markup}
	    </p>
	  {/if}
	</td><td>
	  <p class="giInfo">
	    {capture name=originationTimestamp}
	      {g->date timestamp=$layout.item.originationTimestamp}
	    {/capture}
	    {g->text text="Date: %s" arg1=$smarty.capture.originationTimestamp}
	    <br/>

	    {g->text one="Size: %d item" many="Size: %d items"
	             count=$layout.childCount arg1=$layout.childCount}
            {if $layout.descendentCount > $layout.childCount}
	    <span style="white-space: nowrap">
	      {g->text one="(%d item total)" many="(%d items total)"
                       count=$layout.descendentCount arg1=$layout.descendentCount}
	    </span>
            {/if}
            <br/>
            {if $layout.params.showAlbumOwner}
              {g->text text="Owner: %s" arg1=$layout.owner.fullName|default:$layout.owner.userName}
              <br/>
            {/if}
          </p>
        </td></tr>
      </table>
    </div>

Modified <div class="gbBlock gcBackground1">:

    <div class="gbBlock gcBackground1">
      <table width="100%">
	<tr><td>
	  {if !empty($layout.item.title)}
	    <h2> {$layout.item.title|markup} </h2>
	</td><td align="left">
	  <p class="giInfo">
	    {capture name=originationTimestamp}
	      {g->date timestamp=$layout.item.originationTimestamp}
	    {/capture}
	    {g->text text="Date: %s" arg1=$smarty.capture.originationTimestamp}
	    <br/>

	    {g->text one="Size: %d item" many="Size: %d items"
	             count=$layout.childCount arg1=$layout.childCount}
            {if $layout.descendentCount > $layout.childCount}
	    <span style="white-space: nowrap">
	      {g->text one="(%d item total)" many="(%d items total)"
                       count=$layout.descendentCount arg1=$layout.descendentCount}
	    </span>
            {/if}
            <br/>
            {if $layout.params.showAlbumOwner}
              {g->text text="Owner: %s" arg1=$layout.owner.fullName|default:$layout.owner.userName}
              <br/>
            {/if}
          </p>
        </td></tr>
		<tr>
		<td style="width: 100%" colspan="2">
	  {/if}
	  {if !empty($layout.item.description)}
	    <p class="giDescription">
	      {$layout.item.description|markup}
	    </p>
	  {/if}
		</td>
		</tr>
      </table>
    </div>

Please note the <td align="left"> - I've add align to left because I use RTL.

Screen shoots are attached.
Please implement on future releases.. :)

 
Enc0der

Joined: 2004-04-20
Posts: 23
Posted: Thu, 2005-05-26 13:54

yes? no? maybe? :-?

 
Enc0der

Joined: 2004-04-20
Posts: 23
Posted: Tue, 2005-06-14 12:53

well ?
will this necessery improvment be applied on future releases ?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-06-14 14:30

Nice modificiation. I went through the trouble of adding it on my site. I had done something similar. I like this a lot!

Do you know how to make a diff file? Download the latest nightly from CVS, apply your changes to that file then run the command:
cvs diff -Nu

You then post your patch on the patches portion of the Gallery pages on SourceForge, www.sf.net/projects/gallery, being sure to add [G2] to your subject. Then you post a thread in the Developers forum here to let them know there's a patch for this.

Then you hope they add it ;)

If you don't want to do that, I will tonight or tomorrow since this is a change that I would really like to have in the core install. It's always driven me nuts how that album header was formatted.

Thanks!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-07-19 04:35

Enc0der, don't know if you're keeping up with this thread. Take a look at how the Matrix theme has changed with the new layout.

It's not exactly as you described above, but it is much better.