Patch #2459 » Links-and-filters-for-project-and-author-in-search-and-activity.diff
| app/views/search/index.rhtml (working copy) | ||
|---|---|---|
|
<h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
|
||
|
<dl id="search-results">
|
||
|
<% @results.each do |e| %>
|
||
|
<dt class="<%= e.event_type %>"><%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(e.event_title, 255), @tokens), e.event_url %></dt>
|
||
|
<dt class="<%= e.event_type %>">
|
||
|
<% if @project != e.project -%>
|
||
|
<span class="project">
|
||
|
<%= link_to(h(e.project), { :action => :show, :id => e.project } ) %>
|
||
|
<%= content_tag('span', link_to(l(:label_filter).downcase, params.merge(:id => e.project, :scope => 'subprojects')), { :class => 'filter' }) %>
|
||
|
</span>
|
||
|
<% end -%>
|
||
|
<%= link_to highlight_tokens(truncate(e.event_title, 255), @tokens), e.event_url %>
|
||
|
</dt>
|
||
|
<dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
|
||
|
<span class="author"><%= format_time(e.event_datetime) %></span></dd>
|
||
|
<% end %>
|
||
| app/views/projects/activity.rhtml (working copy) | ||
|---|---|---|
|
<dt class="<%= e.event_type %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
|
||
|
<%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
|
||
|
<span class="time"><%= format_time(e.event_datetime, false) %></span>
|
||
|
<%= content_tag('span', h(e.project), :class => 'project') if @project.nil? || @project != e.project %>
|
||
|
<% if @project.nil? || @project != e.project -%>
|
||
|
<span class="project">
|
||
|
<%= link_to(h(e.project), { :action => :show, :id => e.project } ) %>
|
||
|
<%= content_tag('span', link_to(l(:label_filter).downcase, params.merge(:id => e.project)), { :class => 'filter' }) %>
|
||
|
</span>
|
||
|
<% end -%>
|
||
|
<%= link_to format_activity_title(e.event_title), e.event_url %></dt>
|
||
|
<dd><span class="description"><%= format_activity_description(e.event_description) %></span>
|
||
|
<span class="author"><%= e.event_author if e.respond_to?(:event_author) %></span></dd>
|
||
|
<span class="author">
|
||
|
<% if e.respond_to?(:event_author) -%>
|
||
|
<%= link_to(e.event_author, :controller => :account, :action => :show, :id => e.event_author) %>
|
||
|
<%= content_tag('span', link_to(l(:label_filter).downcase, params.merge(:user_id => e.event_author)), { :class => 'filter' }) %>
|
||
|
<% end %>
|
||
|
</span></dd>
|
||
|
<% end -%>
|
||
|
</dl>
|
||
|
<% end -%>
|
||
| lang/en.yml (working copy) | ||
|---|---|---|
|
label_document_new: New document
|
||
|
label_document_plural: Documents
|
||
|
label_document_added: Document added
|
||
|
label_filter: Filter
|
||
|
label_role: Role
|
||
|
label_role_plural: Roles
|
||
|
label_role_new: New role
|
||
| public/stylesheets/application.css (working copy) | ||
|---|---|---|
|
div#activity dt .time { color: #777; font-size: 80%; }
|
||
|
div#activity dd .description, #search-results dd .description { font-style: italic; }
|
||
|
div#activity span.project:after, #search-results span.project:after { content: " -"; }
|
||
|
div#activity span.filter:before, #search-results span.filter:before { content: "("; }
|
||
|
div#activity span.filter:after, #search-results span.filter:after { content: ")"; }
|
||
|
div#activity span.filter:hover a, #search-results span.filter:hover a,
|
||
|
div#activity span.filter:hover:before, #search-results span.filter:hover:before,
|
||
|
div#activity span.filter:hover:after, #search-results span.filter:hover:after { text-decoration: underline; }
|
||
|
div#activity span.filter a, #search-results span.filter a,
|
||
|
div#activity span.filter:before, #search-results span.filter:before,
|
||
|
div#activity span.filter:after, #search-results span.filter:after { color: #777; font-size: 85%; }
|
||
|
div#activity dd span.description, #search-results dd span.description { display:block; }
|
||
|
#search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; }
|
||