merge template files together

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308281 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-04-02 10:08:20 +00:00
parent 267659a5f5
commit c948c8b438
5 changed files with 318 additions and 339 deletions

View File

@ -21,13 +21,11 @@ define("archiva.templates",["text!templates/archiva/menu.html",
"text!templates/archiva/modal.html",
"text!templates/archiva/grids-generics.html",
"text!templates/archiva/repositories.html",
"text!templates/archiva/repository-groups.html",
"text!templates/archiva/search.html",
"text!templates/archiva/general-admin.html",
"text!templates/archiva/artifacts-management.html",
"jquery.tmpl","utils"],
function(menu,message,modal,grids_generics,repositories,
repository_groups,search,general_admin,artifacts_management) {
search,general_admin) {
var htmlFragment=$("#html-fragments");
// template loading
@ -36,10 +34,8 @@ define("archiva.templates",["text!templates/archiva/menu.html",
$.tmpl( modal ).appendTo(htmlFragment);
htmlFragment.append(grids_generics);
htmlFragment.append(repositories);
htmlFragment.append(repository_groups);
htmlFragment.append(search);
htmlFragment.append(general_admin);
htmlFragment.append(artifacts_management);
$.log("main-tmpl.js loaded");
}
);

View File

@ -1,167 +0,0 @@
<script id="file-upload-screen" type="text/html">
<div id="file-upload-main" data-bind='template:{name:"file-upload-tmpl"}'></div>
</script>
<script id="file-upload-tmpl" type="text/html">
<div class="page-header">
<h3>${$.i18n.prop('fileupload.header')}</h3>
</div>
<form id="fileupload" action="restServices/archivaUiServices/fileUploadService" method="POST"
enctype="multipart/form-data" class="well form-horizontal">
<fieldset id="network-proxy-edit-fieldset">
<div class="control-group">
<label class="control-label" for="repositoryId">${$.i18n.prop('fileupload.repositoryId')}</label>
<div class="controls">
<select id="repositoryId"
data-bind="options: managedRepositories, optionsText: 'name',optionsValue:'id',
value: repositoryId"></select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="groupId">${$.i18n.prop('fileupload.groupId')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: groupId" id="groupId" name="groupId" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="artifactId">${$.i18n.prop('fileupload.artifactId')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: artifactId" id="artifactId" name="artifactId" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="version">${$.i18n.prop('fileupload.version')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: version" id="version" name="version" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="packaging">${$.i18n.prop('fileupload.packaging')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: packaging" id="packaging" name="packaging" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="generatePom">${$.i18n.prop('fileupload.generatePom')}</label>
<div class="controls">
<input type="checkbox" class="xlarge" data-bind="value: generatePom" id="generatePom" name="generatePom" />
</div>
</div>
</div>
</fieldset>
<div class="row fileupload-buttonbar">
<div class="span7">
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>${$.i18n.prop('fileupload.file.choose')}</span>
<input type="file" name="files[]" multiple="">
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>${$.i18n.prop('fileupload.start')}</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
<span>${$.i18n.prop('fileupload.cancel')}</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="icon-trash icon-white"></i>
<span>${$.i18n.prop('fileupload.delete')}</span>
</button>
<input type="checkbox" class="toggle">
</div>
<div class="span5">
<div class="progress progress-success progress-striped active">
<div class="bar" style="width:0%;"></div>
</div>
</div>
</div>
<div>
<a href="#" id="fileupload-save-files">
<span class="btn btn-info" data-bind='click: saveArtifacts'>
<i class="icon-file icon-white"></i>
<span>${$.i18n.prop('fileupload.save')}</span>
</span>
</a>
</div>
<div class="fileupload-loading"></div>
<br>
<table class="table table-striped">
<tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody>
</table>
</form>
</script>
<script id="template-upload" type="text/html">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload">
<td class="name"><span>{%=file.name%}</span></td>
<td><input type="text" id="classifier" name="classifier" placeholder="classifier" value=""/></td>
<td><span>pomFile:</span><input type="checkbox" id="pomFile" name="pomFile"/></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2">
<span class="label label-important">{%=$.i18n.prop('fileupload.error')%}</span>
{%=$.i18n.prop('fileupload.errors.'+[file.error]) || file.error%}
</td>
{% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active">
<div class="bar" style="width:0%;"></div>
</div>
</td>
<td class="start">
{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=$.i18n.prop('fileupload.start')%}</span>
</button>
{% } %}
</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">
{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=$.i18n.prop('fileupload.cancel')%}</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<script id="template-download" type="text/html">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download">
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2">
<span class="label label-important">{%=$.i18n.prop('fileupload.error')%}</span>
{%=$.i18n.prop('fileupload.errors.'+[file.error]) || file.error%}
</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="delete">
<button class="btn btn-danger" data-type="{%=file.deleteType%}"
data-url="restServices/archivaUiServices/fileUploadService/{%=file.deleteUrl%}">
<i class="icon-trash icon-white"></i>
<span>{%=$.i18n.prop('fileupload.destroy')%}</span>
</button>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
{% } %}
</script>

View File

@ -513,3 +513,170 @@
</script>
<script id="file-upload-screen" type="text/html">
<div id="file-upload-main" data-bind='template:{name:"file-upload-tmpl"}'></div>
</script>
<script id="file-upload-tmpl" type="text/html">
<div class="page-header">
<h3>${$.i18n.prop('fileupload.header')}</h3>
</div>
<form id="fileupload" action="restServices/archivaUiServices/fileUploadService" method="POST"
enctype="multipart/form-data" class="well form-horizontal">
<fieldset id="network-proxy-edit-fieldset">
<div class="control-group">
<label class="control-label" for="repositoryId">${$.i18n.prop('fileupload.repositoryId')}</label>
<div class="controls">
<select id="repositoryId"
data-bind="options: managedRepositories, optionsText: 'name',optionsValue:'id',
value: repositoryId"></select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="groupId">${$.i18n.prop('fileupload.groupId')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: groupId" id="groupId" name="groupId" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="artifactId">${$.i18n.prop('fileupload.artifactId')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: artifactId" id="artifactId" name="artifactId" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="version">${$.i18n.prop('fileupload.version')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: version" id="version" name="version" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="packaging">${$.i18n.prop('fileupload.packaging')}</label>
<div class="controls">
<input type="text" class="xlarge required" data-bind="value: packaging" id="packaging" name="packaging" size="10" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="generatePom">${$.i18n.prop('fileupload.generatePom')}</label>
<div class="controls">
<input type="checkbox" class="xlarge" data-bind="value: generatePom" id="generatePom" name="generatePom" />
</div>
</div>
</div>
</fieldset>
<div class="row fileupload-buttonbar">
<div class="span7">
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>${$.i18n.prop('fileupload.file.choose')}</span>
<input type="file" name="files[]" multiple="">
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>${$.i18n.prop('fileupload.start')}</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
<span>${$.i18n.prop('fileupload.cancel')}</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="icon-trash icon-white"></i>
<span>${$.i18n.prop('fileupload.delete')}</span>
</button>
<input type="checkbox" class="toggle">
</div>
<div class="span5">
<div class="progress progress-success progress-striped active">
<div class="bar" style="width:0%;"></div>
</div>
</div>
</div>
<div>
<a href="#" id="fileupload-save-files">
<span class="btn btn-info" data-bind='click: saveArtifacts'>
<i class="icon-file icon-white"></i>
<span>${$.i18n.prop('fileupload.save')}</span>
</span>
</a>
</div>
<div class="fileupload-loading"></div>
<br>
<table class="table table-striped">
<tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody>
</table>
</form>
</script>
<script id="template-upload" type="text/html">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload">
<td class="name"><span>{%=file.name%}</span></td>
<td><input type="text" id="classifier" name="classifier" placeholder="classifier" value=""/></td>
<td><span>pomFile:</span><input type="checkbox" id="pomFile" name="pomFile"/></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2">
<span class="label label-important">{%=$.i18n.prop('fileupload.error')%}</span>
{%=$.i18n.prop('fileupload.errors.'+[file.error]) || file.error%}
</td>
{% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active">
<div class="bar" style="width:0%;"></div>
</div>
</td>
<td class="start">
{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=$.i18n.prop('fileupload.start')%}</span>
</button>
{% } %}
</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">
{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=$.i18n.prop('fileupload.cancel')%}</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<script id="template-download" type="text/html">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download">
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2">
<span class="label label-important">{%=$.i18n.prop('fileupload.error')%}</span>
{%=$.i18n.prop('fileupload.errors.'+[file.error]) || file.error%}
</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="delete">
<button class="btn btn-danger" data-type="{%=file.deleteType%}"
data-url="restServices/archivaUiServices/fileUploadService/{%=file.deleteUrl%}">
<i class="icon-trash icon-white"></i>
<span>{%=$.i18n.prop('fileupload.destroy')%}</span>
</button>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
{% } %}
</script>

View File

@ -954,4 +954,154 @@
<div>
<span class="label label-warning">${$.i18n.prop('warning.not.undone.operation')}</span>
</div>
</script>
<script id="repositoryGroupsMain" type="text/html">
<div class="page-header">
<h2><img src="images/applications-internet-2-32-32.png"/>${$.i18n.prop('repository.groups.list')}</h2>
</div>
<ul id="repository-groups-view-tabs" class="nav nav-tabs">
<li id="repository-groups-view-tabs-li-grid" class="active">
<a data-toggle="tab" href="#repository-groups-view" id="repository-groups-view-tabs-a-network-proxies-grid">
${$.i18n.prop('repository-groups.grid.tab.title')}
</a>
</li>
<li id="repository-groups-view-tabs-li-edit">
<a data-toggle="tab" href="#repository-groups-edit" id="repository-groups-view-tabs-a-edit">${$.i18n.prop('add')}</a>
</li>
</ul>
<div id="repository-groups-view-tabs-content" class="tab-content">
<div id="repository-groups-view" class="tab-pane active">
<div id="repository-groups-table" data-bind='template:{name:"repository-groups-table-tmpl"}'>
</div>
</div>
<div id="repository-groups-edit" class="tab-pane">
<div class="row-fluid">
<div class="span5 dotted">
<div id="repository-groups-edit-div" data-bind='template:{name:"repository-group-edit-tmpl"}'></div>
<div id="repository-groups-edit-order-div" style="min-height: 80px"
data-bind="sortable: { template: 'repository-group-edit-order-tmpl',data:repositoryGroup.managedRepositories,afterMove:repositoryMoved}">
</div>
</div>
<div class="span5 dotted">
<h5>${$.i18n.prop('repository.groups.available.repositories')}</h5>
<br/>
<div id="repository-groups-edit-available-repositories" style="min-height: 80px"
data-bind="sortable: { template: 'repository-group-edit-order-tmpl',data:availableRepositories,afterMove:repositoryMoved}">
</div>
</div>
</div>
</div>
</div>
</script>
<script id="repository-groups-table-tmpl" type="text/html">
<table class="table table-striped table-bordered">
<thead>
<th>${$.i18n.prop('repository.groups.groups.grid.header')}</th>
<th>${$.i18n.prop('repository.groups.repositories.grid.header')}</th>
<th>${$.i18n.prop('edit')}</th>
<th>${$.i18n.prop('delete')}</th>
<th>${$.i18n.prop('save')}</th>
</thead>
<tbody>
{{each(i, repositoryGroup) repositoryGroups}}
<tr data-bind="css:{ 'modified': repositoryGroup.modified()}">
<td>${repositoryGroup.id}</td>
<td>
<ul>
{{each(j,id) repositoryGroup.repositories()}}
<li>${id}</li>
{{/each}}
</ul>
</td>
<td>
<a href="#" data-bind="click: function(){editRepositoryGroup(repositoryGroup)}">
<span class="btn btn-primary">
<i class="icon-pencil icon-white"/>
</span>
</a>
</td>
<td>
<a href="#" data-bind="click: function(){deleteRepositoryGroup(repositoryGroup)}">
<span class="btn btn-danger">
<i class="icon-trash icon-white"/>
</span>
</a>
</td>
<td>
{{if repositoryGroup.modified()}}
<a href="#" class="btn btn-warning" data-bind="click: function(){saveRepositoryGroup(repositoryGroup)}">
${$.i18n.prop('save')}
</a>
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="repository-group-edit-tmpl" type="text/html">
<div class="row-fluid">
{{if update}}
<div class="dotted span8">
<blockquote>
${repositoryGroup.id}
<br/>
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}
</a>
</blockquote>
</div>
{{else}}
<div class="dotted span8">
<form id="repository-group-edit-form" class="well">
<fieldset id="repository-group-edit-fieldset">
<div class="control-group">
<label class="control-label" for="id">${$.i18n.prop('id')}</label>
<div class="controls">
<input type="text" class="xlarge required" id="id" name="id" size="15"
data-bind="value: repositoryGroup.id,css:{'uneditable-input': update},readonly:update"/>
</div>
</div>
</fieldset>
</form>
</div>
{{/if}}
{{if repositoryGroup.modified()}}
<div class="span3">
<a href="#" class="btn btn-warning" data-bind="click: function(){saveRepositoryGroup(repositoryGroup)}">${$.i18n.prop('save')}</a>
</div>
<br/>
{{/if}}
</div>
</script>
<script id="repository-group-edit-order-tmpl" type="text/html">
<div class="well draggable-item">
<blockquote>
${$data.id()}
<br/>
${$data.name()}
<br/>
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${$data.id()}" target="_blank">
${window.archivaRuntimeInfo.baseUrl}/repository/${$data.id()}
</a>
<br/>
</blockquote>
</div>
</script>
<script id="repository-group-delete-warning-tmpl" type='text/html'>
<div>
<span class="label label-warning">${$.i18n.prop('warning.not.undone.operation')}</span>
</div>
</script>

View File

@ -1,167 +0,0 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<script id="repositoryGroupsMain" type="text/html">
<div class="page-header">
<h2><img src="images/applications-internet-2-32-32.png"/>${$.i18n.prop('repository.groups.list')}</h2>
</div>
<ul id="repository-groups-view-tabs" class="nav nav-tabs">
<li id="repository-groups-view-tabs-li-grid" class="active">
<a data-toggle="tab" href="#repository-groups-view" id="repository-groups-view-tabs-a-network-proxies-grid">
${$.i18n.prop('repository-groups.grid.tab.title')}
</a>
</li>
<li id="repository-groups-view-tabs-li-edit">
<a data-toggle="tab" href="#repository-groups-edit" id="repository-groups-view-tabs-a-edit">${$.i18n.prop('add')}</a>
</li>
</ul>
<div id="repository-groups-view-tabs-content" class="tab-content">
<div id="repository-groups-view" class="tab-pane active">
<div id="repository-groups-table" data-bind='template:{name:"repository-groups-table-tmpl"}'>
</div>
</div>
<div id="repository-groups-edit" class="tab-pane">
<div class="row-fluid">
<div class="span5 dotted">
<div id="repository-groups-edit-div" data-bind='template:{name:"repository-group-edit-tmpl"}'></div>
<div id="repository-groups-edit-order-div" style="min-height: 80px"
data-bind="sortable: { template: 'repository-group-edit-order-tmpl',data:repositoryGroup.managedRepositories,afterMove:repositoryMoved}">
</div>
</div>
<div class="span5 dotted">
<h5>${$.i18n.prop('repository.groups.available.repositories')}</h5>
<br/>
<div id="repository-groups-edit-available-repositories" style="min-height: 80px"
data-bind="sortable: { template: 'repository-group-edit-order-tmpl',data:availableRepositories,afterMove:repositoryMoved}">
</div>
</div>
</div>
</div>
</div>
</script>
<script id="repository-groups-table-tmpl" type="text/html">
<table class="table table-striped table-bordered">
<thead>
<th>${$.i18n.prop('repository.groups.groups.grid.header')}</th>
<th>${$.i18n.prop('repository.groups.repositories.grid.header')}</th>
<th>${$.i18n.prop('edit')}</th>
<th>${$.i18n.prop('delete')}</th>
<th>${$.i18n.prop('save')}</th>
</thead>
<tbody>
{{each(i, repositoryGroup) repositoryGroups}}
<tr data-bind="css:{ 'modified': repositoryGroup.modified()}">
<td>${repositoryGroup.id}</td>
<td>
<ul>
{{each(j,id) repositoryGroup.repositories()}}
<li>${id}</li>
{{/each}}
</ul>
</td>
<td>
<a href="#" data-bind="click: function(){editRepositoryGroup(repositoryGroup)}">
<span class="btn btn-primary">
<i class="icon-pencil icon-white"/>
</span>
</a>
</td>
<td>
<a href="#" data-bind="click: function(){deleteRepositoryGroup(repositoryGroup)}">
<span class="btn btn-danger">
<i class="icon-trash icon-white"/>
</span>
</a>
</td>
<td>
{{if repositoryGroup.modified()}}
<a href="#" class="btn btn-warning" data-bind="click: function(){saveRepositoryGroup(repositoryGroup)}">
${$.i18n.prop('save')}
</a>
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="repository-group-edit-tmpl" type="text/html">
<div class="row-fluid">
{{if update}}
<div class="dotted span8">
<blockquote>
${repositoryGroup.id}
<br/>
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}
</a>
</blockquote>
</div>
{{else}}
<div class="dotted span8">
<form id="repository-group-edit-form" class="well">
<fieldset id="repository-group-edit-fieldset">
<div class="control-group">
<label class="control-label" for="id">${$.i18n.prop('id')}</label>
<div class="controls">
<input type="text" class="xlarge required" id="id" name="id" size="15"
data-bind="value: repositoryGroup.id,css:{'uneditable-input': update},readonly:update"/>
</div>
</div>
</fieldset>
</form>
</div>
{{/if}}
{{if repositoryGroup.modified()}}
<div class="span3">
<a href="#" class="btn btn-warning" data-bind="click: function(){saveRepositoryGroup(repositoryGroup)}">${$.i18n.prop('save')}</a>
</div>
<br/>
{{/if}}
</div>
</script>
<script id="repository-group-edit-order-tmpl" type="text/html">
<div class="well draggable-item">
<blockquote>
${$data.id()}
<br/>
${$data.name()}
<br/>
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${$data.id()}" target="_blank">
${window.archivaRuntimeInfo.baseUrl}/repository/${$data.id()}
</a>
<br/>
</blockquote>
</div>
</script>
<script id="repository-group-delete-warning-tmpl" type='text/html'>
<div>
<span class="label label-warning">${$.i18n.prop('warning.not.undone.operation')}</span>
</div>
</script>