refactored main links
This commit is contained in:
@@ -2,7 +2,13 @@
|
|||||||
Danbooru.Sources = {};
|
Danbooru.Sources = {};
|
||||||
|
|
||||||
Danbooru.Sources.get = function(url) {
|
Danbooru.Sources.get = function(url) {
|
||||||
|
$.get("/sources.json", {
|
||||||
|
url: url
|
||||||
|
}).success(function(data) {
|
||||||
|
console.log(data);
|
||||||
|
}).error(function(data) {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,11 @@ a.active {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.login {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #e00;
|
||||||
|
}
|
||||||
|
|
||||||
abbr[title=required] {
|
abbr[title=required] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
23
app/views/layouts/_main_links.html.erb
Normal file
23
app/views/layouts/_main_links.html.erb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<menu class="main">
|
||||||
|
<% if CurrentUser.user.is_anonymous? %>
|
||||||
|
<%= nav_link_to("Login", new_session_path, :class => "login") %>
|
||||||
|
<% else %>
|
||||||
|
<%= nav_link_to("My Account", user_path(CurrentUser.user)) %>
|
||||||
|
<% end %>
|
||||||
|
<%= nav_link_to("Posts", posts_path) %>
|
||||||
|
<%= nav_link_to("Comments", comments_path(:group_by => "post")) %>
|
||||||
|
<%= nav_link_to("Notes", notes_path(:group_by => "post")) %>
|
||||||
|
<%= nav_link_to("Artists", artists_path(:order => "date")) %>
|
||||||
|
<%= nav_link_to("Tags", tags_path(:order => "date")) %>
|
||||||
|
<% if CurrentUser.is_moderator? %>
|
||||||
|
<%= nav_link_to("Aliases", tag_aliases_path) %>
|
||||||
|
<%= nav_link_to("Implications", tag_implications_path) %>
|
||||||
|
<% end %>
|
||||||
|
<%= nav_link_to("Pools", pools_path) %>
|
||||||
|
<%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %>
|
||||||
|
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
|
||||||
|
<% if CurrentUser.is_janitor? %>
|
||||||
|
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
||||||
|
<% end %>
|
||||||
|
<%= nav_link_to("»".html_safe, site_map_path) %>
|
||||||
|
</menu>
|
||||||
@@ -27,29 +27,7 @@
|
|||||||
|
|
||||||
<h1><%= link_to Danbooru.config.app_name, "/" %></h1>
|
<h1><%= link_to Danbooru.config.app_name, "/" %></h1>
|
||||||
<nav>
|
<nav>
|
||||||
<menu class="main">
|
<%= render "layouts/main_links" %>
|
||||||
<% if CurrentUser.user.is_anonymous? %>
|
|
||||||
<%= nav_link_to("Login", new_session_path) %>
|
|
||||||
<% else %>
|
|
||||||
<%= nav_link_to("My Account", user_path(CurrentUser.user)) %>
|
|
||||||
<% end %>
|
|
||||||
<%= nav_link_to("Posts", posts_path) %>
|
|
||||||
<%= nav_link_to("Comments", comments_path(:group_by => "post")) %>
|
|
||||||
<%= nav_link_to("Notes", notes_path(:group_by => "post")) %>
|
|
||||||
<%= nav_link_to("Artists", artists_path(:order => "date")) %>
|
|
||||||
<%= nav_link_to("Tags", tags_path(:order => "date")) %>
|
|
||||||
<% if CurrentUser.is_moderator? %>
|
|
||||||
<%= nav_link_to("Aliases", tag_aliases_path) %>
|
|
||||||
<%= nav_link_to("Implications", tag_implications_path) %>
|
|
||||||
<% end %>
|
|
||||||
<%= nav_link_to("Pools", pools_path) %>
|
|
||||||
<%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %>
|
|
||||||
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
|
|
||||||
<% if CurrentUser.is_janitor? %>
|
|
||||||
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
|
||||||
<% end %>
|
|
||||||
<%= nav_link_to("»".html_safe, site_map_path) %>
|
|
||||||
</menu>
|
|
||||||
<%= yield :secondary_links %>
|
<%= yield :secondary_links %>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user