rostra 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/rostra/application.js +14 -2
- data/app/assets/stylesheets/rostra/buttons.css +4 -1
- data/app/helpers/rostra/base/application_helper.rb +1 -1
- data/app/models/comment.rb +3 -3
- data/app/models/rostra/answer.rb +1 -1
- data/app/views/rostra/questions/show.html.erb +1 -1
- data/lib/generators/rostra/templates/app/helpers/rostra/application_helper.rb +1 -1
- data/lib/rostra/version.rb +1 -1
- metadata +2 -2
@@ -25,6 +25,19 @@ $(document).ready(function() {
|
|
25
25
|
}();
|
26
26
|
|
27
27
|
|
28
|
+
var hide_submit_button_on_valid_submit_to_prevent_double_posting = function() {
|
29
|
+
$('form.rostra_question, form.rostra_answer, form.comment').submit(function() {
|
30
|
+
var form = $(this);
|
31
|
+
var settings = window[this.id]
|
32
|
+
|
33
|
+
if ( form.isValid(settings.validators) ) {
|
34
|
+
var submit_button = form.find('input[type="submit"]');
|
35
|
+
submit_button.val('Saving...').attr("disabled", "disabled");
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}();
|
39
|
+
|
40
|
+
|
28
41
|
$('input.tokenize').each(function() {
|
29
42
|
var input = $(this);
|
30
43
|
var ajax_url = input.attr('data-ajax_url');
|
@@ -81,7 +94,7 @@ $(document).ready(function() {
|
|
81
94
|
paste_remove_styles: true,
|
82
95
|
paste_remove_spans: true,
|
83
96
|
setup: function (ed) {
|
84
|
-
ed.onInit.add(function(ed){
|
97
|
+
ed.onInit.add(function(ed) {
|
85
98
|
ed.pasteAsPlainText = true;
|
86
99
|
});
|
87
100
|
}
|
@@ -110,5 +123,4 @@ $(document).ready(function() {
|
|
110
123
|
}();
|
111
124
|
|
112
125
|
|
113
|
-
|
114
126
|
});
|
@@ -40,4 +40,7 @@ input[type="submit"]:active {
|
|
40
40
|
-moz-box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee;
|
41
41
|
-webkit-box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee;
|
42
42
|
box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee;
|
43
|
-
}
|
43
|
+
}
|
44
|
+
input[disabled="disabled"] {
|
45
|
+
opacity: 0.7 !important;
|
46
|
+
}
|
@@ -68,7 +68,7 @@ module Rostra
|
|
68
68
|
# Creates a list of tags linking to the index showing only questions with that tag
|
69
69
|
#
|
70
70
|
def tag_list(question)
|
71
|
-
tags = question.tags.map { |tag| link_to tag, questions_path(:tag_search => "#{tag}")}.join
|
71
|
+
tags = question.tags.map { |tag| link_to tag, questions_path(:tag_search => "#{tag}")}.join(', ')
|
72
72
|
content_tag :div, "Tags: #{tags}".html_safe, class: 'tags'
|
73
73
|
end
|
74
74
|
|
data/app/models/comment.rb
CHANGED
@@ -4,13 +4,13 @@ class Comment < ActiveRecord::Base
|
|
4
4
|
include Rostra::EmailNotifier
|
5
5
|
include Rostra::TimestampObserver
|
6
6
|
|
7
|
-
belongs_to :commentable, :
|
7
|
+
belongs_to :commentable, polymorphic: true
|
8
8
|
belongs_to :user
|
9
9
|
|
10
|
-
validates :comment, :
|
10
|
+
validates :comment, presence: true, uniqueness: true
|
11
11
|
validates_presence_of :user_id, :commentable_type, :commentable_id
|
12
12
|
|
13
|
-
default_scope :
|
13
|
+
default_scope order: 'created_at ASC'
|
14
14
|
|
15
15
|
def question
|
16
16
|
commentable.question if commentable.is_a?(Rostra::Answer)
|
data/app/models/rostra/answer.rb
CHANGED
@@ -62,7 +62,7 @@
|
|
62
62
|
<%= f.hidden_field :user_id, value: rostra_user.id %>
|
63
63
|
<%= f.hidden_field :commentable_id, value: answer.id %>
|
64
64
|
<%= f.hidden_field :commentable_type, value: "Rostra::Answer" %>
|
65
|
-
<%= f.input :comment, label:
|
65
|
+
<%= f.input :comment, label: false %>
|
66
66
|
<%= f.submit 'post comment' %>
|
67
67
|
<%= link_to 'cancel', '#', class: 'cancel' %>
|
68
68
|
<% end %>
|
@@ -54,7 +54,7 @@ module Rostra
|
|
54
54
|
# Creates a list of tags linking to the index showing only questions with that tag
|
55
55
|
#
|
56
56
|
# def tag_list(question)
|
57
|
-
# tags = question.tags.map { |tag| link_to tag, questions_path(:tag_search => "#{tag}")}.join
|
57
|
+
# tags = question.tags.map { |tag| link_to tag, questions_path(:tag_search => "#{tag}")}.join(', ')
|
58
58
|
# content_tag :div, "Tags: #{tags}".html_safe, class: 'tags'
|
59
59
|
# end
|
60
60
|
|
data/lib/rostra/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rostra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.26
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Cory Schires
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-11-
|
13
|
+
date: 2011-11-23 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|