From f563b35e6ab583799230090af0c20ff4baffe967 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Sep 2025 10:03:24 -0700 Subject: [PATCH 1/5] Display In Progress Ideas on Ideas list --- controller/index_controller.php | 6 +- language/en/common.php | 2 + styles/prosilver/template/index_body.html | 85 ++++++++--------------- 3 files changed, 35 insertions(+), 58 deletions(-) diff --git a/controller/index_controller.php b/controller/index_controller.php index c1bb878..dabe106 100644 --- a/controller/index_controller.php +++ b/controller/index_controller.php @@ -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 diff --git a/language/en/common.php b/language/en/common.php index 9fdf298..f7fcae2 100644 --- a/language/en/common.php +++ b/language/en/common.php @@ -46,6 +46,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.', @@ -106,6 +107,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', diff --git a/styles/prosilver/template/index_body.html b/styles/prosilver/template/index_body.html index 1cf7375..0b5f0a4 100644 --- a/styles/prosilver/template/index_body.html +++ b/styles/prosilver/template/index_body.html @@ -1,3 +1,25 @@ +{% macro ideas_section(title, ideas, view_url, icon_class, view_text) %} +
+

{{ title }}

+ {% if ideas %} + {{ view_text }} + {% endif %} +
+
+
+
    +
  • +
    +
    {{ lang('IDEAS') }}
    +
    {{ lang('VOTES') }}
    +
    +
  • +
+ {% include '@phpbb_ideas/index_list.html' with {ideas: ideas} %} +
+
+{% endmacro %} + {% INCLUDECSS '@phpbb_ideas/ideas.css' %} {% include 'overall_header.html' %} @@ -7,67 +29,16 @@

{{ lang('IDEAS_TITLE') }}

{% include '@phpbb_ideas/action_bar_top.html' %} {# TOP IDEAS #} -
-

{{ lang('TOP_IDEAS') }}

- {% if top_ideas %} - {{ lang('VIEW_TOP') }} - {% endif %} -
-
-
-
    -
  • -
    -
    {{ lang('IDEAS') }}
    -
    {{ lang('VOTES') }}
    -
    -
  • -
- {% include '@phpbb_ideas/index_list.html' with {ideas: top_ideas} %} -
-
+{{ _self.ideas_section(lang('TOP_IDEAS'), top_ideas, U_VIEW_TOP, 'fa-line-chart', lang('VIEW_TOP')) }} {# LATEST IDEAS #} -
-

{{ lang('LATEST_IDEAS') }}

- {% if latest_ideas %} - {{ lang('VIEW_LATEST') }} - {% endif %} -
-
-
-
    -
  • -
    -
    {{ lang('IDEAS') }}
    -
    {{ lang('VOTES') }}
    -
    -
  • -
- {% include '@phpbb_ideas/index_list.html' with {ideas: latest_ideas} %} -
-
+{{ _self.ideas_section(lang('LATEST_IDEAS'), latest_ideas, U_VIEW_LATEST, 'fa-lightbulb-o', lang('VIEW_LATEST')) }} {# IMPLEMENTED IDEAS #} -
-

{{ lang('IMPLEMENTED_IDEAS') }}

- {% if implemented_ideas %} - {{ lang('VIEW_IMPLEMENTED') }} - {% endif %} -
-
-
-
    -
  • -
    -
    {{ lang('IDEAS') }}
    -
    {{ lang('VOTES') }}
    -
    -
  • -
- {% include '@phpbb_ideas/index_list.html' with {ideas: implemented_ideas} %} -
-
+{{ _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-code-fork fa-flip-vertical', lang('VIEW_IN_PROGRESS')) }}

From 3129c33ec7297fcbce1c2d3bfe687b9d0d77d33e Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Sep 2025 10:03:37 -0700 Subject: [PATCH 2/5] Add missing language vars --- language/en/common.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/language/en/common.php b/language/en/common.php index f7fcae2..76f44d1 100644 --- a/language/en/common.php +++ b/language/en/common.php @@ -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', @@ -87,6 +88,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' => [ From d64c938405d11ed5b9a70ad5d872ed2c6365c80f Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Sep 2025 10:08:47 -0700 Subject: [PATCH 3/5] Fix tests --- tests/controller/index_controller_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/controller/index_controller_test.php b/tests/controller/index_controller_test.php index 7069261..017e1f2 100644 --- a/tests/controller/index_controller_test.php +++ b/tests/controller/index_controller_test.php @@ -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()]); From 139bb0e43d5493a858a034808eb38bb9337430f9 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Sep 2025 10:33:19 -0700 Subject: [PATCH 4/5] Fix unrelated tests (again) --- tests/template/status_icon_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/template/status_icon_test.php b/tests/template/status_icon_test.php index 7117941..31382f8 100644 --- a/tests/template/status_icon_test.php +++ b/tests/template/status_icon_test.php @@ -16,7 +16,7 @@ class status_icon_test extends \phpbb_template_template_test_case { protected $test_path = __DIR__; - protected function setup_engine(array $new_config = array()) + protected function setup_engine(array $new_config = array(), string $template_path = '') { global $phpbb_root_path, $phpEx; @@ -39,7 +39,7 @@ protected function setup_engine(array $new_config = array()) $phpEx ); - $this->template_path = $this->test_path . '/templates'; + $this->template_path = $template_path ?: $this->test_path . '/templates'; $cache_path = $phpbb_root_path . 'cache/twig'; $context = new \phpbb\template\context(); From 43e0be535bc19a61568ee17b60b7aedc158baeeb Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Sep 2025 15:33:35 -0700 Subject: [PATCH 5/5] Update icon for in progress to clock --- styles/prosilver/template/index_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/prosilver/template/index_body.html b/styles/prosilver/template/index_body.html index 0b5f0a4..05403f5 100644 --- a/styles/prosilver/template/index_body.html +++ b/styles/prosilver/template/index_body.html @@ -38,7 +38,7 @@

{{ lang('IDEAS_TITLE') }}

{{ _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-code-fork fa-flip-vertical', lang('VIEW_IN_PROGRESS')) }} +{{ _self.ideas_section(lang('IN_PROGRESS_IDEAS'), in_progress_ideas, U_VIEW_IN_PROGRESS, 'fa-clock-o', lang('VIEW_IN_PROGRESS')) }}