Welcome Guest Login Register Member List
ExpressionEngine Forums
Advanced Search
Username: Password:
Remember Me? forgot password?
You are here: Forum Home  >  Usage  >  Tips and Tricks  >  Thread
   
 
Small modifications
 
Zteven
Posted: 14 October 2006 08:58 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  3
Joined  2006-08-26

Hi,

I’ve been tinkering with my Tracks install, which is made a bit more difficult since I’m have no experience with Ruby whatsoever. So far I tried the following:

- Instead of [C] and [P], display something more informative. This turned out to be pretty easy: in _item.rhtml I changed the displaying code to the following:

<% if item.done? -%>
  (<%= 
item.context.name %><%= ", " + item.project.name if item.project_id %>)
<% else -%>
  <% if @
on_page == "project" -%>
          <%= 
link_to( "(" + truncate( item.context.name ) + ")", { :controller => "context", 
:
action => "show", :name => urlize(item.context.name) }, :title => "View context: #{item.context.name}" ) %>
  <% 
elsif item.project_id -%>
          <%= 
link_to( "[" + truncate( item.project.name ) + "]", { :controller => "project", 
:
action => "show", :name => urlize(item.project.name) }, :title => "View project: #{item.project.name}" ) %>
  <% 
end -%>
<% 
end -%> 

- Feeling quite pleased, I set out to change the display of an action such that the first letter is always capitalized. This is because my wife enters actions without capitals and this irks me. However, I have not managed to achieve the desired effect. It’s got to be incredibly easy, so maybe someone with more experience in Ruby can help?

- Finally, I want to change the sizes of the tables on the screen. I always get too much lost blank space on the right of the screen. If I change standard.css as follows:

lampje:/usr/src/tracks-1.042/public/stylesheets# diff standard.css standard.css.bu
56,57c56,57
<       width: 70%;
<       
margin: 0px 50px 50px 15px;
---
>       
width: 450px;
>       
margin: 0px 15px 50px 15px;
61c61
<       width: 70%;
---
>       
width: 450px;
67,68c67,68
<       width: 80%;
<       
margin: 15px 15px 50px 15px;
---
>       
width: 800px;
>       
margin: 0px 15px 50px 15px;
73,74c73,74
<       width: 80%;
<       
margin: 15px 15px 50px 15px;
---
>       
width: 820px;
>       
margin: 0px 15px 50px 15px;
189c189
<       padding-left: 3px;
---
>               
padding-left: 3px; 

... it looks like I want. However, when I try to enter a new action, the whole sidebar moves to the bottom of the page and after pressing enter I get a large green rectangle that covers the screen. Does anyone have any idea how to solve this?

Bye,
Steven

Profile
 
bsag
Posted: 21 October 2006 02:45 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05
Zteven - 14 October 2006 08:58 AM

Hi,

- Feeling quite pleased, I set out to change the display of an action such that the first letter is always capitalized. This is because my wife enters actions without capitals and this irks me. However, I have not managed to achieve the desired effect. It’s got to be incredibly easy, so maybe someone with more experience in Ruby can help?

It should work if you find the places where the item description is displayed on the page, and add the method .capitalize after it. e.g. in todo/_item.rb:

<%= sanitize(item.description.capitalize) %> 

I’m not quite sure where your CSS is going wrong, but I’ll have a think about that.

Profile
 
Zteven
Posted: 28 October 2006 01:16 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  3
Joined  2006-08-26

I managed to get a stylesheet working that looks nice and uses my whole browserwindow. It uses the following changes compared to the version from the release:

lampje:/usr/src/tracks-1.042/public/stylesheets# diff standard.css standard.css.bu
56c56
<       width: 70%;
---
>       
width: 450px;
61c61
<       width: 550px;
---
>       
width: 450px;
67c67
<       width: 95%;
---
>       
width: 800px;
150,153c150,151
<       float: right;
<       
width: 25%;
<       
margin: 20px 0x 0px 0px;
<       
padding: 0px 0px 0px 0px;
---
>       
margin: 20px 15px 0px 490px;
>       
padding: 0px 15px 0px 15px;
165c163
< /*      width: 20px;*/
---
>       
width: 20px; 

My issue with capitalization was solved by an article I found here: http://rubyquiz.com/quiz89.html .

This solution makes the first character of a sentence capitalized, but also capitalizes certain words (such as names). It also adds replacements of abbreviations for their full description (such as ppl -> people). Note that the public directory needs to be writable for the generated yaml file.

I wanted to attach my modified files but only images are allowed. :-( Quoting the diff of the modifications resulted in an error “Precondition not met” when previewing.

Hope this helps anyone,
Steven

Profile
 
   
 
 
‹‹ create a task by sending an email      Move info from hosted Tracks to my own computer? ››

Powered By ExpressionEngine
Template Design By Sonnenvogel.com
Select a theme:

ExpressionEngine Discussion Forum - Version 2.1.2 (20091002)
Script Executed in 0.1053 seconds

Atom Feed
RSS 2.0