<% use ui::cmn; my ($prj,$sign_cmdline,$bundle_name) = @_;  
$bundle_name =~ s,\.app,,; #strip .app extension as it's not visible in Finder
%>
<% $forge->include('wgt-load-semanticui') %>

<style type=text/css>
pre { 
    background: rgba(244,244,244,0.8); border: solid 1px rgba(244,104,104,0.3); padding: 1em; 
    font-family: 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace; 
 }

code { font-family: 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter', monospace;
     }
</style>


<div class="main ui container">
 <div class="ui segment">
    <% $forge->include('wgt-semui-header', __('Code signing macOS app') ) %>
    <form class="ui form"   id=mainform>
        <input type=hidden name=havevals value=1>
	<div class=fields>
	    <div class=field>
		<%$ __('Press the button below to code sign the macOS app.') %>
	    </div>
	</div>

	<div class=fields>
	    <div class=field>
                <button class="ui fluid primary wide button"><i class="ui icon apple"></i>
                 <%=   __('Execute')  %>  </button>
	    </div>
	</div>

    </form>
 </div>



<div class="ui accordion container">

    <div class="title"><i class="dropdown icon"></i><%= __('Why use this?' ) %></div>
    <div class="content">
<%$ __('Starting from macOS Sierra, default configuration of macOS is to prevent running unsigned apps, for apps that have been downloaded from Internet.') %>
<p>
<%$ __('Once app is signed, any modification to the app (i.e. to php scripts or web resources) will make it invalid, and require signing the app again.') %>
<p>
<%$ __('To sign the app, you have to enroll into Apple Developer Program, it costs $100/year, just enroll by visiting <a href=https://developer.apple.com/>this page</a>.') %>



    <% $forge->include('wgt-optional-start','askFriends',__('Can I ask others to sign my app?')) %>
    <%= __('Another option is to ask your partners/friends to sign your app for you to avoid paying Apply $100 each year.') %>
    <%$ sprintf(__('In this case, just send them zipped <code>%s</code> from your Prototype output directory, and ask them to unzip it and then type this in command line while being in the folder where it was unzipped to: <pre>%s</pre>and ask them to  zip <code>%s</code> again and send it back to you.'),
	    $bundle_name, $sign_cmdline, $bundle_name) %>
    <% $forge->include('wgt-optional-end','askFriends') %>

    <p>&nbsp;</p>
    <%$ __('Once your Prototype is signed, you can use any of <i>Create ..</i> menu items <a href=menu.pack>Optimize &amp; Pack Prototype</a> menu.') %>
    </div>
</div>



<div class="ui accordion container">
    <div class="title"><i class="dropdown icon"></i><%= __('Code signing from command line' ) %></div>
    <div class="content">

        <%$ sprintf(__('You can sign your app on your Mac using command line. After optimizing the directory structure of your app <a href=pack.optimize>here</a>, type this in terminal while being in Prototype Output Directory: <pre>%s</pre> and wait till it completes. '),
	     $sign_cmdline) %>
    </div>
</div>




</div>
