Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make use of the admin bar for some links

  • Loading branch information...
commit 0b665470b38ea2263bee88c00fb94d40f2df839c 1 parent d6f93c6
@jlapier authored
View
6 app/helpers/event_calendar/events_helper.rb
@@ -232,12 +232,12 @@ def links_to_edit_and_delete_event(event, wrapper_options={}, link_options={})
link_to_edit_event(event, {
:no_wrapper => true
}.merge!(wrapper_options), {
- :link_text => 'update'
- }.merge!(link_options)) + " " +
+ :link_text => 'Edit this Event'
+ }.merge!(link_options)) + " | " +
link_to_delete_event(event, {
:no_wrapper => true
}.merge!(wrapper_options), {
- :link_text => 'delete'
+ :link_text => 'Delete this Event'
}.merge!(link_options))
end
View
5 app/views/categories/index.html.erb
@@ -15,10 +15,9 @@
</p>
<% end %>
-<p class="admin_links">
+<% content_for :admin_bar do %>
<%= link_to 'List of Pages', content_pages_path %>
-</p>
-
+<% end %>
<% content_for :javascript do %>
<script type="text/javascript">
View
13 app/views/categories/show.html.erb
@@ -60,15 +60,12 @@
<%= f.submit 'set' %>
</p>
<% end %>
+<% end %>
- <p class="admin_links">
- <span class="fake_button">
- <%= link_to 'List of Categories', categories_path %> |
- <%= link_to 'List of Pages', content_pages_path %> |
- <%= link_to 'List of Blog Posts', blog_posts_path %> |
- <%= link_to "Create a New Page in <em>#{@category.name}</em>".html_safe, new_content_page_path(:category_id => @category.id) %>
- </span>
- </p>
+<% content_for :admin_bar do %>
+ <%= link_to 'List of Categories', categories_path %> |
+ <%= link_to 'List of Pages', content_pages_path %> |
+ <%= link_to "Create a New Page in <em>#{@category.name}</em>".html_safe, new_content_page_path(:category_id => @category.id) %>
<% end %>
<script type="text/javascript">
View
8 app/views/content_pages/edit.html.erb
@@ -35,11 +35,9 @@
<br/>
<% content_for :admin_bar do %>
- <p>
- <%= link_to 'Create a New Page', new_content_page_path %> |
- <%= link_to 'List of Pages', content_pages_path %> |
- <%= link_to 'List of Categories', categories_path %>
- </p>
+ <%= link_to 'Create a New Page', new_content_page_path %> |
+ <%= link_to 'List of Pages', content_pages_path %> |
+ <%= link_to 'List of Categories', categories_path %>
<% end %>
View
4 app/views/content_pages/index.html.erb
@@ -57,11 +57,9 @@
</tbody>
</table>
-<% if is_admin? %>
-<p class="admin_links">
+<% content_for :admin_bar do %>
<%= link_to 'Create a New Page', new_content_page_path %> |
<%= link_to 'List of Categories', categories_path %>
-</p>
<% end %>
View
4 app/views/content_pages/new.html.erb
@@ -2,4 +2,6 @@
<%= render :partial => 'form' %>
-<p>[<%= link_to 'Back to List of Pages', content_pages_path %>]</p>
+<% content_for :admin_bar do %>
+ <%= link_to 'Back to List of Pages', content_pages_path %>
+<% end %>
View
14 app/views/content_pages/show.html.erb
@@ -6,17 +6,15 @@
<% unless @content_page.publish_on.nil? %>
<div style="float:right; text-align:right;">
<% if @content_page.publish_on <= Date.today %>
- <em>Publish on: <%= @content_page.publish_on.strftime("%m/%d/%Y") %></em>
+ <em>Publish date: <%= @content_page.publish_on.strftime("%m/%d/%Y") %></em>
<% else %>
- <em class="highlight">To be published on: <%= @content_page.publish_on.strftime("%m/%d/%Y") %></em>
+ <em class="highlight">This page will be published on: <%= @content_page.publish_on.strftime("%m/%d/%Y") %></em>
<% end %>
</div>
<% end %>
- <p>
- <%= link_to 'Edit this Page', edit_content_page_path(@content_page) %> |
- <%= link_to 'Create a New Page', new_content_page_path %> |
- <%= link_to 'List of Pages', content_pages_path %> |
- <%= link_to 'List of Categories', categories_path %>
- </p>
+ <%= link_to 'Edit this Page', edit_content_page_path(@content_page) %> |
+ <%= link_to 'Create a New Page', new_content_page_path %> |
+ <%= link_to 'List of Pages', content_pages_path %> |
+ <%= link_to 'List of Categories', categories_path %>
<% end %>
View
6 app/views/event_calendar/events/_admin_links.html.erb
@@ -0,0 +1,6 @@
+<% content_for :admin_bar do %>
+ <%= link_to_new_event %>
+ <% if @event %>
+ | <%= links_to_edit_and_delete_event(@event) if @event.current_revision? %>
+ <% end %>
+<% end %>
View
3  app/views/event_calendar/events/_event.html.erb
@@ -1,8 +1,5 @@
<% unless event.nil? %>
<%= div_for_record(event) do -%>
- <p style="float: right;">
- <%= links_to_edit_and_delete_event(event, {}, {:class => 'fake_button'}) if event.current_revision? %>
- </p>
<h1><%= link_to_events({:no_wrapper => true}, {:link_text => "Events"}) %>: <%= event.name %> (<em><%= event.event_type %></em>)</h1>
<div style="clear:both"></div>
<%= render :partial => 'event_calendar/events/event_details', :object => event %>
View
2  app/views/event_calendar/events/index.html.erb
@@ -9,7 +9,6 @@
<p style="float: right; text-align: center;">
<a href="#" class="fake_button view_events calendar">Calendar</a>
<a href="#" class="fake_button view_events list">List</a>
- <%= link_to_new_event({}, {:class => 'fake_button'}) %>
</p>
</div>
@@ -30,3 +29,4 @@
<div id="event_mini_description" style="display:none"></div>
+<%= render :partial => 'admin_links' %>
View
2  app/views/event_calendar/events/show.html.erb
@@ -10,3 +10,5 @@
</div>
<% end %>
<%= form_for_browse_event_revisions(@event) %>
+
+<%= render :partial => 'admin_links' %>
View
2  app/views/layouts/_admin_bar.html.erb
@@ -1,3 +1,5 @@
<div id="admin_bar">
+ <strong><%= link_to('Site Administration', admin_site_settings_path) %></strong>
+ &nbsp; :: &nbsp;
<%= yield :admin_bar %>
</div>
View
2  app/views/site_settings/admin.html.erb
@@ -6,8 +6,6 @@
<li><%= link_to image_tag('icons/text_list_bullets.png') + ' List of Categories', categories_path %></li>
<li><%= link_to image_tag('icons/calendar.png') + ' Manage Events', event_calendar_dashboard_path %></li>
<li><%= link_to image_tag('icons/folder_page.png') + ' Manage Files', file_attachments_path %></li>
-</ul>
-<ul class="side_by_side">
<li><%= link_to image_tag('icons/page_white_stack.png') + ' Manage Blog', blog_dashboard_path %></li>
</ul>
View
18 public/stylesheets/application.css
@@ -68,18 +68,21 @@ input#user_openid_identifier, input#user_session_openid_identifier {
}
#admin_bar {
+ color: #FFF;
font-size: 10px;
margin: 0;
- padding: 0px 16px;
- background: #666;
+ padding: 2px 8px;
+ background: #777;
+ border-top: 1px solid #000;
border-bottom: 1px solid #000;
}
#admin_bar p { margin: 0; }
#admin_bar a:link, #admin_bar a:visited {
+ text-shadow: #000 0.1em 0.1em 0.2em;
font-family: Verdana, sans-serif;
- color: #DDD;
+ color: #EEE;
text-decoration: none;
}
@@ -88,6 +91,12 @@ input#user_openid_identifier, input#user_session_openid_identifier {
text-decoration: underline;
}
+#admin_bar em.highlight {
+ background: #FF9;
+ color: #933;
+ padding: 2px;
+}
+
.link_box a:link, .link_box a:visited { color: #009; }
.link_box a:hover { color: #00F; }
@@ -122,7 +131,8 @@ table.nice_table td input, table.nice_table td select { font-size: 11px; border:
th.sorted_by { background: #99C; }
-ul.side_by_side li { display: inline; padding-right: 20px; }
+ul.side_by_side li { display: inline; padding-right: 20px; line-height: 250% }
+ul.side_by_side li a { white-space: nowrap; }
ul.side_by_side li img { vertical-align: middle; }
#tagCloud {
View
2  public/stylesheets/formtastic_changes.css
@@ -17,6 +17,7 @@ form.formtastic li {
margin-right: 40px;
}
+form.formtastic fieldset { overflow: hidden; }
form.formtastic fieldset ol li { vertical-align:top; }
form.formtastic fieldset ol li label { width: 30%; }
form.formtastic fieldset ol li.url input { width: 67%; }
@@ -39,3 +40,4 @@ form.dynamic {
#event_start_on { width: 50% }
#event_end_on_input label { width: 49% }
#event_end_on { width: 50% }
+
Please sign in to comment.
Something went wrong with that request. Please try again.