Edit.html 5.82 KB
Newer Older
1
<f:layout name="Default" />
2 3

<f:section name="main">
4 5 6 7 8 9
    <f:if condition="{isLoggedIn}">
        <f:then>
            <h1 class="mt-3">
                <f:translate key="edit_extension" />
                {extension.extKey}
            </h1>
10

11
            <f:form class="form-horizontal" method="post" action="update" controller="Extension" name="extension" object="{extension}">
12

13
                <f:render partial="FormErrors" />
14

15 16 17 18 19 20
                <f:if condition="{extension.lastVersion.composerName}">
                    <div class="form-group row">
                        <label for="packagistConfirm" class="col-3 col-form-label">
                            <f:translate key="tx_terfe2_domain_model_extension.packagist_confirm" />
                        </label>
                        <div class="col-9">
21
                            <f:form.checkbox id="packagistConfirm" name="packagistConfirm" value="1" checked="{f:if(condition: '{extension.composerName}', then: '1', else: '0')}" />
22 23 24
                            <label for="packagistConfirm">
                                <f:translate key="tx_terfe2_domain_model_extension.packagist_confirm_message" />
                            </label>
25 26 27 28 29 30 31
                        </div>
                    </div>
                    <div class="form-group row js-composer-name-input">
                        <label for="composerName" class="col-3 col-form-label">
                            <f:translate key="tx_terfe2_domain_model_extension.composer_name" />
                        </label>
                        <div class="col-9">
32
                            <f:form.textfield class="form-control" data="{composer: '{extension.lastVersion.composerName -> f:or(alternative: extension.composerName)}'}" id="composerName" property="composerName" value="" />
33 34 35
                        </div>
                    </div>
                </f:if>
36 37 38 39 40
                <div class="form-group row">
                    <label for="forgeLink" class="col-3 col-form-label">
                        <f:translate key="tx_terfe2_domain_model_extension.forge_link" />
                    </label>
                    <div class="col-9">
41
                        <f:form.textfield class="form-control" id="forgeLink" property="forgeLink" additionalAttributes="{placeholder:'https://external.repository.org/your-project/issues'}" />
42 43 44 45 46 47 48
                    </div>
                </div>
                <div class="form-group row">
                    <label for="repositoryUrl" class="col-3 col-form-label">
                        <f:translate key="tx_terfe2_domain_model_extension.repository_url" />
                    </label>
                    <div class="col-9">
49
                        <f:form.textfield class="form-control" id="repositoryUrl" property="repositoryUrl" additionalAttributes="{placeholder:'https://external.repository.org/your-project'}" />
50 51
                    </div>
                </div>
52

53 54 55 56 57
                <div class="form-group row">
                    <label for="externalManual" class="col-3 col-form-label">
                        <f:translate key="tx_terfe2_domain_model_extension.external_manual" />
                    </label>
                    <div class="col-9">
58
                        <f:form.textfield class="form-control" id="externalManual" property="externalManual" additionalAttributes="{placeholder:'https://external.domain.org/external-manual'}" />
59 60
                    </div>
                </div>
61

62 63 64 65 66 67 68 69
                <div class="form-group row">
                    <label for="paypalUrl" class="col-3 col-form-label">
                        <f:translate key="tx_terfe2_domain_model_extension.donate_url" />
                    </label>
                    <div class="col-9">
                        <f:form.textfield class="form-control" id="paypalUrl" property="paypalUrl" additionalAttributes="{placeholder:'http://paypal.com/your-url'}" />
                    </div>
                </div>
70

71 72 73 74 75 76
                <div class="form-group row">
                    <label class="col-3 col-form-label" for="tags">Tags</label>
                    <div class="col-9">
                        <f:form.textfield class="form-control" id="tags" name="tag" additionalAttributes="{placeholder:'Add tags for this extension (divided by spaces)'}" />
                    </div>
                </div>
77

78 79 80 81 82 83 84 85 86 87 88 89 90 91
                <div class="row">
                    <div class="offset-3 col-sm-9">
                        <f:if condition="{extension.tags}">
                            <f:for each="{extension.tags}" as="tag">
                                <div class="btn-group">
                                    <button class="btn btn-info">#{tag.title}</button>
                                    <f:link.action action="removeTag" controller="Extension" arguments="{extension : extension, tag : tag}" class="btn btn-outline-danger mr-2">
                                        <i class="fa fa-trash-o"></i>
                                    </f:link.action>
                                </div>
                            </f:for>
                        </f:if>
                    </div>
                </div>
92

93 94 95
                <div class="form-group row mt-5">
                    <div class="offset-3 col-9">
                        <f:form.submit class="btn btn-primary mr-3" name="save" value="Save" />
96

97 98 99
                        <f:form.submit class="btn btn-default" name="close" value="Save and close" />
                    </div>
                </div>
100

101
            </f:form>
102

103 104 105 106 107 108 109 110 111 112
            <div class="mt-5 text-right">
                <f:link.action controller="Registerkey" action="index" class="btn btn-primary">Back to extension management</f:link.action>
            </div>
        </f:then>
        <f:else>
            <div class="alert alert-warning">
                You must be the owner of the extension to edit it.
            </div>
        </f:else>
    </f:if>
113
</f:section>