Actions

Template

ResourcePage: Difference between revisions

From Dune Awakening DB

mNo edit summary
mNo edit summary
Line 2: Line 2:
<div class="dune-breadcrumb-nav">
<div class="dune-breadcrumb-nav">
<templatestyles src="Template:ResourcePage/styles.css" />
<templatestyles src="Template:ResourcePage/styles.css" />
<!-- ───── 1. MAIN ITEM LOOKUP ───── -->
{{#get_external_data:
{{#get_external_data:
   source=externaldb
   source = externaldb
   |from=data_items
   |from = data_items
   |data=ItemID=item_id,InternalName=internal_name,ResourceClass=resource_class,
   |data = ItemID=item_id,InternalName=internal_name,ResourceClass=resource_class,ResourceSubclass=resource_subclass,Tier=tier,Rarity=rarity,Faction=faction,Name=name,Description=description,HowToObtain=how_to_obtain,Notes=notes,AdditionalNotes=additional_notes,Weight=weight,MaxStacks=max_stacks,XPPerHarvest=xp_per_harvest,BaseVendorPrice=base_vendor_price,LocationsToHarvest=locations_to_harvest,GuideLink=guide_link,IconLink=icon_link,ImageLink=image_link,Category1=category_1,Category2=category_2,Category3=category_3
        ResourceSubclass=resource_subclass,Tier=tier,Rarity=rarity,Faction=faction,
   |where = name={{PAGENAME}}
        Name=name,Description=description,HowToObtain=how_to_obtain,Notes=notes,
   |limit = 1
        AdditionalNotes=additional_notes,Weight=weight,MaxStacks=max_stacks,
   |cache = yes
        XPPerHarvest=xp_per_harvest,BaseVendorPrice=base_vendor_price,
        LocationsToHarvest=locations_to_harvest,GuideLink=guide_link,
        IconLink=icon_link,ImageLink=image_link,Category1=category_1,
        Category2=category_2,Category3=category_3
   |where=name={{PAGENAME}}
   |limit=1
   |cache=yes
}}
}}
{{#for_external_table:|
{{#for_external_table:|
Line 32: Line 23:
   {{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category3|{{{Category3}}}}}
   {{#vardefine:Category2|{{{Category2}}}}}{{#vardefine:Category3|{{{Category3}}}}}
}}
}}
 
<!-- Breadcrumb navigation -->
<!-- Breadcrumb -->
<span id="menuRadialTrigger" class="menu-button-wrapper" style="cursor:pointer;">
<span id="menuRadialTrigger" class="menu-button-wrapper" style="cursor:pointer;">
   [[File:MenuButton.png|100px|link=|alt=Menu]]
   [[File:MenuButton.png|100px|link=|alt=Menu]]
Line 40: Line 30:
<span class="dune-breadcrumb-separator">/</span>[[{{#var:Category2}}|{{#var:Category2}}]]
<span class="dune-breadcrumb-separator">/</span>[[{{#var:Category2}}|{{#var:Category2}}]]
<span class="dune-breadcrumb-separator">/</span>[[{{#var:Category3}}|{{#var:Category3}}]]
<span class="dune-breadcrumb-separator">/</span>[[{{#var:Category3}}|{{#var:Category3}}]]
<span class="dune-breadcrumb-separator">/</span><span>{{PAGENAME}}</span></div>
<span class="dune-breadcrumb-separator">/</span><span>{{PAGENAME}}</span>
 
</div>


<div class="responsive-container">
<div class="responsive-container">


<!-- ───── 2. LEFT COLUMN (unchanged) ───── -->
  <!-- Left Column: Resource Information -->
<!-- everything here stays exactly as you already have it -->
  <div class="responsive-col col1">
 
    <div class="skin-pivot">
 
      <div class="dune-card">
<!-- ───── 3. “CRAFTED WITH” PREVIEW ───── -->
         <div class="dune-card-decoration"></div>
{{#get_external_data:
        <div class="dune-card-inner">
  source = externaldb
          <div class="dune-card-label">{{#var:ResourceClass}} - {{#var:ResourceSubclass}}</div>
  |from  = data_recipe_ingredients
          <div class="dune-card-title"><span class="icon"></span> Resource Information</div>
          JOIN data_recipes         ON data_recipe_ingredients.recipe_id = data_recipes.id
          <div style="padding:3px;"></div>
          JOIN data_recipe_stations ON data_recipes.id                    = data_recipe_stations.recipe_id
         
  |data  = OutputItem = primary_output_label,
          <!-- Image Section -->
          Resources  = GROUP_CONCAT(\DISTINCT CONCAT(
          <div class="dune-card-image" style="text-align: center;">
                          ingredient_label\, CHAR(32)\, CHAR(120)\, amount
            <div class="has-border">{{#if:{{#var:ImageLink}}
                        ) SEPARATOR CHAR(59)),
                | [[File:{{#var:ImageLink}}|200px|alt={{#var:Name}}]]
          Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59))
                | [[File:Placeholder.png|200px|alt=No image available]]}}
  |where = ingredient_label = {{PAGENAME}}
            </div>
  |group by = primary_output_label
          </div>
  |order by = primary_output_label
          <div style="padding:3px;"></div>
  |limit = 5          <!-- preview size -->
         
  |cache = yes
          <!-- Description -->
}}
          <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:Description}}}}</div>
 
         
 
          <!-- How to Obtain -->
<div class="dune-table-wrapper">
          {{#if:{{#var:HowToObtain}}|
<table class="infobox-dune-standard-table recipe-table" id="craftedWithTable">
          <div class="dune-card-locked">
  <thead><tr class="tr-dark">
            <div class="dune-card-locked-label"><span class="dune-card-locked-icon">📍</span>How to Obtain</div>
    <th style="width:35%;">Item Created</th>
            <div class="dune-card-locked-value">{{#var:HowToObtain}}</div>
    <th style="width:40%;">Resources Needed</th>
          </div>
    <th style="width:25%;">Stations</th>
          |}}
  </tr></thead>
          <!-- Resource Stats Table -->
  <tbody>
          <div class="dune-table-wrapper">
    {{#for_external_table:|
            <table class="infobox-dune-two-column">
      <tr class="recipe-row">
              <tr><th><span class="icon">{{#if:{{#var:IconLink}}|[[File:{{#var:IconLink}}|16px]]|}}</span> Tier</th><td>{{#var:Tier}}</td></tr>
        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
              <tr><th><span class="icon">✦</span> Rarity</th><td>{{#var:Rarity}}</td></tr>
        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
              <tr><th><span class="icon">🏛</span> Faction</th><td>{{#var:Faction}}</td></tr>
        <td>{{{Stations}}}</td>
              <tr><th><span class="icon">⚖</span> Weight</th><td>{{#var:Weight}} kg</td></tr>
      </tr>
              <tr><th><span class="icon">📦</span> Max Stacks</th><td>{{#var:MaxStacks}}</td></tr>
    }}
              <tr><th><span class="icon">💰</span> Base Vendor Price</th><td>{{#var:BaseVendorPrice}} Solaris</td></tr>
  </tbody>
              <tr><th><span class="icon">⭐</span> XP per Harvest</th><td>{{#var:XPPerHarvest}}</td></tr>
</table>
            </table>
</div>
          </div>
 
        </div>
 
      </div>
<!-- ───── 4. “CRAFTED FROM” PREVIEW ───── -->
    </div>
{{#get_external_data:
  </div>
  source = externaldb
  |from  = data_recipe_outcomes
          JOIN data_recipes            ON data_recipe_outcomes.recipe_id  = data_recipes.id
          JOIN data_recipe_ingredients ON data_recipes.id                = data_recipe_ingredients.recipe_id
          JOIN data_recipe_stations    ON data_recipes.id                = data_recipe_stations.recipe_id
  |data  = OutputItem = output_label,
          Resources  = GROUP_CONCAT(\DISTINCT CONCAT(
                          ingredient_label\, CHAR(32)\, CHAR(120)\, amount
                        ) SEPARATOR CHAR(59)),
          Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59))
  |where = output_label = {{PAGENAME}}
  |group by = output_label
  |order by = output_label
  |limit = 5
  |cache = yes
}}
 
 
<div class="dune-table-wrapper">
<table class="infobox-dune-standard-table recipe-table" id="craftedFromTable">
  <thead><tr class="tr-dark">
    <th style="width:35%;">Item Created</th>
    <th style="width:40%;">Resources Needed</th>
    <th style="width:25%;">Stations</th>
  </tr></thead>
  <tbody>
    {{#for_external_table:|
      <tr class="recipe-row">
        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
        <td>{{{Stations}}}</td>
      </tr>
    }}
  </tbody>
</table>
</div>
 
 
<!-- ───── 5. RIGHT COLUMN, POP-UP, ETC. (unchanged) ───── -->
<!-- keep everything from here to the end exactly as in your current page -->
 
</div> <!-- .responsive-container -->
</includeonly>


  <!-- Middle Column: Crafting Recipes -->
  <div class="responsive-col col2">
    <div class="skin-pivot">
      <div class="dune-card">
        <div class="dune-card-decoration"></div>
        <div class="dune-card-inner">
          <div class="dune-card-label">CRAFTING</div>
          <div class="dune-card-title"><span class="icon">⚒</span> Crafting Recipes</div>
          <div style="padding:3px;"></div>
         
          <!-- Crafted With Section -->
          <div class="crafting-section">
            <h3 class="dune-section-header">Crafted With This Resource</h3>
            <div class="dune-card-description">Items that require {{#var:Name}} as an ingredient</div>
            <div class="recipe-search-container">
              <input type="text" id="craftedWithSearch" class="recipe-search-input" placeholder="Search recipes...">
            </div>
            <div id="craftedWithPreview" class="recipe-table-preview">
              {{#get_external_data:
                source = externaldb
                |from  = data_recipe_ingredients
                        JOIN data_recipes        ON data_recipe_ingredients.recipe_id = data_recipes.id
                        JOIN data_recipe_stations ON data_recipes.id = data_recipe_stations.recipe_id
                |data  = OutputItem = primary_output_label,
                        Resources  = GROUP_CONCAT(\DISTINCT CONCAT(
                                        ingredient_label\, CHAR(32)\, CHAR(120)\, amount
                                      ) SEPARATOR CHAR(59)),
                        Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59))
                |where = ingredient_label = {{PAGENAME}}
                |group by = primary_output_label
                |order by = primary_output_label
                |limit = 5
                |cache = yes
              }}
              <div class="dune-table-wrapper">
                <table class="infobox-dune-standard-table recipe-table" id="craftedWithTable">
                  <thead>
                    <tr class="tr-dark">
                      <th style="width:35%;">Item Created</th>
                      <th style="width:40%;">Resources Needed</th>
                      <th style="width:25%;">Stations</th>
                    </tr>
                  </thead>
                  <tbody>
                    {{#for_external_table:|
                      <tr class="recipe-row">
                        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
                        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
                        <td>{{{Stations}}}</td>
                      </tr>
                    }}
                  </tbody>
                </table>
              </div>
            </div>
            <div class="recipe-actions">
              <button class="dune-action-button view-all-crafted-with" data-resource="{{PAGENAME}}">
                <span class="icon">📋</span> View All Recipes
              </button>
            </div>
          </div>
         
          <div style="clear:both; padding:10px;"></div>
         
          <!-- Crafted From Section -->
          <div class="crafting-section">
            <h3 class="dune-section-header">Crafted From</h3>
            <div class="dune-card-description">Recipes that produce {{#var:Name}}</div>
            <div class="recipe-search-container">
              <input type="text" id="craftedFromSearch" class="recipe-search-input" placeholder="Search recipes...">
            </div>
            <div id="craftedFromPreview" class="recipe-table-preview">
              {{#get_external_data:
                source = externaldb
                |from  = data_recipe_outcomes
                        JOIN data_recipes            ON data_recipe_outcomes.recipe_id = data_recipes.id
                        JOIN data_recipe_ingredients ON data_recipes.id = data_recipe_ingredients.recipe_id
                        JOIN data_recipe_stations    ON data_recipes.id = data_recipe_stations.recipe_id
                |data  = OutputItem = output_label,
                        Resources  = GROUP_CONCAT(\DISTINCT CONCAT(
                                        ingredient_label\, CHAR(32)\, CHAR(120)\, amount
                                      ) SEPARATOR CHAR(59)),
                        Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59))
                |where = output_label = {{PAGENAME}}
                |group by = output_label
                |order by = output_label
                |limit = 5
                |cache = yes
              }}
              <div class="dune-table-wrapper">
                <table class="infobox-dune-standard-table recipe-table" id="craftedFromTable">
                  <thead>
                    <tr class="tr-dark">
                      <th style="width:35%;">Item Created</th>
                      <th style="width:40%;">Resources Needed</th>
                      <th style="width:25%;">Stations</th>
                    </tr>
                  </thead>
                  <tbody>
                    {{#for_external_table:|
                      <tr class="recipe-row">
                        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
                        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
                        <td>{{{Stations}}}</td>
                      </tr>
                    }}
                  </tbody>
                </table>
              </div>
            </div>
            <div class="recipe-actions">
              <button class="dune-action-button view-all-crafted-from" data-resource="{{PAGENAME}}">
                <span class="icon">📋</span> View All Recipes
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>


   <!-- Right Column: Resource Guide -->
   <!-- Right Column: Resource Guide -->
Line 149: Line 216:
               | <youtube>r8lxVDqoHLQ</youtube>}}
               | <youtube>r8lxVDqoHLQ</youtube>}}
           </div>
           </div>
         
           <div style="clear:both; padding:10px;"></div>
           <div style="clear:both; padding:10px;"></div>
         
          <!-- Notes Section -->
           <div class="dune-card-title"><span class="icon">≡</span> Notes</div>
           <div class="dune-card-title"><span class="icon">≡</span> Notes</div>
           <div style="padding:3px;"></div>
           <div style="padding:3px;"></div>
           <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:AdditionalNotes}}}}</div>
           <div class="dune-card-description">{{#invoke:DataTableParserV2|iconize|{{#var:AdditionalNotes}}}}</div>
         
           {{#if:{{#var:LocationsToHarvest}}|
           {{#if:{{#var:LocationsToHarvest}}|
           <div style="clear:both; padding:10px;"></div>
           <div style="clear:both; padding:10px;"></div>
          <!-- Harvest Locations -->
           <div class="dune-card-title"><span class="icon">🗺</span> Harvest Locations</div>
           <div class="dune-card-title"><span class="icon">🗺</span> Harvest Locations</div>
           <div style="padding:3px;"></div>
           <div style="padding:3px;"></div>
Line 203: Line 265:
   </div>
   </div>
</script>
</script>
</includeonly>

Revision as of 16:41, 26 May 2025