Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions
@@ -0,0 +1,37 @@
const CoreView = require('backbone/core-view');
const template = require('./delete-mobile-app.tpl');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'modalModel',
'configModel',
'authenticityToken',
'needsPasswordConfirmation'
];
module.exports = CoreView.extend({
events: {
'submit .js-form': '_close',
'click .js-cancel': '_close'
},
initialize: function (options) {
checkAndBuildOpts(options, REQUIRED_OPTS, this);
},
render: function () {
const mobileAppId = this.options.mobileApp.id;
this.$el.html(
template({
formAction: `${this._configModel.get('base_url')}/your_apps/mobile/${mobileAppId}`,
authenticityToken: this._authenticityToken,
passwordNeeded: this._needsPasswordConfirmation
})
);
},
_close: function () {
this._modalModel.destroy();
}
});
@@ -0,0 +1,35 @@
<form accept-charset="UTF-8" action="<%- formAction %>" method="post" class="js-form">
<input name="utf8" type="hidden" value="&#x2713;" />
<input name="authenticity_token" type="hidden" value="<%- authenticityToken %>" />
<input name="_method" type="hidden" value="delete" />
<div class="CDB-Text Dialog-header u-inner">
<div class="Dialog-headerIcon Dialog-headerIcon--negative">
<i class="CDB-IconFont CDB-IconFont-keys"></i>
</div>
<p class="Dialog-headerTitle">You are about to delete your application</p>
<p class="Dialog-headerText">Remember, once you delete it there is no going back</p>
</div>
<% if (passwordNeeded) { %>
<div class="CDB-Text Dialog-body">
<div class="Form-row Form-row--centered has-label">
<div class="Form-rowLabel">
<label class="Form-label">Your password</label>
</div>
<div class="Form-rowData">
<input type="password" id="deletion_password_confirmation" name="password_confirmation" class="CDB-InputText CDB-Text Form-input Form-input--long" value=""/>
</div>
</div>
</div>
<% } %>
<div class="Dialog-footer u-inner">
<button type="button" class="CDB-Button CDB-Button--secondary js-cancel">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small u-upperCase">Cancel</span>
</button>
<button type="submit" class="CDB-Button CDB-Button--error js-save">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small u-upperCase">Delete this application</span>
</button>
</div>
</form>
@@ -0,0 +1,27 @@
const Backbone = require('backbone');
/**
* Header view model to handle state for dashboard header view.
*/
module.exports = Backbone.Model.extend({
breadcrumbTitle: function () {
return 'Configuration';
},
isBreadcrumbDropdownEnabled: function () {
return false;
},
isDisplayingDatasets: function () {
return false;
},
isDisplayingMaps: function () {
return false;
},
isDisplayingLockedItems: function () {
return false;
}
});