style="display: none;"<% end %>>
- <% form_tag(:action => "create") do %>
-
- <% unless @current_user.is_anonymous? %>
- <%= hidden_field_tag "tag_implication[creator_id]", @current_user.id %>
+
+
+
+ <% form_tag(tag_implications_path, :method => :get) do %>
+ <%= text_field_tag "query", params[:query] %>
+ <%= submit_tag "Search Aliases" %>
+ <%= submit_tag "Search Implications" %>
<% end %>
-
-
+
+
+
+
- |
- <%= text_field "tag_implication", "predicate", :size => 40, :value => params[:from_name] %> |
-
-
- |
- <%= text_field "tag_implication", "consequent", :size => 40, :value => params[:to_name] %> |
-
-
- |
- <%= text_area "tag_implication", "reason", :size => "40x2", :value => params[:reason] %> |
-
-
- | <%= submit_tag "Submit" %> |
-
-
- <% end %>
+ From |
+ To |
+ Reference |
+ |
+
+
+
+ <% @tag_implications.each do |tag_implication| %>
+
+ | <%= link_to tag_implication.antecedent_name, posts_path(:tags => tag_implication.antecedent_name) %> (<%= tag_implication.antecedent_tag.post_count rescue 0 %>) |
+ <%= link_to tag_implication.consequent_name, posts_path(:tags => tag_implication.consequent_name) %> (<%= tag_implication.consequent_tag.post_count rescue 0 %>) |
+ <%= link_to tag_implication.forum_topic_id, forum_topic_path(tag_implication.forum_topic_id) %> |
+
+ <% if CurrentUser.is_admin? %>
+ <%= link_to "Delete", tag_implication_path(tag_implication), :remote => true, :method => :delete, :confirm => "Are you sure you want to delete this implication?" %>
+ <% end %>
+ |
+
+ <% end %>
+
+
-<% end %>
+
<%= will_paginate(@implications) %>
-<% content_for("subnavbar") do %>
-
<%= link_to "List", :controller => "tag_implication", :action => "index" %>
-
<%= link_to "Add", :controller => "tag_implication", :action => "new" %>
-
<%= link_to "Help", :controller => "help", :action => "tag_implications" %>
-<% end %>
-
+<%= render "secondary_links" %>
diff --git a/app/views/tag_implications/new.html.erb b/app/views/tag_implications/new.html.erb
index 557d522ec..3824d7632 100644
--- a/app/views/tag_implications/new.html.erb
+++ b/app/views/tag_implications/new.html.erb
@@ -1,20 +1,13 @@
-<% form_tag(:controller => "forum", :action => "create") do %>
-
You can create a forum thread to suggest the creation of an implication.
-
-
- |
- <%= text_field "tag_implication", "predicate", :size => 40 %> |
-
-
- |
- <%= text_field "tag_implication", "consequent", :size => 40 %> |
-
-
- |
- <%= text_area "tag_implication", "reason", :rows => 10, :cols => 60 %> |
-
-
- | <%= submit_tag "Submit" %> |
-
-
-<% end %>
+
+
+
New Tag Implication
+ <%= simple_form_for(@tag_implication) do |f| %>
+ <%= f.input :antecedent_name, :label => "From" %>
+ <%= f.input :consequent_name, :label => "To" %>
+ <%= f.input :forum_topic_id, :label => "Forum" %>
+ <%= f.button :submit %>
+ <% end %>
+
+
+
+<%= render "secondary_links" %>
\ No newline at end of file
diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb
index d1b92424a..cb7536c93 100644
--- a/app/views/tags/index.html.erb
+++ b/app/views/tags/index.html.erb
@@ -12,7 +12,7 @@
| <%= tag.post_count %> |
- <%= link_to("?", wiki_pages_path(:search => {:title_equals => tag.name})) %>
+ <%= link_to("?", wiki_pages_path(:title => tag.name)) %>
<%= link_to(tag.name, posts_path(:tags => tag.name)) %>
|
diff --git a/config/routes.rb b/config/routes.rb
index d26d83851..58cd8e641 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -68,6 +68,9 @@ Danbooru::Application.routes.draw do
end
resources :wiki_page_versions, :only => [:index]
+ match '/favorites/:id' => 'favorites#create', :via => :post, :as => "favorite"
+ match '/favorites/:id' => 'favorites#destroy', :via => :delete, :as => "favorite"
+ match '/favorites' => 'favorites#index', :via => :get, :as => "favorites"
match '/pool_post' => 'pools_posts#create', :via => :post, :as => 'pool_post'
match '/pool_post' => 'pools_posts#destroy', :via => :delete, :as => 'pool_post'
match '/post_moderation/moderate' => 'post_moderation#moderate'
diff --git a/public/javascripts/compiled/default.js b/public/javascripts/compiled/default.js
index d3d999587..4ea90514b 100644
--- a/public/javascripts/compiled/default.js
+++ b/public/javascripts/compiled/default.js
@@ -681,6 +681,15 @@ $(document).ready(function() {
$(".comment-section[data-post-id=" + post_id + "] form").show();
$(this).hide();
});
+
+ // Ajax links
+ $("a[data-remote=true]").click(function(e) {
+ Danbooru.ajax_start(e.target);
+ })
+
+ $("a[data-remote=true]").ajaxComplete(function(e) {
+ Danbooru.ajax_stop(e.target);
+ })
// Image resize sidebar
$("#resize-links").hide();
@@ -779,12 +788,12 @@ $(document).ready(function() {
this.j_alert("Error", msg);
}
- Danbooru.ajax_start = function(element) {
- $(element).after('
...');
+ Danbooru.ajax_start = function(target) {
+ $(target).after('

');
}
- Danbooru.ajax_stop = function(element) {
- $(element).next("span.wait").remove();
+ Danbooru.ajax_stop = function(target) {
+ $(target).next("img.wait").remove();
}
})();
// PostModeMenu = {
@@ -1079,8 +1088,6 @@ $(document).ready(function() {
Danbooru.Favorite = {};
Danbooru.Favorite.initialize_all = function() {
- this.initialize_add_to_favorites();
- this.initialize_remove_from_favorites();
this.hide_or_show_add_to_favorites_link();
}
@@ -1099,51 +1106,6 @@ $(document).ready(function() {
$("a#remove-from-favorites").hide();
}
}
-
- Danbooru.Favorite.initialize_add_to_favorites = function() {
- $("a#add-to-favorites").click(function(e) {
- e.preventDefault();
-
- $.ajax({
- type: "post",
- url: "/favorites",
- data: {
- id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- success: function() {
- $("a#add-to-favorites").hide();
- $("a#remove-from-favorites").show();
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.Favorite.initialize_remove_from_favorites = function() {
- $("a#remove-from-favorites").click(function(e) {
- e.preventDefault();
-
- $.ajax({
- type: "delete",
- url: "/favorites/" + Danbooru.meta("post-id"),
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- success: function() {
- $("a#add-to-favorites").show();
- $("a#remove-from-favorites").hide();
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
})();
$(document).ready(function() {
@@ -1193,12 +1155,8 @@ $(document).ready(function() {
Danbooru.PostModeration = {};
Danbooru.PostModeration.initialize_all = function() {
- this.initialize_approve_link();
- this.initialize_disapprove_link();
this.hide_or_show_approve_and_disapprove_links();
this.hide_or_show_delete_and_undelete_links();
- this.initialize_delete_link();
- this.initialize_undelete_link();
}
Danbooru.PostModeration.hide_or_show_approve_and_disapprove_links = function() {
@@ -1215,82 +1173,6 @@ $(document).ready(function() {
$("a#undelete").hide();
}
}
-
- Danbooru.PostModeration.initialize_delete_link = function() {
- $("a#delete").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "post",
- url: "/post_moderation/delete.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.PostModeration.initialize_undelete_link = function() {
- $("a#undelete").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "post",
- url: "/post_moderation/undelete.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.PostModeration.initialize_disapprove_link = function() {
- $("a#disapprove").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "put",
- url: "/post_moderation/disapprove.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.PostModeration.initialize_approve_link = function() {
- $("a#approve").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "put",
- url: "/post_moderation/approve.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
})();
$(document).ready(function() {
diff --git a/public/javascripts/src/app/application.js b/public/javascripts/src/app/application.js
index 2c3ece0c3..bec828c0b 100644
--- a/public/javascripts/src/app/application.js
+++ b/public/javascripts/src/app/application.js
@@ -15,6 +15,15 @@ $(document).ready(function() {
$(".comment-section[data-post-id=" + post_id + "] form").show();
$(this).hide();
});
+
+ // Ajax links
+ $("a[data-remote=true]").click(function(e) {
+ Danbooru.ajax_start(e.target);
+ })
+
+ $("a[data-remote=true]").ajaxComplete(function(e) {
+ Danbooru.ajax_stop(e.target);
+ })
// Image resize sidebar
$("#resize-links").hide();
diff --git a/public/javascripts/src/app/favorites.js b/public/javascripts/src/app/favorites.js
index 4c058cc70..3a88f0860 100644
--- a/public/javascripts/src/app/favorites.js
+++ b/public/javascripts/src/app/favorites.js
@@ -2,8 +2,6 @@
Danbooru.Favorite = {};
Danbooru.Favorite.initialize_all = function() {
- this.initialize_add_to_favorites();
- this.initialize_remove_from_favorites();
this.hide_or_show_add_to_favorites_link();
}
@@ -22,51 +20,6 @@
$("a#remove-from-favorites").hide();
}
}
-
- Danbooru.Favorite.initialize_add_to_favorites = function() {
- $("a#add-to-favorites").click(function(e) {
- e.preventDefault();
-
- $.ajax({
- type: "post",
- url: "/favorites",
- data: {
- id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- success: function() {
- $("a#add-to-favorites").hide();
- $("a#remove-from-favorites").show();
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.Favorite.initialize_remove_from_favorites = function() {
- $("a#remove-from-favorites").click(function(e) {
- e.preventDefault();
-
- $.ajax({
- type: "delete",
- url: "/favorites/" + Danbooru.meta("post-id"),
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- success: function() {
- $("a#add-to-favorites").show();
- $("a#remove-from-favorites").hide();
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
})();
$(document).ready(function() {
diff --git a/public/javascripts/src/app/post_moderation.js b/public/javascripts/src/app/post_moderation.js
index 8b0cb63e7..a79e11b57 100644
--- a/public/javascripts/src/app/post_moderation.js
+++ b/public/javascripts/src/app/post_moderation.js
@@ -2,12 +2,8 @@
Danbooru.PostModeration = {};
Danbooru.PostModeration.initialize_all = function() {
- this.initialize_approve_link();
- this.initialize_disapprove_link();
this.hide_or_show_approve_and_disapprove_links();
this.hide_or_show_delete_and_undelete_links();
- this.initialize_delete_link();
- this.initialize_undelete_link();
}
Danbooru.PostModeration.hide_or_show_approve_and_disapprove_links = function() {
@@ -24,82 +20,6 @@
$("a#undelete").hide();
}
}
-
- Danbooru.PostModeration.initialize_delete_link = function() {
- $("a#delete").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "post",
- url: "/post_moderation/delete.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.PostModeration.initialize_undelete_link = function() {
- $("a#undelete").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "post",
- url: "/post_moderation/undelete.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.PostModeration.initialize_disapprove_link = function() {
- $("a#disapprove").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "put",
- url: "/post_moderation/disapprove.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
-
- Danbooru.PostModeration.initialize_approve_link = function() {
- $("a#approve").click(function(e) {
- e.preventDefault();
- $.ajax({
- type: "put",
- url: "/post_moderation/approve.js",
- data: {
- post_id: Danbooru.meta("post-id")
- },
- beforeSend: function() {
- Danbooru.ajax_start(e.target);
- },
- complete: function() {
- Danbooru.ajax_stop(e.target);
- }
- });
- });
- }
})();
$(document).ready(function() {
diff --git a/public/javascripts/src/app/utility.js b/public/javascripts/src/app/utility.js
index 5040faeca..78f6de496 100644
--- a/public/javascripts/src/app/utility.js
+++ b/public/javascripts/src/app/utility.js
@@ -11,11 +11,11 @@
this.j_alert("Error", msg);
}
- Danbooru.ajax_start = function(element) {
- $(element).after('
...');
+ Danbooru.ajax_start = function(target) {
+ $(target).after('

');
}
- Danbooru.ajax_stop = function(element) {
- $(element).next("span.wait").remove();
+ Danbooru.ajax_stop = function(target) {
+ $(target).next("img.wait").remove();
}
})();
diff --git a/public/stylesheets/compiled/default.css b/public/stylesheets/compiled/default.css
index b210be788..a87ff61ff 100644
--- a/public/stylesheets/compiled/default.css
+++ b/public/stylesheets/compiled/default.css
@@ -416,3 +416,26 @@ div.users div.new {
/*** Uploads ***/
div.uploads div.new div#upload-guide-notice {
margin-bottom: 2em; }
+
+/*** notify ***/
+.notify-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 1000; }
+ .notify-container .notify-notification {
+ position: relative; }
+ .notify-container .notify-notification .notify-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ background-color: #333;
+ z-index: 1; }
+ .notify-container .notify-notification .notify-message {
+ position: relative;
+ z-index: 2;
+ padding: 20px;
+ text-align: center;
+ color: #FFF; }
diff --git a/public/stylesheets/src/default.scss b/public/stylesheets/src/default.scss
index 2df028b94..afb55edbf 100644
--- a/public/stylesheets/src/default.scss
+++ b/public/stylesheets/src/default.scss
@@ -698,3 +698,35 @@ div.uploads {
}
}
}
+
+
+/*** notify ***/
+.notify-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 1000;
+
+ .notify-notification {
+ position: relative;
+
+ .notify-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ background-color: #333;
+ z-index: 1;
+ }
+
+ .notify-message {
+ position: relative;
+ z-index: 2;
+ padding: 20px;
+ text-align: center;
+ color: #FFF;
+ }
+ }
+}
+
diff --git a/script/custom/auto_compile.sh b/script/custom/auto_compile.sh
index f7f00ba17..e8030a48a 100755
--- a/script/custom/auto_compile.sh
+++ b/script/custom/auto_compile.sh
@@ -2,5 +2,6 @@
while true ; do
script/custom/compile_javascripts ;
+ sass public/stylesheets/src/default.scss public/stylesheets/compiled/default.css ;
sleep 1 ;
done