Skip to content

Commit

Permalink
Filter dummies hinzugefügt für edit list
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan committed Nov 28, 2012
1 parent 0ef834b commit d5af062
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 44 deletions.
3 changes: 1 addition & 2 deletions app/modules/localeEdit/localeEdit.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function(app, jquery, Views ) {
Localeedit.ItemModel = Backbone.Model.extend({ Localeedit.ItemModel = Backbone.Model.extend({
defaults: { defaults: {
Language: 'XX', Language: 'XX',
Value: 'Foo', Value: 'Foo'
Active: false
}, },
initialize: function() { initialize: function() {
console.log('new Locale ItemModel'); console.log('new Locale ItemModel');
Expand Down
34 changes: 7 additions & 27 deletions app/modules/localeEdit/views.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,25 +27,14 @@ function(app, Backbone) {
className: 'edititem ', className: 'edititem ',


events: { events: {
click: "activateInput" "change input.translation": "translationChanged"
}, },


activateInput: function(ev) { translationChanged: function(ev) {
var model = this.model; console.log(ev);
//this.$el.find('input').removeAttr('disable'); },
model.Active = true;
// var org = app.router.users.org;
// var user = app.router.repos.user;


// // Immediately reflect the active state.
// app.active = this.model;
this.render();


// // Easily create a URL.
// app.router.go("org", org, "user", user, "repo", model.get("name"));

return false;
},
data: function() { data: function() {
return { model: this.model }; return { model: this.model };
} }
Expand All @@ -64,16 +53,6 @@ function(app, Backbone) {
return { model: this.model }; return { model: this.model };
}, },


events: {
click: "activateInput"
},

activateInput: function(ev) {
var model = this.model;


return false;
},


beforeRender: function() { beforeRender: function() {
var items = this.model.get('LocaleValues'); var items = this.model.get('LocaleValues');
Expand All @@ -92,7 +71,8 @@ Views.EditList = Backbone.View.extend({
template: 'app/templates/localeedit/edit', template: 'app/templates/localeedit/edit',
//tagName: 'div', //tagName: 'div',
manage: true, manage: true,

className: 'container',

data: function() { data: function() {
return { return {
count: this.collection.length count: this.collection.length
Expand Down Expand Up @@ -123,7 +103,7 @@ Views.EditList = Backbone.View.extend({
this.collection.on("fetch", function() { this.collection.on("fetch", function() {
this.$("ul").parent().html("<img src='/app/img/loading.gif'>"); this.$("ul").parent().html("<img src='/app/img/loading.gif'>");
}, this); }, this);
this.collection.fetch(); //this.collection.fetch();
} }


}); });
Expand Down
3 changes: 2 additions & 1 deletion app/router.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function(app,LocaleEdit,jquery) {
jquery('ul.nav li').removeClass('active'); jquery('ul.nav li').removeClass('active');
jquery('ul.nav a[href="#edit"]').parent().addClass('active'); jquery('ul.nav a[href="#edit"]').parent().addClass('active');


}); });
collection.fetch();


} }


Expand Down
7 changes: 7 additions & 0 deletions app/styles/style.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ li.edititem {
clear: left; clear: left;
} }


.edit-wrapper-outer{
margin: 0 0 10px 0;
}


.edit-wrapper-inner{
background-color: #ccc;
border: solid 1px #5E5E5E;
}
37 changes: 29 additions & 8 deletions app/templates/localeedit/edit.html
Original file line number Original file line Diff line number Diff line change
@@ -1,13 +1,34 @@
<div class="edit">
<label></label>
</div>




<div class="row" style="padding: 0 0 0 40px;">
<div class="pull-left">
<% if (count) { %> <% if (count) { %>
<h4>Locales (<%= count %>)</h4> <h4>Anzahl der Locale Keys (<%= count %>)</h4>
<hr> <hr>
<% } else { %> <% } else { %>
<h4>No Locales found.</h4> <h4>No Locales found.</h4>
<img src ="/app/img/loading.gif"></img> <img src ="/app/img/loading.gif"></img>
<% } %> <% } %>
</div>
<div class="pull-right">
<button type="foo" class="btn btn-primary save">
<i class=" icon-ok icon-white"></i>
<span>Save</span>
</button>
<button type="foo" class="btn btn-danger delete">
<i class="icon-ban-circle icon-white"></i>
<span>Reload</span>
</button>
</diV>
</div>

<div class="container">
<div class="row" style="padding: 0 0 0 40px;">
<input class="input-medium" type="text" placeholder="KEY"></input>
<input class="input-medium" type="text" placeholder="LANGUAGE"></input>
<input class="input-medium" type="text" placeholder="VALUE"></input>
</diV>
</div>


<div class="localelistitems"></div> <div class="localelistitems"></div>
4 changes: 2 additions & 2 deletions app/templates/localeedit/editItem.html
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="edit-wrapper-inner container hero-unit"> <div class="edit-wrapper-inner container ">
<div class="edit-wrapper-inner row-fluid"> <div class="edit-wrapper-inner row-fluid">
<div class="pull-left span4 key"> <div class="pull-left span4 key hero-unit">
<span><%= model.get("LocaleKey") %></span> <span><%= model.get("LocaleKey") %></span>
</div> </div>
<div class="pull-left span8 values"> <div class="pull-left span8 values">
Expand Down
4 changes: 3 additions & 1 deletion app/templates/localeedit/editKeyValueItem.html
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1,4 @@


<span class="label"><%= model.Language %></span> <input type="text" <%= !model.Active ? 'disabled' : ''%> value='<%= model.Value %>'></input> <span class="label"><%= model.Language %></span>
<input class="translation input-xxlarge" type="text" value='<%= model.Value %>'></input>
<!-- <textarea class="input-xxlarge" rows="3" type="text" placeholder=".input-xlarge"><%= model.Value %></textarea> -->
Binary file modified favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="app/styles/jquery.fileupload-ui.css"> <link rel="stylesheet" href="app/styles/jquery.fileupload-ui.css">


<title>Backbone Boilerplate</title> <title>DFF Locale Editor</title>


<!-- Application styles. --> <!-- Application styles. -->


Expand Down
2 changes: 1 addition & 1 deletion localeEditFileManager.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function toMultiLocaleItem (Locales){
for (var prop in lang) { for (var prop in lang) {
var existing = multiLocaleList[prop] || {Values: []}; var existing = multiLocaleList[prop] || {Values: []};
var localValue = { Language: language, var localValue = { Language: language,
Value: lang[prop] Value: lang[prop].toString()
} }
existing.Values.push(localValue); existing.Values.push(localValue);
multiLocaleList[prop] = existing; multiLocaleList[prop] = existing;
Expand Down
2 changes: 1 addition & 1 deletion main.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --> <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="app/styles/jquery.fileupload-ui.css"> <link rel="stylesheet" href="app/styles/jquery.fileupload-ui.css">


<title>Backbone Boilerplate</title> <title>DFF Locale Editor</title>


<!-- Application styles. --> <!-- Application styles. -->


Expand Down

0 comments on commit d5af062

Please sign in to comment.