Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion controller/index_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ public function index()
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC', ext::$statuses['IMPLEMENTED']);
$this->assign_template_block_vars('implemented_ideas', $ideas);

// Generate in progress
$ideas = $this->entity->get_ideas(ext::NUM_IDEAS, ext::SORT_DATE, 'DESC', ext::$statuses['IN_PROGRESS']);
$this->assign_template_block_vars('in_progress_ideas', $ideas);

$this->template->assign_vars(array(
'U_VIEW_TOP' => $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_TOP]),
'U_VIEW_LATEST' => $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_NEW]),
'U_VIEW_IMPLEMENTED'=> $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_DATE, 'status' => ext::$statuses['IMPLEMENTED']]),
'U_VIEW_IN_PROGRESS'=> $this->helper->route('phpbb_ideas_list_controller', ['sort' => ext::SORT_DATE, 'status' => ext::$statuses['IN_PROGRESS']]),
'U_POST_ACTION' => $this->helper->route('phpbb_ideas_post_controller'),
'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) : '',

));

// Assign breadcrumb template vars
Expand Down
4 changes: 4 additions & 0 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'CLICK_TO_VIEW' => 'Click to view votes.',
'CONFIRM_DELETE' => 'Are you sure you want to delete this idea?',

'DATE' => 'Date',
'DELETE_IDEA' => 'Delete idea',
'DUPLICATE' => 'Duplicate',
'DUPLICATE_PLACEHOLDER' => 'Start typing a title',
Expand All @@ -47,6 +48,7 @@
'IMPLEMENTED_IDEAS' => 'Recently Implemented Ideas',
'IMPLEMENTED_VERSION' => 'phpBB version',
'IN_PROGRESS' => 'In Progress',
'IN_PROGRESS_IDEAS' => 'Ideas In Progress',
'INVALID' => 'Invalid',
'INVALID_IDEA_QUERY' => 'Invalid SQL query. Ideas failed to load.',
'INVALID_VOTE' => 'Invalid vote; the number you entered was invalid.',
Expand Down Expand Up @@ -88,6 +90,7 @@
'TICKET' => 'Ticket',
'TICKET_ERROR' => 'Ticket ID must be of the format “PHPBB-#####” or “PHPBB3-#####”.',
'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.',
'TITLE' => 'Title',
'TOP' => 'Top',
'TOP_IDEAS' => 'Top Ideas',
'TOTAL_IDEAS' => [
Expand All @@ -108,6 +111,7 @@

'VIEW_IDEA' => 'View Idea',
'VIEW_IMPLEMENTED' => 'View all implemented ideas',
'VIEW_IN_PROGRESS' => 'View all in progress ideas',
'VIEW_LATEST' => 'View all open ideas',
'VIEW_TOP' => 'View all top voted ideas',
'VIEWING_IDEAS' => 'Viewing Ideas',
Expand Down
85 changes: 28 additions & 57 deletions styles/prosilver/template/index_body.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
{% macro ideas_section(title, ideas, view_url, icon_class, view_text) %}
<div class="flex-box flex-align-end flex-justify">
<h2>{{ title }}</h2>
{% if ideas %}
<a class="button view-all" href="{{ view_url }}"><i class="icon fa-fw {{ icon_class }}"></i> <span>{{ view_text }}</span></a>
{% endif %}
</div>
<div class="forumbg">
<div class="inner">
<ul class="topiclist">
<li class="header">
<dl class="row-item">
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
<dd class="posts">{{ lang('VOTES') }}</dd>
</dl>
</li>
</ul>
{% include '@phpbb_ideas/index_list.html' with {ideas: ideas} %}
</div>
</div>
{% endmacro %}

{% INCLUDECSS '@phpbb_ideas/ideas.css' %}

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

{# TOP IDEAS #}
<div class="flex-box flex-align-end flex-justify">
<h2>{{ lang('TOP_IDEAS') }}</h2>
{% if top_ideas %}
<a class="button view-all" href="{{ U_VIEW_TOP }}"><i class="icon fa-fw fa-line-chart"></i> <span>{{ lang('VIEW_TOP') }}</span></a>
{% endif %}
</div>
<div class="forumbg">
<div class="inner">
<ul class="topiclist">
<li class="header">
<dl class="row-item">
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
<dd class="posts">{{ lang('VOTES') }}</dd>
</dl>
</li>
</ul>
{% include '@phpbb_ideas/index_list.html' with {ideas: top_ideas} %}
</div>
</div>
{{ _self.ideas_section(lang('TOP_IDEAS'), top_ideas, U_VIEW_TOP, 'fa-line-chart', lang('VIEW_TOP')) }}

{# LATEST IDEAS #}
<div class="flex-box flex-align-end flex-justify">
<h2>{{ lang('LATEST_IDEAS') }}</h2>
{% if latest_ideas %}
<a class="button view-all" href="{{ U_VIEW_LATEST }}"><i class="icon fa-fw fa-lightbulb-o"></i> <span>{{ lang('VIEW_LATEST') }}</span></a>
{% endif %}
</div>
<div class="forumbg">
<div class="inner">
<ul class="topiclist">
<li class="header">
<dl class="row-item">
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
<dd class="posts">{{ lang('VOTES') }}</dd>
</dl>
</li>
</ul>
{% include '@phpbb_ideas/index_list.html' with {ideas: latest_ideas} %}
</div>
</div>
{{ _self.ideas_section(lang('LATEST_IDEAS'), latest_ideas, U_VIEW_LATEST, 'fa-lightbulb-o', lang('VIEW_LATEST')) }}

{# IMPLEMENTED IDEAS #}
<div class="flex-box flex-align-end flex-justify">
<h2>{{ lang('IMPLEMENTED_IDEAS') }}</h2>
{% if implemented_ideas %}
<a class="button view-all" href="{{ U_VIEW_IMPLEMENTED }}"><i class="icon fa-fw fa-code-fork fa-flip-vertical"></i> <span>{{ lang('VIEW_IMPLEMENTED') }}</span></a>
{% endif %}
</div>
<div class="forumbg">
<div class="inner">
<ul class="topiclist">
<li class="header">
<dl class="row-item">
<dt><div class="list-inner">{{ lang('IDEAS') }}</div></dt>
<dd class="posts">{{ lang('VOTES') }}</dd>
</dl>
</li>
</ul>
{% include '@phpbb_ideas/index_list.html' with {ideas: implemented_ideas} %}
</div>
</div>
{{ _self.ideas_section(lang('IMPLEMENTED_IDEAS'), implemented_ideas, U_VIEW_IMPLEMENTED, 'fa-code-fork fa-flip-vertical', lang('VIEW_IMPLEMENTED')) }}

{# IN PROGRESS IDEAS #}
{{ _self.ideas_section(lang('IN_PROGRESS_IDEAS'), in_progress_ideas, U_VIEW_IN_PROGRESS, 'fa-clock-o', lang('VIEW_IN_PROGRESS')) }}

<br><br>

Expand Down
2 changes: 1 addition & 1 deletion tests/controller/index_controller_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function test_controller($status_code, $page_content)
$controller = $this->get_controller('index_controller', 'ideas');
self::assertInstanceOf('phpbb\ideas\controller\index_controller', $controller);

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

Expand Down
Loading