diff options
| author | hukl <contact@smyck.org> | 2009-04-13 17:56:46 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-04-13 17:56:46 +0200 |
| commit | 27167671722b7c7a997c8bed7713ee9013bac326 (patch) | |
| tree | d69f8853bbbeaeebdda2ba9dc8d08b8090b4a523 /app | |
| parent | 8e90dd908c7e1d7fb8fb0e7c175b820e9b7b7c61 (diff) | |
rebuilding the admin interface
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/link_helper.rb | 5 | ||||
| -rw-r--r-- | app/views/admin/_menu.html.erb | 8 | ||||
| -rw-r--r-- | app/views/layouts/admin.html.erb | 5 | ||||
| -rw-r--r-- | app/views/nodes/edit.html.erb | 94 |
4 files changed, 63 insertions, 49 deletions
diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 33d8a06..881c553 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb | |||
| @@ -12,4 +12,9 @@ module LinkHelper | |||
| 12 | ) | 12 | ) |
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | def selected? controller_name | ||
| 16 | if params[:controller] == controller_name | ||
| 17 | return :class => "selected" | ||
| 18 | end | ||
| 19 | end | ||
| 15 | end \ No newline at end of file | 20 | end \ No newline at end of file |
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index fa616df..301c6c0 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <%= language_selector %> | | 1 | <%= language_selector %> |
| 2 | 2 | ||
| 3 | <%= link_to 'Overview', :controller => :admin, :action => 'index' %> | | 3 | <%= link_to 'Overview', :controller => :admin, :action => 'index' %> |
| 4 | <%= link_to 'Nodes', nodes_path %> | | 4 | <%= link_to 'Nodes', nodes_path, selected?('nodes') %> |
| 5 | <%= link_to 'User', users_path %> \ No newline at end of file | 5 | <%= link_to 'User', users_path %> > \ No newline at end of file |
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 570334d..68b8138 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | <title><%= "#{params[:controller]} | #{params[:action]}" %></title> | 8 | <title><%= "#{params[:controller]} | #{params[:action]}" %></title> |
| 9 | <%= stylesheet_link_tag 'admin' %> | 9 | <%= stylesheet_link_tag 'admin' %> |
| 10 | <%= javascript_include_tag 'tiny_mce/tiny_mce.js' %> | 10 | <%= javascript_include_tag 'tiny_mce/tiny_mce.js' %> |
| 11 | <%= javascript_include_tag 'jquery-1.3.2.min' %> | ||
| 12 | <%= javascript_include_tag 'admin_interface.js' %> | ||
| 11 | 13 | ||
| 12 | <script type="text/javascript"> | 14 | <script type="text/javascript"> |
| 13 | tinyMCE.init({ | 15 | tinyMCE.init({ |
| @@ -30,6 +32,9 @@ | |||
| 30 | <div id="navigation"> | 32 | <div id="navigation"> |
| 31 | <%= render :partial => 'admin/menu' if current_user %> | 33 | <%= render :partial => 'admin/menu' if current_user %> |
| 32 | </div> | 34 | </div> |
| 35 | <div id="subnavigation"> | ||
| 36 | <%= yield :subnavigation %> | ||
| 37 | </div> | ||
| 33 | <div id="flash"> | 38 | <div id="flash"> |
| 34 | <%= flash[:notice] %> | 39 | <%= flash[:notice] %> |
| 35 | </div> | 40 | </div> |
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 577a075..225e6ff 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -1,49 +1,53 @@ | |||
| 1 | <div id='subnavigation'> | 1 | <% content_for :subnavigation do %> |
| 2 | <%= link_to 'Show', @node %> | 2 | <%= link_to 'metadata', '#', :id => 'button', :class => "unselected" %> |
| 3 | <%= link_to 'Back', nodes_path %> | 3 | <%= link_to 'Preview', @node %> |
| 4 | <%= link_to 'Publish', publish_node_path, :method => :put %> | 4 | <%= link_to 'Publish', publish_node_path, :method => :put, :confirm => "Publish this draft?" %> |
| 5 | <%= link_to 'Diff revisions', :controller => :revisions, :action => :diff, :id => params[:id] %> | 5 | <%= link_to 'Diff revisions', :controller => :revisions, :action => :diff, :id => params[:id] %> |
| 6 | 6 | <% end %> | |
| 7 | </div> | ||
| 8 | |||
| 9 | <h1>Editing page</h1> | ||
| 10 | |||
| 11 | <strong>Sprache:</strong> <%= I18n.locale %> <strong>Pfad:</strong> <%= @node.unique_name %> | ||
| 12 | 7 | ||
| 13 | <div class="page_editor"> | 8 | <div id="page_editor"> |
| 14 | <% form_for(@node) do |f| %> | 9 | <% form_for(@node) do |f| %> |
| 15 | <%= f.error_messages %> | 10 | <%= f.error_messages %> |
| 11 | |||
| 12 | <table id="metadata"> | ||
| 13 | <tr> | ||
| 14 | <td class="description">Slug</td> | ||
| 15 | <td><%= f.text_field :slug %></td> | ||
| 16 | </tr> | ||
| 16 | 17 | ||
| 17 | <% fields_for @draft do |d| %> | 18 | <% fields_for @draft do |d| %> |
| 18 | 19 | <tr> | |
| 19 | <p> | 20 | <td class="description">Tags - comma seperated</td> |
| 20 | <%= d.label :published_at %><br /> | 21 | <td><%= text_field_tag :tag_list, @draft.tag_list.join(", ") %></td> |
| 21 | <%= d.datetime_select :published_at %> | 22 | </tr> |
| 22 | </p> | 23 | <tr> |
| 23 | <p> | 24 | <td class="description">Publish at</td> |
| 24 | <%= d.label :template_name %> | 25 | <td><%= d.datetime_select :published_at %></td> |
| 25 | <%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %> | 26 | </tr> |
| 26 | </p> | 27 | <tr> |
| 27 | <p> | 28 | <td class="description">Template</td> |
| 28 | <%= d.label :title %><br /> | 29 | <td><%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %></td> |
| 29 | <%= d.text_field :title %> | 30 | </tr> |
| 30 | </p> | 31 | </table> |
| 31 | <p> | 32 | |
| 32 | <%= d.label 'Tags, comma sperated' %><br /> | 33 | <table> |
| 33 | <%= text_field_tag :tag_list, @draft.tag_list.join(", ") %> | 34 | <tr> |
| 34 | </p> | 35 | <td class="description">Title</td> |
| 35 | <p> | 36 | <td><%= d.text_field :title %></td> |
| 36 | <%= d.label :abstract %><br /> | 37 | </tr> |
| 37 | <%= d.text_area :abstract %> | 38 | <tr> |
| 38 | </p> | 39 | <td class="description">Abstract</td> |
| 39 | <p> | 40 | <td><%= d.text_area :abstract %></td> |
| 40 | <%= d.label :body %><br /> | 41 | </tr> |
| 41 | <%= d.text_area :body, :class => 'with_editor' %> | 42 | <tr> |
| 42 | </p> | 43 | <td class="description">Body</td> |
| 43 | <% end %> | 44 | <td><%= d.text_area :body, :class => 'with_editor' %></td> |
| 44 | 45 | </tr> | |
| 45 | <p> | 46 | <tr> |
| 46 | <%= f.submit "Update" %> | 47 | <td></td> |
| 47 | </p> | 48 | <td class="right"><%= d.submit 'save' %></td> |
| 49 | </tr> | ||
| 50 | </table> | ||
| 48 | <% end %> | 51 | <% end %> |
| 49 | </div> | 52 | <% end %> |
| 53 | </div> \ No newline at end of file | ||
