PKG installer - part of background image is hidden - installation

I'm trying to set a background in .pkg file.
Here's my distribution.xml template file:
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>{{ title }}</title>
<welcome file="welcome.txt" mime-type="text/plain" />
<readme file="readme.txt" mime-type="text/plain" />
<license file="license.txt" mime-type="text/plain" />
<conclusion file="conclusion.txt" mime-type="text/plain" />
<pkg-ref id="{{ identifier }}"/>
<options customize="never" require-scripts="false"/>
<background file="{{ background_filename }}" mime-type="image/{{ background_ext }}"/>
<choices-outline>
<line choice="default">
<line choice="{{ identifier }}"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="{{ identifier }}" visible="false">
<pkg-ref id="{{ identifier }}"/>
</choice>
<pkg-ref id="{{ identifier }}" version="{{ version }}" onConclusion="none">{{ identifier }}-{{ build_number }}.pkg</pkg-ref>
</installer-gui-script>
It will be rendered from a Python script, and called with productbuild:
background_path = os.path.join(
config_dir,
config['darwin']['installer']['background_path']
)
background_filename = os.path.basename(background_path)
distribution_rendered = self.source.render_template(
self.__osname,
"productbuild/distribution.jinja2",
{
"title": ' '.join(
(
brand_name,
binary_name,
version
)
),
"background_filename": background_filename,
"background_ext": os.path.splitext(background_filename)[1][1:],
"identifier": identifier,
"build_number": build_number,
"version": version
}
)
with open('distribution.xml', 'w') as f:
f.write(distribution_rendered)
os.mkdir('resources')
shutil.copy(background_path, 'resources')
runcmd(("productbuild --distribution distribution.xml "
"--resources resources "
"--package-path {0}.pkg compiled/{0}.pkg").format(filename))
The .pkg file was created successfully except that part of the background image is hidden:
How can I make this transparent, so I can see the hidden part of the backgroud image?

Related

Radzen DataGrid Multiple Selection only filtered Items

I have a Razor Component (.net 6) where I make use of the Radzen DataGrid Multiple Selection.
<RadzenDataGrid
#ref="contactsGrid" Data="#contacts" AllowColumnResize="true" EditMode="DataGridEditMode.Single"
RowUpdate="#OnUpdateRow" RowCreate="#OnCreateRow"
AllowSorting="true" AllowFiltering="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
TItem="ContactModel" AllowRowSelectOnRowClick="false" SelectionMode="DataGridSelectionMode.Multiple" #bind-Value=#selectedContacts>
<Columns>
<RadzenDataGridColumn TItem="ContactModel" Width="40px" Sortable="false" Filterable="false">
<HeaderTemplate>
<RadzenCheckBox TriState="false" TValue="bool" Value="#(contacts.Any(i => selectedContacts != null && selectedContacts.Contains(i)))" Change="#(args => selectedContacts = args ? contacts.ToList() : null)" />
</HeaderTemplate>
<Template Context="contacts">
<RadzenCheckBox TriState="false" Value="#(selectedContacts != null && selectedContacts.Contains(contacts))" TValue="bool" Change=#(args => { contactsGrid.SelectRow(contacts); }) />
</Template>
</RadzenDataGridColumn>
<!-- FirstName -->
<RadzenDataGridColumn TItem="ContactModel" Property="FirstName" Title="FirstName">
<EditTemplate Context="contact">
<RadzenTextBox #bind-Value="contact.FirstName" Style="width:100%; display: block" Name="FirstName" />
<RadzenRequiredValidator Text="FirstName is required" Component="FirstName" Popup="true" />
</EditTemplate>
</RadzenDataGridColumn>
<!-- LastName -->
<RadzenDataGridColumn TItem="ContactModel" Property="LastName" Title="LastName">
<EditTemplate Context="contact">
<RadzenTextBox #bind-Value="contact.LastName" Style="width:100%; display: block" Name="LastName" />
<RadzenRequiredValidator Text="LastName is required" Component="LastName" Popup="true" />
</EditTemplate>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
In the HeaderTemplate you can directly select or deselect all items.
Is it possible to change the function so that only all items are selected that match the filter? i.e. which items are currently displayed when I search for certain items using the filter option?
you can use contactsGrid.View to get visible rows. try to use contactsGrid.View instead of selectedContacts.

Image not found on <img src={{ asset(...) }}

This is my blade Looks like :
<img src="{{ asset('/assets/img/logo.png') }}" alt="logo" width="60px" height="60px">
And here's my folder structure
When i try to view the blade, its fine. But when i try to Export as PDF with Laravel-Excel, the error coming up
http://localhost:8000/assets/img/logo.png not found!
I already change asset() to url() and without laravel function but the error still coming, any suggestions?
Try this
{{ asset('assets/img/logo.png') }}
without the initial "/"
https://laravel.com/docs/8.x/helpers#method-asset
Have you try this
<img src="/assets/img/logo.png" alt="logo" width="60px" height="60px" />
OR
<img src="{{URL::asset('/assets/img/logo.png')}}" alt="logo" width="60px" height="60px" />
Please try these!
Solved
<img src="{{ public_path('assets/img/logo.png') }}" ... />

Laravel : Image is Broken

i want to add two logo in the welcome page.i have stored the images in the folder named image under the public folder.In the build in homepage of Laravel i want to show these two images. i tried these
<image img src="C:\xampp\htdocs\officeapp\public\image\MB.png" alt="Logo"> </image>
<img src="{{URL::asset('/image/MB.png')}}" alt="logo" height="200" width="200">
but image is not showing only 'Logo' word is showing...what should i do?
Try this:
public_path() (Get the fully qualified path to the public directory.)
<img src="{{ public_path('/image/MB.png') }}" alt="logo" height="200" width="200">
try this one
<img href="{{ asset('/image/nashicon.ico') }}" />

Nested If Else Kendo UI

I am writting Nested If else as follows:
What wrong with the code:
#if(item.ATTACHMENTS == 'Aftermarket'){#
#if(item.IS_ATT_AM_UPDATED == 'Y'){#
<img id="AftermarketBlueCircle" src="#Url.Content("~/Content/Images/BlueCircle.png")" />
#}
else{#
<img id="AftermarketHalfCircle" src="#Url.Content("~/Content/Images/HalfBlueCircle.jpg")" /> +
#}#
else{#
#if(item.IS_ATT_TS_UPDATED == 'Y'){#
<img id="AftermarketBlueCircle" src="#Url.Content("~/Content/Images/BlueCircle.png")" />
#}
else{#
<img id="AftermarketHalfCircle" src="#Url.Content("~/Content/Images/HalfBlueCircle.jpg")" /> +
#}#
#}#
Please suggest
Thanks in Advance !!!
#if(item.ATTACHMENTS == 'Aftermarket'){#
#if(item.IS_ATT_AM_UPDATED == 'Y'){#
<img id="AftermarketBlueCircle" src="#Url.Content("~/Content/Images/BlueCircle.png")" />
#}
else{#
<img id="AftermarketHalfCircle" src="#Url.Content("~/Content/Images/HalfBlueCircle.jpg")" />
#}#
#}
else{#
#if(item.IS_ATT_TS_UPDATED == 'Y'){#
<img id="AftermarketBlueCircle" src="#Url.Content("~/Content/Images/BlueCircle.png")" />
#}
else{#
<img id="AftermarketHalfCircle" src="#Url.Content("~/Content/Images/HalfBlueCircle.jpg")" />
#}#
#}#

Odoo 8 src variable for iframe in ir.ui.view

Model
class ItemStocks(models.Model):
_name = 'item.stocks'
item_url = fields.Char('View Item')
ItemStocks()
View
<record id="view_item_stocks_form" model="ir.ui.view">
<field name="name">item.stocks.form</field>
<field name="model">item.stocks</field>
<field name="arch" type="xml">
<form string="Item Stocks">
...
<page string="Live Site">
<form string="Embedded Webpage" version="7.0" edit="false">
<iframe marginheight="0" marginwidth="0" frameborder="0"
src="{Variable for this.item_url}" width="100%" height="1000"/>
</form>
</page>
...
</form>
</field>
</record>
How can I replace {Variable for this.item_url} with a valid expression for the field in model? Is there a better way to do like this? What would you prefer to solve the requirement of showing dynamically an embedded webpage?
Context: Odoo 8, New Api, ir.ui.view
**`Image Url wise Set Dynamic Iframe In Odoo`**
# v11 odoo community
you need to create fields like this :
image_url = fields.Char('Image Url')
img_attach = fields.Html('Image Html')
# set image_url in iframe
#api.onchange('image_url')
def onchange_image_url(self):
if self.image_url:
self.img_attach = '<img id="img" src="%s"/>' % self.image_url
# set image_url in form view
<field name="image_url" />
# after added script
<script>
if(document.getElementById("img")){
var value= document.getElementById("img").src;
document.getElementById("custom_src").src=value;
}
</script>
# also set iframe in form view
<iframe id="custom_src" src="" width="200" height="200" />
#output
show the image : https://i.stack.imgur.com/0x7et.png

Resources