Interface: algumas mudancas para comportar melhor textos grandes
This commit is contained in:
@@ -53,6 +53,10 @@ module ApplicationHelper
|
||||
BlueCloth.new(text).to_html
|
||||
end
|
||||
|
||||
def formatted(text)
|
||||
h(text).gsub("\n", "<br/>")
|
||||
end
|
||||
|
||||
def highlight(name)
|
||||
return {:class => 'highlight'} if (flash[:highlight] == name)
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
%div.cmd
|
||||
= action_icon 'edit', 'Editar', edit_course_event_url(@course, event)
|
||||
= action_icon 'trash', 'Excluir', course_event_url(@course, event), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
= h(event.description)
|
||||
= formatted(event.description)
|
||||
= "Sem descrição" if event.description.empty?
|
||||
|
||||
- last_date = event.time
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
= link_to("Noticias", course_news_index_url(@course))
|
||||
|
||||
- @left_panel = render 'courses/_left_panel'
|
||||
- @right_panel = render 'courses/_right_panel'
|
||||
- @content = yield
|
||||
|
||||
= render 'layouts/base'
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
.cmd
|
||||
= action_icon 'edit', 'Editar', edit_course_news_url(@course, n)
|
||||
= action_icon 'trash', 'Excluir', course_news_url(@course, n), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
= h(n.body)
|
||||
= formatted(n.body)
|
||||
= "Sem descrição" if n.body.empty?
|
||||
- else
|
||||
.box
|
||||
|
||||
@@ -8,7 +8,7 @@ xml.rss(:version=>"2.0") do
|
||||
for news_item in @news
|
||||
xml.item do
|
||||
xml.title(news_item.title)
|
||||
xml.description(news_item.body)
|
||||
xml.description(formatted(news_item.body))
|
||||
xml.pubDate(news_item.timestamp.rfc2822)
|
||||
xml.link(course_news_url(@course, news_item))
|
||||
xml.guid(course_news_url(@course, news_item))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
= link_to(h(n.course.full_name), course_url(n.course)) + " ›"
|
||||
= link_to(h(n.title), course_news_url(n.course, n))
|
||||
- unless n.body.empty?
|
||||
%p= h(n.body)
|
||||
%p= truncate(n.body, 300)
|
||||
|
||||
.box
|
||||
.cmd
|
||||
|
||||
@@ -8,7 +8,7 @@ xml.rss(:version=>"2.0") do
|
||||
for news_item in @news
|
||||
xml.item do
|
||||
xml.title(news_item.course.short_name + ": " + news_item.title)
|
||||
xml.description(news_item.body)
|
||||
xml.description(formatted(news_item.body))
|
||||
xml.pubDate(news_item.timestamp.rfc2822)
|
||||
xml.link(course_news_url(news_item.course, news_item))
|
||||
xml.guid(course_news_url(news_item.course, news_item))
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<% @events.each do |e| -%>
|
||||
<li style="display: none" class="event_item events_<%=e.time.strftime('%Y_%m-%d')%>">
|
||||
<%= link_to e.time.strftime("%d de %B"), course_event_url(@course, e) %>.
|
||||
<%= h(e.title) %>. <%= truncate(h(e.description), 50) %>
|
||||
<%= h(e.title) %>
|
||||
</li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user