Skip to content

Commit f8fa7e8

Browse files
committed
chore: tag filtering is now in line with tags display
1 parent 793395b commit f8fa7e8

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
lines changed

languages/en.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
'questions:menu:filter:todo' => "Todo",
3030
'questions:menu:filter:todo_group' => "Group Todo",
3131
'questions:menu:filter:experts' => "Experts",
32-
'questions:menu:filter:tags' => "Tags: %s",
3332

3433
'river:object:question:create' => '%s asked question %s',
3534
'river:object:question:comment' => '%s commented on the question %s',
@@ -39,6 +38,8 @@
3938
'questions' => 'Questions',
4039
'questions:marked:correct' => 'Correct answer provided',
4140

41+
'questions:filter_by_tag' => 'Filter by tag',
42+
4243
'questions:everyone' => 'All Questions',
4344
'questions:add' => 'Add a Question',
4445
'questions:todo' => 'Todo',

languages/nl.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'collection:object:answer' => 'Antwoorden',
1313
'questions:marked:correct' => 'Juiste antwoord is gegeven',
1414
'widget:questions:edit:group' => 'Beperk de vragen tot de opgegeven groep',
15+
'questions:filter_by_tag' => 'Verfijn met tags',
1516
'questions:menu:filter:tags' => 'Tags: %s',
1617
'questions:notification:auto_close:subject' => 'De vraag \'%s\' is gesloten vanwege inactiviteit',
1718
'questions:notification:auto_close:summary' => 'De vraag \'%s\' is gesloten vanwege inactiviteit',

views/default/css/questions/site.css

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99
display: inline-block;
1010
}
1111

12-
li {
13-
border: 1px solid $(border-color-strong);
14-
padding: 0 .5rem;
15-
border-radius: 4px;
16-
17-
a {
18-
text-decoration: none;
12+
li.elgg-tag {
13+
a {
14+
line-height: inherit;
1915
}
2016
}
2117
}

views/default/questions/filter.php

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
return $qb->compare("{$main_alias}.entity_guid", 'in', $subquery->getSQL());
2626
};
2727

28-
$menu_options = [
29-
'class' => ['elgg-menu-hz'],
30-
];
31-
32-
$content_options = [
33-
'class' => ['questions-tags-filter'],
34-
];
35-
3628
$items = [];
3729
foreach ($tags as $tag) {
3830
$new_tags = $tags;
@@ -71,24 +63,17 @@
7163
}
7264
}
7365

74-
if (empty($tags) && !empty($items)) {
75-
// add show filter
76-
$content_options['class'][] = 'hidden';
77-
78-
elgg_register_menu_item('filter:questions', [
79-
'name' => 'show_tags',
80-
'icon' => 'filter',
81-
'text' => elgg_echo('filter'),
82-
'href' => false,
83-
'priority' => 9999,
84-
'data-toggle-selector' => '.questions-tags-filter',
85-
'rel' => 'toggle',
86-
]);
66+
if (empty($items)) {
67+
return;
8768
}
8869

89-
$menu_options['items'] = $items;
90-
91-
$content = elgg_format_element('strong', [], elgg_echo('filter') . ': ');
92-
$content .= elgg_view_menu('questions_tags', $menu_options);
70+
$content = elgg_format_element('strong', [], elgg_echo('questions:filter_by_tag') . ': ');
71+
$content .= elgg_view_menu('questions_tags', [
72+
'class' => ['elgg-menu-hz'],
73+
'items' => $items,
74+
'item_class' => 'elgg-tag',
75+
]);
9376

94-
echo elgg_format_element('div', $content_options, $content);
77+
echo elgg_format_element('div', [
78+
'class' => ['questions-tags-filter', 'elgg-tags'],
79+
], $content);

0 commit comments

Comments
 (0)