Skip to content

Commit

Permalink
railsonfire test
Browse files Browse the repository at this point in the history
  • Loading branch information
sl80 committed Aug 28, 2011
1 parent 103c78e commit ee74735
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
protect_from_forgery #
end
2 changes: 0 additions & 2 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<h1>Home#index</h1>
<p>Hello World from support_tool</p>
<div id="container">
<div id="menu">
<ul>
Expand Down
18 changes: 18 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,21 @@
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Mayor.create(:name => 'Daley', :city => cities.first)


hosts = Host.create(%w(
host1.example.org
host2.example.org
host3.example.org
).map{ |x| {:name =>x} }
)

list_types = ListType.create(%w(
public
closed
).map{ |x| {:name => x} }
)

1..50.times do |i|
MailingList.create({:name => "Angelfreunde#{i}", :host => hosts[0], :list_type => list_types[0]})
end
12 changes: 5 additions & 7 deletions public/javascripts/app/templates/list.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
<span class="note"> melden</span><span class="notice"></span>
</div>
<div class="box tab tab-<%=model.id%>">
DAS IST EIN TEST <span class="close click">x</span>
<span class="item">Administrator ändern</span>
<br>
Administrator ändern
<span class="item">Administrator Passwort zurücksetzen</span>
<br>
Administrator Passwort zurücksetzen
<span class="item">Moderator ändern</span>
<br>
Moderator ändern
<span class="item">Moderator Passwort zurücksetzen</span>
<br>
Moderator Passwort zurücksetzen
<br>
Liste löschen
<span class="item">Liste löschen</span>
</div>
</li>
12 changes: 6 additions & 6 deletions public/javascripts/app/templates/lists.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h3>
<div>
<form>
<input type="text" class="searchfield"/>
</form>
<span class="search">search</span>
<span class="new">Create New</span>
</h3>
<form>
<input type="text" class="searchfield"/>
</form>
<div class="search">click</div>
</div>
<ul class="mailing-lists">
</ul>
10 changes: 3 additions & 7 deletions public/javascripts/app/views/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ App.Views.List = Backbone.View.extend({
},
events: {
"click .note" : "note",
"click .name" : "name",
"click .close": "close"
"click .name" : "click",
},

note: function() {
this.count++;
this.$('.notice').html(this.count)
},

name: function() {
click: function() {
var self = this;
this.tabs.panels.set(this.model.id);
},

close: function() {
this.tabs.panels.close();
},

render: function() {
// if(this.collection.length > 0) {
// var out = "<h3><a href='#new'>Create New</a></h3><ul>";
Expand Down
3 changes: 0 additions & 3 deletions public/javascripts/app/views/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ App.Views.Lists = Backbone.View.extend({

this.tabs = {};
this.render();
//console.log('init---')
this.addAll();
this.tabs.panels = new Tab(this.$(".mailing-lists"));
console.log('PANELS-X', this.panels);

},

Expand All @@ -32,7 +30,6 @@ App.Views.Lists = Backbone.View.extend({
addOne: function(list) {
console.log('addOne');
var view = new App.Views.List({model: list, tabs: this.tabs});
console.log('PANELS-A', this.panels);
this.$(".mailing-lists").append(view.render().el);
},

Expand Down
33 changes: 32 additions & 1 deletion public/stylesheets/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
body {
font-family: arial;
padding:0;
}

#menu {
float: left;
width:300px;
Expand Down Expand Up @@ -26,9 +31,35 @@
padding: 5px;
position:absolute;
z-index: 5;
margin-left:20px;
margin-left:5px;
font-size: 0.8em;
}

.box .item {
cursor: pointer;
}

.box .item:hover {
font-weight: bold;
}

.click {
cursor: pointer;
}

.mailing-lists {
position: absolute;
/* border: 1px solid red; */
bottom: 0px;
top: 80px;
right:0px;
left:200px;
list-style-type:none;
overflow: auto;
margin:0;
}

.mailing-lists li {
background-color: #EDF0F9;
border-bottom:1px solid #CCC;
}

0 comments on commit ee74735

Please sign in to comment.