Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #79 from tumb1er/context_columns
Browse files Browse the repository at this point in the history
fixes #77
  • Loading branch information
tumb1er committed Apr 12, 2016
2 parents 633c750 + 7622bd5 commit 42b851a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 6 additions & 10 deletions alco/grep/templates/grep/log_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,16 @@
<%= logline %></span>
{% spaceless %}
<span class="context-pills">
{% for c in columns %}
{% if c.context %}
<% if(js['{{ c.name }}']) { %>
<a href="#{{ c.name }}" class="label context" data-context="{{ c.name }}">{{ c.name }}</a>
<% } %>
{% endif %}
{% for c in context_columns %}
<% if(js['{{ c.name }}']) { %>
<a href="#{{ c.name }}" class="label context" data-context="{{ c.name }}">{{ c.name }}</a>
<% } %>
{% endfor %}
</span>

<div class="context-area">
{% for c in columns %}
{% if c.context %}
<pre class="context" data-context="{{ c.name }}" id="{{ c.name }}"> <%- js['{{ c.name }}'] %> </pre>
{% endif %}
{% for c in context_columns %}
<pre class="context" data-context="{{ c.name }}" id="{{ c.name }}"> <%- js['{{ c.name }}'] %> </pre>
{% endfor %}
</div>
{% endspaceless %}
Expand Down
4 changes: 4 additions & 0 deletions alco/grep/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ def get_context_data(self, **kwargs):
obj = self.get_object(self.get_queryset())
filters = []
columns = []
context_columns = []
ts = time.mktime(obj.index_dates[0].timetuple())
for f in obj.loggercolumn_set.order_by('name'):
if f.display:
columns.append(f)
if f.context:
context_columns.append(f)
if f.filtered:
filters.append({
'title': f.name.title(),
Expand All @@ -57,6 +60,7 @@ def get_context_data(self, **kwargs):
})
cd['filters'] = filters
cd['columns'] = columns
cd['context_columns'] = context_columns
cd['column_names'] = [c.name for c in columns]
return cd

Expand Down

0 comments on commit 42b851a

Please sign in to comment.