Skip to content

Commit aa4a70c

Browse files
committed
Merge branch 'master' into dev/4.0
2 parents bdc92e0 + e492de0 commit aa4a70c

File tree

4 files changed

+38
-59
lines changed

4 files changed

+38
-59
lines changed

controller/index_controller.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ public function index()
4343
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC', ext::$statuses['IMPLEMENTED']);
4444
$this->assign_template_block_vars('implemented_ideas', $ideas);
4545

46+
// Generate in progress
47+
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC', ext::$statuses['IN_PROGRESS']);
48+
$this->assign_template_block_vars('in_progress_ideas', $ideas);
49+
4650
$this->template->assign_vars(array(
4751
'U_VIEW_TOP' => $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_TOP]),
4852
'U_VIEW_LATEST' => $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_NEW]),
4953
'U_VIEW_IMPLEMENTED'=> $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_DATE, 'status' => ext::$statuses['IMPLEMENTED']]),
54+
'U_VIEW_IN_PROGRESS'=> $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_DATE, 'status' => ext::$statuses['IN_PROGRESS']]),
5055
'U_POST_ACTION' => $this->helper->route('phpbb_ideas_post_controller'),
5156
'U_MCP' => ($this->auth->acl_get('m_', $this->config['ideas_forum_id'])) ? append_sid("{$this->root_path}mcp.$this->php_ext", "f={$this->config['ideas_forum_id']}&i=main&mode=forum_view", true, $this->user->session_id) : '',
52-
5357
));
5458

5559
// Assign breadcrumb template vars

language/en/common.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'CLICK_TO_VIEW' => 'Click to view votes.',
2828
'CONFIRM_DELETE' => 'Are you sure you want to delete this idea?',
2929

30+
'DATE' => 'Date',
3031
'DELETE_IDEA' => 'Delete idea',
3132
'DUPLICATE' => 'Duplicate',
3233
'DUPLICATE_PLACEHOLDER' => 'Start typing a title',
@@ -47,6 +48,7 @@
4748
'IMPLEMENTED_IDEAS' => 'Recently Implemented Ideas',
4849
'IMPLEMENTED_VERSION' => 'phpBB version',
4950
'IN_PROGRESS' => 'In Progress',
51+
'IN_PROGRESS_IDEAS' => 'Ideas In Progress',
5052
'INVALID' => 'Invalid',
5153
'INVALID_IDEA_QUERY' => 'Invalid SQL query. Ideas failed to load.',
5254
'INVALID_VOTE' => 'Invalid vote; the number you entered was invalid.',
@@ -88,6 +90,7 @@
8890
'TICKET' => 'Ticket',
8991
'TICKET_ERROR' => 'Ticket ID must be of the format “PHPBB-#####” or “PHPBB3-#####”.',
9092
'TICKET_ERROR_DUP' => 'You must click on an idea title from the live search results. To delete the duplicate, clear the field and press ENTER. To exit this field press ESC.',
93+
'TITLE' => 'Title',
9194
'TOP' => 'Top',
9295
'TOP_IDEAS' => 'Top Ideas',
9396
'TOTAL_IDEAS' => [
@@ -108,6 +111,7 @@
108111

109112
'VIEW_IDEA' => 'View Idea',
110113
'VIEW_IMPLEMENTED' => 'View all implemented ideas',
114+
'VIEW_IN_PROGRESS' => 'View all in progress ideas',
111115
'VIEW_LATEST' => 'View all open ideas',
112116
'VIEW_TOP' => 'View all top voted ideas',
113117
'VIEWING_IDEAS' => 'Viewing Ideas',

styles/prosilver/template/index_body.html

Lines changed: 28 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
{% macro ideas_section(title, ideas, view_url, icon_class, view_text) %}
2+
<div class="flex-box flex-align-end flex-justify">
3+
<h2>{{ title }}</h2>
4+
{% if ideas %}
5+
<a class="button view-all" href="{{ view_url }}">{{ Icon('font', icon_class, view_text, false, 'c-button-icon far') }}</a>
6+
{% endif %}
7+
</div>
8+
<div class="forumbg">
9+
<div class="inner">
10+
<ul class="topiclist">
11+
<li class="header">
12+
<dl class="row-item">
13+
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
14+
<dd class="posts">{{ lang('VOTES') }}</dd>
15+
</dl>
16+
</li>
17+
</ul>
18+
{% include '@phpbb_ideas/index_list.html' with {ideas: ideas} %}
19+
</div>
20+
</div>
21+
{% endmacro %}
22+
123
{% INCLUDECSS '@phpbb_ideas/ideas.css' %}
224

325
{% include 'overall_header.html' %}
@@ -7,67 +29,16 @@ <h2>{{ lang('IDEAS_TITLE') }}</h2>
729
{% include '@phpbb_ideas/action_bar_top.html' %}
830

931
{# TOP IDEAS #}
10-
<div class="flex-box flex-align-end flex-justify">
11-
<h2>{{ lang('TOP_IDEAS') }}</h2>
12-
{% if top_ideas %}
13-
<a class="button view-all" href="{{ U_VIEW_TOP }}">{{ Icon('font', 'chart-line', lang('VIEW_TOP'), false, 'c-button-icon') }}</a>
14-
{% endif %}
15-
</div>
16-
<div class="forumbg">
17-
<div class="inner">
18-
<ul class="topiclist">
19-
<li class="header">
20-
<dl class="row-item">
21-
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
22-
<dd class="posts">{{ lang('VOTES') }}</dd>
23-
</dl>
24-
</li>
25-
</ul>
26-
{% include '@phpbb_ideas/index_list.html' with {ideas: top_ideas} %}
27-
</div>
28-
</div>
32+
{{ _self.ideas_section(lang('TOP_IDEAS'), top_ideas, U_VIEW_TOP, 'chart-line', lang('VIEW_TOP')) }}
2933

3034
{# LATEST IDEAS #}
31-
<div class="flex-box flex-align-end flex-justify">
32-
<h2>{{ lang('LATEST_IDEAS') }}</h2>
33-
{% if latest_ideas %}
34-
<a class="button view-all" href="{{ U_VIEW_LATEST }}">{{ Icon('font', 'lightbulb', lang('VIEW_LATEST'), false, 'far c-button-icon') }}</a>
35-
{% endif %}
36-
</div>
37-
<div class="forumbg">
38-
<div class="inner">
39-
<ul class="topiclist">
40-
<li class="header">
41-
<dl class="row-item">
42-
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
43-
<dd class="posts">{{ lang('VOTES') }}</dd>
44-
</dl>
45-
</li>
46-
</ul>
47-
{% include '@phpbb_ideas/index_list.html' with {ideas: latest_ideas} %}
48-
</div>
49-
</div>
35+
{{ _self.ideas_section(lang('LATEST_IDEAS'), latest_ideas, U_VIEW_LATEST, 'lightbulb', lang('VIEW_LATEST')) }}
5036

5137
{# IMPLEMENTED IDEAS #}
52-
<div class="flex-box flex-align-end flex-justify">
53-
<h2>{{ lang('IMPLEMENTED_IDEAS') }}</h2>
54-
{% if implemented_ideas %}
55-
<a class="button view-all" href="{{ U_VIEW_IMPLEMENTED }}">{{ Icon('font', 'code-fork', lang('VIEW_IMPLEMENTED'), false, 'c-button-icon') }}</a>
56-
{% endif %}
57-
</div>
58-
<div class="forumbg">
59-
<div class="inner">
60-
<ul class="topiclist">
61-
<li class="header">
62-
<dl class="row-item">
63-
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
64-
<dd class="posts">{{ lang('VOTES') }}</dd>
65-
</dl>
66-
</li>
67-
</ul>
68-
{% include '@phpbb_ideas/index_list.html' with {ideas: implemented_ideas} %}
69-
</div>
70-
</div>
38+
{{ _self.ideas_section(lang('IMPLEMENTED_IDEAS'), implemented_ideas, U_VIEW_IMPLEMENTED, 'code-fork', lang('VIEW_IMPLEMENTED')) }}
39+
40+
{# IN PROGRESS IDEAS #}
41+
{{ _self.ideas_section(lang('IN_PROGRESS_IDEAS'), in_progress_ideas, U_VIEW_IN_PROGRESS, 'clock', lang('VIEW_IN_PROGRESS')) }}
7142

7243
<br><br>
7344

tests/controller/index_controller_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function test_controller($status_code, $page_content)
3535
$controller = $this->get_controller('index_controller', 'ideas');
3636
self::assertInstanceOf('phpbb\ideas\controller\index_controller', $controller);
3737

38-
$this->entity->expects(self::atMost(3))
38+
$this->entity->expects(self::atMost(4))
3939
->method('get_ideas')
4040
->willReturn([$this->initialized_idea_array()]);
4141

0 commit comments

Comments
 (0)