Skip to content

Commit

Permalink
show all fields in repository form. #294
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 7, 2020
1 parent 9c0d8f1 commit f6f6d85
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
21 changes: 9 additions & 12 deletions app/templates/providers/show/repositories/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@
{{#each model.repository.language as |language index|}}
<RepositoryLanguage @model={{model.repository}} @language={{language}} @form={{form}} @index={{index}} />
{{/each}}

{{#if (lte model.repository.language.length 2)}}
<BsButton @class="btn-sm add-language" @outline={{true}} @onClick={{action "addLanguage"}}>{{fa-icon "plus-circle"}} Add another Language</BsButton>
{{/if}}
{{/if}}
{{#if (lte model.repository.language.length 2)}}
<BsButton @class="btn-sm add-language" @outline={{true}} @onClick={{action "addLanguage"}}>{{fa-icon "plus-circle"}} Add Language</BsButton>
{{/if}}
</div>
</div>
Expand All @@ -86,10 +85,9 @@
{{#each model.repository.repositoryType as |repositoryType index|}}
<RepositoryRepositoryType @model={{model.repository}} @repositoryType={{repositoryType}} @form={{form}} @index={{index}} />
{{/each}}

{{#if (lte model.repository.repositoryType.length 2)}}
<BsButton @class="btn-sm add-repositoryType" @outline={{true}} @onClick={{action "addRepositoryType"}}>{{fa-icon "plus-circle"}} Add another Repository Type</BsButton>
{{/if}}
{{/if}}
{{#if (lte model.repository.repositoryType.length 2)}}
<BsButton @class="btn-sm add-repositoryType" @outline={{true}} @onClick={{action "addRepositoryType"}}>{{fa-icon "plus-circle"}} Add Repository Type</BsButton>
{{/if}}
</div>
</div>
Expand All @@ -101,10 +99,9 @@
{{#each model.repository.certificate as |certificate index|}}
<RepositoryCertificate @model={{model.repository}} @certificate={{certificate}} @form={{form}} @index={{index}} />
{{/each}}

{{#if (lte model.repository.certificate.length 2)}}
<BsButton @class="btn-sm add-certificate" @outline={{true}} @onClick={{action "addCertificate"}}>{{fa-icon "plus-circle"}} Add another Certificate</BsButton>
{{/if}}
{{/if}}
{{#if (lte model.repository.certificate.length 2)}}
<BsButton @class="btn-sm add-certificate" @outline={{true}} @onClick={{action "addCertificate"}}>{{fa-icon "plus-circle"}} Add Certificate</BsButton>
{{/if}}
</div>
</div>
Expand Down
23 changes: 10 additions & 13 deletions app/templates/repositories/show/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@
{{#each model.language as |language index|}}
<RepositoryLanguage @model={{model}} @language={{language}} @form={{form}} @index={{index}} />
{{/each}}

{{#if (lte model.language.length 2)}}
<BsButton @class="btn-sm add-language" @outline={{true}} @onClick={{action "addLanguage"}}>{{fa-icon "plus-circle"}} Add another Language</BsButton>
{{/if}}
{{/if}}
{{#if (lte model.language.length 2)}}
<BsButton @class="btn-sm add-language" @outline={{true}} @onClick={{action "addLanguage"}}>{{fa-icon "plus-circle"}} Add Language</BsButton>
{{/if}}
</div>
</div>
Expand All @@ -79,17 +78,16 @@
<form.element @controlType="textarea" @id="domains" @label="Domains" @property="domains" @required={{false}} @helpText="List of (sub-)domains used for DOI registration, or use * to allow all domains" />

{{#if (eq model.clientType "repository")}}
<div class="form-group">
<div class="form-group" id="repository-type">
<label class="control-label col-md-3">Repository Type (optional)</label>
<div class="col-md-9">
{{#if (gt model.repositoryType.length 0)}}
{{#each model.repositoryType as |repositoryType index|}}
<RepositoryRepositoryType @model={{model}} @repositoryType={{repositoryType}} @form={{form}} @index={{index}} />
{{/each}}

{{#if (lte model.repositoryType.length 2)}}
<BsButton @class="btn-sm add-repositoryType" @outline={{true}} @onClick={{action "addRepositoryType"}}>{{fa-icon "plus-circle"}} Add another Repository Type</BsButton>
{{/if}}
{{/if}}
{{#if (lte model.repositoryType.length 2)}}
<BsButton @class="btn-sm add-repositoryType" @outline={{true}} @onClick={{action "addRepositoryType"}}>{{fa-icon "plus-circle"}} Add Repository Type</BsButton>
{{/if}}
</div>
</div>
Expand All @@ -101,10 +99,9 @@
{{#each model.certificate as |certificate index|}}
<RepositoryCertificate @model={{model}} @certificate={{certificate}} @form={{form}} @index={{index}} />
{{/each}}

{{#if (lte model.certificate.length 2)}}
<BsButton @class="btn-sm add-certificate" @outline={{true}} @onClick={{action "addCertificate"}}>{{fa-icon "plus-circle"}} Add another Certificate</BsButton>
{{/if}}
{{/if}}
{{#if (lte model.certificate.length 2)}}
<BsButton @class="btn-sm add-certificate" @outline={{true}} @onClick={{action "addCertificate"}}>{{fa-icon "plus-circle"}} Add Certificate</BsButton>
{{/if}}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bracco",
"version": "3.3.14",
"version": "3.3.18",
"private": true,
"description": "Fabrica",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion tests/acceptance/staff_admin/repository-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module('Acceptance | staff_admin | repository', function(hooks) {
});

test('editing repository AWI form', async function(assert) {
assert.expect(21);
assert.expect(23);

await visit('/repositories/tib.awi/edit');

Expand All @@ -143,6 +143,8 @@ module('Acceptance | staff_admin | repository', function(hooks) {
assert.dom('input#url-field').exists();
assert.dom('div#language').exists();
assert.dom('div#software').exists();
assert.dom('div#repository-type').exists();
assert.dom('div#certificate').exists();
assert.dom('textarea#domains-field').exists();
assert.dom('input#is-active-field').exists();

Expand Down

0 comments on commit f6f6d85

Please sign in to comment.