Textilized project descriptions on project list and home page.
Added jsToolbar on project form. git-svn-id: http://redmine.rubyforge.org/svn/trunk@651 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a7033c8bac
commit
7b366758fd
|
@ -139,6 +139,8 @@ module ApplicationHelper
|
|||
format_wiki_link = Proc.new {|project, title| url_for :controller => 'wiki', :action => 'index', :id => project, :page => title }
|
||||
end
|
||||
|
||||
project = options[:project] || @project
|
||||
|
||||
# turn wiki links into html links
|
||||
# example:
|
||||
# [[mypage]]
|
||||
|
@ -148,15 +150,15 @@ module ApplicationHelper
|
|||
# [[project:mypage]]
|
||||
# [[project:mypage|mytext]]
|
||||
text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) do |m|
|
||||
project = @project
|
||||
link_project = project
|
||||
page = $1
|
||||
title = $3
|
||||
if page =~ /^([^\:]+)\:(.*)$/
|
||||
project = Project.find_by_name($1) || Project.find_by_identifier($1)
|
||||
link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
|
||||
page = $2
|
||||
title = $1 if page.blank?
|
||||
end
|
||||
link_to((title || page), format_wiki_link.call(project, Wiki.titleize(page)), :class => 'wiki-page')
|
||||
link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page)), :class => 'wiki-page')
|
||||
end
|
||||
|
||||
# turn issue ids into links
|
||||
|
@ -167,7 +169,7 @@ module ApplicationHelper
|
|||
# turn revision ids into links (@project needed)
|
||||
# example:
|
||||
# r52 -> <a href="/repositories/revision/6?rev=52">r52</a> (@project.id is 6)
|
||||
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
|
||||
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
|
||||
|
||||
# when using an image link, try to use an attachment, if possible
|
||||
attachments = options[:attachments]
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<% for project in @projects %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td><%= project.active? ? link_to(project.name, :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %>
|
||||
<td><%=h project.description %>
|
||||
<td><%= textilizable project.description, :project => project %>
|
||||
<td align="center"><%= image_tag 'true.png' if project.is_public? %>
|
||||
<td align="center"><%= project.children.size %>
|
||||
<td align="center"><%= format_date(project.created_on) %>
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
<p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %><br /><em><%= l(:text_caracters_maximum, 255) %></em></p>
|
||||
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 5 %><em><%= l(:text_caracters_maximum, 255) %></em></p>
|
||||
<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>
|
||||
<p><%= f.text_field :homepage, :size => 40 %></p>
|
||||
<p><%= f.check_box :is_public %></p>
|
||||
<%= wikitoolbar_for 'project_description' %>
|
||||
|
||||
<% for @custom_value in @custom_values %>
|
||||
<p><%= custom_field_tag_with_label @custom_value %></p>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td>
|
||||
<%= link_to project.name, {:action => 'show', :id => project}, :class => (@logged_in_user && @logged_in_user.role_for_project(project) ? "icon icon-fav" : "") %><br />
|
||||
<%=h project.description %>
|
||||
<%= textilizable project.description, :project => project %>
|
||||
</td>
|
||||
<td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td>
|
||||
<td align="center"><%= format_date(project.created_on) %></td>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<% for project in @projects %>
|
||||
<li>
|
||||
<%= link_to project.name, :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)<br />
|
||||
<%=h project.description %>
|
||||
<%= textilizable project.description, :project => project %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
}
|
||||
|
||||
.jstHandle {
|
||||
height: 16px;
|
||||
height: 10px;
|
||||
font-size: 0.1em;
|
||||
cursor: s-resize;
|
||||
/*background: transparent url(img/resizer.png) no-repeat 45% 50%;*/
|
||||
|
|
Loading…
Reference in New Issue