2 Achegas 3e63a5965d ... edcb06eb1d

Autor SHA1 Mensaxe Data
  sirjeff edcb06eb1d Release 1.0.5 hai 1 semana
  sirjeff 9780cf31a1 fix for issue 2 and a few style tweaks hai 1 semana
Modificáronse 6 ficheiros con 38 adicións e 27 borrados
  1. 5 1
      Controller/ProjectBrandingController.php
  2. 1 1
      Plugin.php
  3. 4 1
      Template/header.php
  4. 23 23
      Template/project_branding/show.php
  5. 4 0
      release.md
  6. 1 1
      ver

+ 5 - 1
Controller/ProjectBrandingController.php

@@ -34,12 +34,16 @@ class ProjectBrandingController extends BaseController {
       return $this->response->redirect($this->helper->url->to("ProjectBrandingController", "show", ["project_id" => $project["id"], "plugin" => "OMIProjectBranding"]), true);
     }
     
-    $branding = $this->projectBrandingModel->getBrandingByProjectId($project["id"]);
+    #$branding = $this->projectBrandingModel->getBrandingByProjectId($project["id"]);
+    $branding = $this->projectBrandingModel->getBrandingByProjectId($project["id"]) ?? [];
+        
+    $colors = $this->colorModel->getList();
     
     $this->response->html($this->helper->layout->project("OMIProjectBranding:project_branding/show", [
       "project" => $project,
       "branding" => $branding,
       "title" => t("Project Branding"),
+      "colors" => $colors,
     ]));
   }
 }

+ 1 - 1
Plugin.php

@@ -49,7 +49,7 @@ class Plugin extends Base {
   }
   
   public function getPluginVersion() {
-    return "1.0.4";
+    return "1.0.5";
   }
   
   public function getPluginHomepage() {

+ 4 - 1
Template/header.php

@@ -30,7 +30,7 @@ if (isset($project) && isset($project["id"])) {
   }
   .project-header{
     background-color:<?= !empty($branding["second_background_color"]) ? $branding["second_background_color"] : "transparent" ?>;
-    padding:.5em;
+    padding:.5em .5em .8em .5em;
     height: 1.5em;
   }
   h1 {
@@ -42,6 +42,9 @@ if (isset($project) && isset($project["id"])) {
     margin-right:5px;
     opacity:1;
   }
+  a .fa {
+    color:<?= !empty($branding["foreground_color"]) ? $branding["foreground_color"] : "initial" ?>;
+  }
 </style>
 <?php endif ?>
 

+ 23 - 23
Template/project_branding/show.php

@@ -1,31 +1,31 @@
 <div class="page-header">
-  <h2><?= t("Project Branding Settings") ?></h2>
+    <h2><?= t("Project Branding Settings") ?></h2>
 </div>
 
 <form method="post" action="<?= $this->url->to('ProjectBrandingController', 'show', ['project_id' => $project['id'], 'plugin' => 'OMIProjectBranding']) ?>" autocomplete="off">
-  <?= $this->form->csrf() ?>
-  
-  <p>
-    <?= t("Configure the header logo and colours for this project.") ?>
-  </p>
-  
-  <?= $this->form->label(t("Enable custom branding"), "enabled") ?>
-  <?= $this->form->checkbox("enabled", "", 1, $branding["enabled"] ?? 0) ?>
-  
-  <?= $this->form->label(t("Logo URL"), "logo_url") ?>
-  <?= $this->form->text("logo_url", $branding, [], ['placeholder="https://example.com/logo.png"']) ?>
-  
-  <?= $this->form->label(t("Foreground Color"), "foreground_color") ?>
-  <?= $this->form->colorSelect("foreground_color", $branding) ?>
+    <?= $this->form->csrf() ?>
+    
+    <p>
+        <?= t("Configure the header logo and colours for this project.") ?>
+    </p>
+    
+    <?= $this->form->label(t("Enable custom branding"), "enabled") ?>
+    <?= $this->form->checkbox("enabled", "", 1, $branding["enabled"] ?? 0) ?>
+    
+    <?= $this->form->label(t("Logo URL"), "logo_url") ?>
+    <?= $this->form->text("logo_url", $branding, [], ['placeholder="https://example.com/logo.png"']) ?>
+    
+    <?= $this->form->label(t("Foreground Color"), "foreground_color") ?>
+    <?= $this->form->colorSelect("foreground_color", $branding, $colors) ?>
 
     
-  <?= $this->form->label(t("Background Color"), "background_color") ?>
-  <?= $this->form->colorSelect("background_color", $branding) ?>
+    <?= $this->form->label(t("Background Color"), "background_color") ?>
+    <?= $this->form->colorSelect("background_color", $branding, $colors) ?>
 
-  <?= $this->form->label(t("Secondary Background Color"), "second_background_color") ?>
-  <?= $this->form->colorSelect("second_background_color", $branding) ?>
-  
-  <div class="form-actions">
-    <button type="submit" class="btn btn-blue"><?= t("Save") ?></button>
-  </div>
+    <?= $this->form->label(t("Secondary Background Color"), "second_background_color") ?>
+    <?= $this->form->colorSelect("second_background_color", $branding, $colors) ?>
+    
+    <div class="form-actions">
+        <button type="submit" class="btn btn-blue"><?= t("Save") ?></button>
+    </div>
 </form>

+ 4 - 0
release.md

@@ -1,5 +1,9 @@
 # Release Notes  
 
+## v1.0.5 2025-08-30 *[fixsomebugs]*  
+- style tweaks (padding-bottom in header and icons use foreground colour)  
+- fixed bug #2 , added required parameter , `$colors` to controller  
+  
 ## v1.0.4 2025-08-14 *[more_styles]*  
 Why the version jump? This was so I could test the database `drop table` which only kicks in via a version _after_ the initial one.  
 I think it took 2 tries to get it going :/  

+ 1 - 1
ver

@@ -1 +1 @@
-1.0.4
+1.0.5