##// END OF EJS Templates
Textilized project descriptions on project list and home page....
Jean-Philippe Lang -
r645:7b366758fdc4
parent child
Show More
@@ -139,6 +139,8 module ApplicationHelper
139 format_wiki_link = Proc.new {|project, title| url_for :controller => 'wiki', :action => 'index', :id => project, :page => title }
139 format_wiki_link = Proc.new {|project, title| url_for :controller => 'wiki', :action => 'index', :id => project, :page => title }
140 end
140 end
141
141
142 project = options[:project] || @project
143
142 # turn wiki links into html links
144 # turn wiki links into html links
143 # example:
145 # example:
144 # [[mypage]]
146 # [[mypage]]
@@ -148,15 +150,15 module ApplicationHelper
148 # [[project:mypage]]
150 # [[project:mypage]]
149 # [[project:mypage|mytext]]
151 # [[project:mypage|mytext]]
150 text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) do |m|
152 text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) do |m|
151 project = @project
153 link_project = project
152 page = $1
154 page = $1
153 title = $3
155 title = $3
154 if page =~ /^([^\:]+)\:(.*)$/
156 if page =~ /^([^\:]+)\:(.*)$/
155 project = Project.find_by_name($1) || Project.find_by_identifier($1)
157 link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
156 page = $2
158 page = $2
157 title = $1 if page.blank?
159 title = $1 if page.blank?
158 end
160 end
159 link_to((title || page), format_wiki_link.call(project, Wiki.titleize(page)), :class => 'wiki-page')
161 link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page)), :class => 'wiki-page')
160 end
162 end
161
163
162 # turn issue ids into links
164 # turn issue ids into links
@@ -167,7 +169,7 module ApplicationHelper
167 # turn revision ids into links (@project needed)
169 # turn revision ids into links (@project needed)
168 # example:
170 # example:
169 # r52 -> <a href="/repositories/revision/6?rev=52">r52</a> (@project.id is 6)
171 # r52 -> <a href="/repositories/revision/6?rev=52">r52</a> (@project.id is 6)
170 text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", {:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1}, :class => 'changeset' } if @project
172 text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", {:controller => 'repositories', :action => 'revision', :id => project.id, :rev => $1}, :class => 'changeset' } if project
171
173
172 # when using an image link, try to use an attachment, if possible
174 # when using an image link, try to use an attachment, if possible
173 attachments = options[:attachments]
175 attachments = options[:attachments]
@@ -27,7 +27,7
27 <% for project in @projects %>
27 <% for project in @projects %>
28 <tr class="<%= cycle("odd", "even") %>">
28 <tr class="<%= cycle("odd", "even") %>">
29 <td><%= project.active? ? link_to(project.name, :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %>
29 <td><%= project.active? ? link_to(project.name, :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %>
30 <td><%=h project.description %>
30 <td><%= textilizable project.description, :project => project %>
31 <td align="center"><%= image_tag 'true.png' if project.is_public? %>
31 <td align="center"><%= image_tag 'true.png' if project.is_public? %>
32 <td align="center"><%= project.children.size %>
32 <td align="center"><%= project.children.size %>
33 <td align="center"><%= format_date(project.created_on) %>
33 <td align="center"><%= format_date(project.created_on) %>
@@ -8,10 +8,11
8 <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
8 <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
9 <% end %>
9 <% end %>
10
10
11 <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %><br /><em><%= l(:text_caracters_maximum, 255) %></em></p>
11 <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 5 %><em><%= l(:text_caracters_maximum, 255) %></em></p>
12 <p><%= f.text_field :identifier, :required => true, :size => 15, :disabled => @project.identifier_frozen? %><br /><em><%= l(:text_length_between, 3, 12) %> <%= l(:text_project_identifier_info) unless @project.identifier_frozen? %></em></p>
12 <p><%= f.text_field :identifier, :required => true, :size => 15, :disabled => @project.identifier_frozen? %><br /><em><%= l(:text_length_between, 3, 12) %> <%= l(:text_project_identifier_info) unless @project.identifier_frozen? %></em></p>
13 <p><%= f.text_field :homepage, :size => 40 %></p>
13 <p><%= f.text_field :homepage, :size => 40 %></p>
14 <p><%= f.check_box :is_public %></p>
14 <p><%= f.check_box :is_public %></p>
15 <%= wikitoolbar_for 'project_description' %>
15
16
16 <% for @custom_value in @custom_values %>
17 <% for @custom_value in @custom_values %>
17 <p><%= custom_field_tag_with_label @custom_value %></p>
18 <p><%= custom_field_tag_with_label @custom_value %></p>
@@ -11,7 +11,7
11 <tr class="<%= cycle("odd", "even") %>">
11 <tr class="<%= cycle("odd", "even") %>">
12 <td>
12 <td>
13 <%= link_to project.name, {:action => 'show', :id => project}, :class => (@logged_in_user && @logged_in_user.role_for_project(project) ? "icon icon-fav" : "") %><br />
13 <%= link_to project.name, {:action => 'show', :id => project}, :class => (@logged_in_user && @logged_in_user.role_for_project(project) ? "icon icon-fav" : "") %><br />
14 <%=h project.description %>
14 <%= textilizable project.description, :project => project %>
15 </td>
15 </td>
16 <td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td>
16 <td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td>
17 <td align="center"><%= format_date(project.created_on) %></td>
17 <td align="center"><%= format_date(project.created_on) %></td>
@@ -15,7 +15,7
15 <% for project in @projects %>
15 <% for project in @projects %>
16 <li>
16 <li>
17 <%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)<br />
17 <%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)<br />
18 <%=h project.description %>
18 <%= textilizable project.description, :project => project %>
19 </li>
19 </li>
20 <% end %>
20 <% end %>
21 </ul>
21 </ul>
@@ -6,7 +6,7
6 }
6 }
7
7
8 .jstHandle {
8 .jstHandle {
9 height: 16px;
9 height: 10px;
10 font-size: 0.1em;
10 font-size: 0.1em;
11 cursor: s-resize;
11 cursor: s-resize;
12 /*background: transparent url(img/resizer.png) no-repeat 45% 50%;*/
12 /*background: transparent url(img/resizer.png) no-repeat 45% 50%;*/
General Comments 0
You need to be logged in to leave comments. Login now