From e0d5557a9e7f88050da2ccb42e02397952cded0d Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 22 Feb 2009 11:27:51 +0100 Subject: lots of view improvements - not ready though --- app/controllers/nodes_controller.rb | 5 +++-- app/views/admin/index.html.erb | 2 -- app/views/content/_article.html.erb | 2 +- app/views/content/render_page.html.erb | 2 +- app/views/layouts/admin.html.erb | 7 +++++-- app/views/nodes/edit.html.erb | 16 ++++++---------- app/views/nodes/index.html.erb | 12 ++++++++++-- app/views/nodes/new.html.erb | 14 ++++++++++++-- public/stylesheets/admin.css | 19 ++++++++++++++++++- 9 files changed, 56 insertions(+), 23 deletions(-) diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 7e2b733..baf023f 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -15,12 +15,13 @@ class NodesController < ApplicationController @nodes = Node.root.descendants.paginate( :include => :head, :page => params[:page], - :per_page => 30 + :per_page => 25, + :order => 'id DESC' ) end def new - + @node = Node.new end def create diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index e23e69b..e69de29 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb @@ -1,2 +0,0 @@ -

Admin#index

-

Find me in app/views/admin/index.html.erb

\ No newline at end of file diff --git a/app/views/content/_article.html.erb b/app/views/content/_article.html.erb index 1e06787..009d639 100644 --- a/app/views/content/_article.html.erb +++ b/app/views/content/_article.html.erb @@ -2,5 +2,5 @@

<%= article.title %>

-

<%= date_for_page article %>, gregoa

+

<%= date_for_page article %>, <%= @page.user.login %>

<%= article.abstract %>

\ No newline at end of file diff --git a/app/views/content/render_page.html.erb b/app/views/content/render_page.html.erb index b70f90e..f499c9c 100644 --- a/app/views/content/render_page.html.erb +++ b/app/views/content/render_page.html.erb @@ -10,7 +10,7 @@

<%= @page.title %>

-

<%= date_for_page @page %>, gregoa

+

<%= date_for_page @page %>, <%= @page.user.try(:login) %>


<%= @page.abstract %>

<%= aggregate?(@page.body) %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 2bde5dd..73e3b02 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -25,9 +25,12 @@
<%= flash[:notice] %> diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index f457bc7..f6513a7 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb @@ -1,12 +1,6 @@ -

Nodes#edit

- -<%= link_to 'Publish', publish_node_path, :method => :put %> -

Editing page

-<%= I18n.locale %> - -<%= @node.unique_name %> +Sprache: <%= I18n.locale %> Pfad: <%= @node.unique_name %>
<% form_for(@node) do |f| %> @@ -33,7 +27,9 @@ <%= f.submit "Update" %>

<% end %> - + + <%= link_to 'Show', @node %> | - <%= link_to 'Back', nodes_path %> -
\ No newline at end of file + <%= link_to 'Back', nodes_path %> | + <%= link_to 'Publish', publish_node_path, :method => :put %> +
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 5f913e9..533204d 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb @@ -10,7 +10,11 @@ <% @nodes.each do |node| %> "> - <%= node.head.title if node.head %> + + + <%= truncate(node.head.title, 50) if node.head %> + + <%= node.unique_name %> <%= link_to 'Show', node_path(node) %> @@ -21,4 +25,8 @@ <% end %>

-<%= will_paginate @nodes %> \ No newline at end of file +<%= will_paginate @nodes %> + +<% content_for :menu do %> + <%= link_to 'Create', new_node_path %> +<% end %> \ No newline at end of file diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 4258377..1207413 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb @@ -1,2 +1,12 @@ -

Nodes#new

-

Find me in app/views/nodes/new.html.erb

+

Create new node

+ +<% form_for @node do |f| %> +

+ <%= f.label 'Parent node' %>
+ <%= text_field_tag :parent_unique_name %> +

+

+ <%= f.label :slug %>
+ <%= f.text_field :slug %> +

+<% end %> \ No newline at end of file diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index e475f4c..242806f 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -33,7 +33,13 @@ th.actions { width: 150px; } -td {} +td { + padding: 3px; +} + +input[type=text] { + width: 300px; +} .page_editor input[type=text] { width: 600px; @@ -41,4 +47,15 @@ td {} .page_editor textarea { width: 600px; +} + +#navigation { + height: 40px; + border-bottom: 1px solid #f1f1f1; + font-size: 20px; + line-height: 30px; +} + +#navigation a { + text-decoration: none; } \ No newline at end of file -- cgit v1.3