]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
fireinfo: Add banner for Fountain Networks IPFire Prime Box
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 1 Mar 2015 20:15:19 +0000 (21:15 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 1 Mar 2015 20:15:19 +0000 (21:15 +0100)
templates/fireinfo/profile-detail.html
webapp/backend/fireinfo.py

index 9c210203006c324e61572ae4263d53d7fdf8723f..c5ec9067432dadf477aaf1f8b8889acf5d74172a 100644 (file)
 
        {% if profile.appliance_id %}
                <div class="alert alert-success">
-                       {% if profile.appliance_id.startswith("lightningwirelabs-") %}
+                       {% if profile.appliance_id.startswith("fountainnetworks-") %}
+                               <span class="pull-right">
+                                       {{ _("Get yours at") }}
+                                       <a href="http://www.fountainnetworks.com/" class="alert-link">
+                                               fountainnetworks.com
+                                       </a>
+                               </span>
+                       {% elif profile.appliance_id.startswith("lightningwirelabs-") %}
                                <span class="pull-right">
                                        {{ _("Get yours at") }}
                                        <a href="http://www.lightningwirelabs.com/products/ipfire/appliances" class="alert-link">
index b11f65985d77af287087ee281def713792e14be3..1bf6747693ac9d2d4293cec6916b4f142e6310fb 100644 (file)
@@ -557,11 +557,11 @@ class Profile(Object):
 
        devices = property(get_devices, set_devices)
 
-       def count_device(self, vendor, model):
+       def count_device(self, subsystem, vendor, model):
                counter = 0
 
                for dev in self.devices:
-                       if dev.vendor == vendor and dev.model == model:
+                       if dev.subsystem == subsystem and dev.vendor == vendor and dev.model == model:
                                counter += 1
 
                return counter
@@ -628,6 +628,7 @@ class Profile(Object):
        def appliance_id(self):
                if not hasattr(self, "_appliance_id"):
                        appliances = (
+                               ("fountainnetworks-prime", self._appliance_test_fountainnetworks_prime),
                                ("lightningwirelabs-eco", self._appliance_test_lightningwirelabs_eco),
                        )
 
@@ -643,15 +644,28 @@ class Profile(Object):
 
        @property
        def appliance(self):
-               if self.appliance_id == "lightningwirelabs-eco":
-                       return "Lightning Wire Labs IPFire Eco Appliance"
+               if self.appliance_id == "fountainnetworks-prime":
+                       return "Fountain Networks - IPFire Prime Box"
+
+               elif self.appliance_id == "lightningwirelabs-eco":
+                       return "Lightning Wire Labs - IPFire Eco Appliance"
+
+       def _appliance_test_fountainnetworks_prime(self):
+               if not self.system == ("SECO", "0949"):
+                       return False
+
+               # Must have a wireless device
+               if self.count_device("usb", "148f", "5572") < 1:
+                       return False
+
+               return True
 
        def _appliance_test_lightningwirelabs_eco(self):
                if not self.system == ("MSI", "MS-9877"):
                        return False
 
                # Must have four Intel network adapters
-               network_adapters_count = self.count_device("8086", "10d3")
+               network_adapters_count = self.count_device("pci", "8086", "10d3")
                if not network_adapters_count == 4:
                        return False