rostra 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,8 +32,13 @@ $(document).ready(function() {
32
32
 
33
33
 
34
34
  var closeable_flash_messages = function() {
35
- $('.flash a.close').click(function() {
36
- $(this).parent().fadeOut();
35
+ $('.flash a.closeable').click(function() {
36
+ var flash = $(this).parent();
37
+ flash.animate({'opacity': 0}, 250, function() {
38
+ flash.slideUp(250, function() {
39
+ flash.css('opacity', 1)
40
+ });
41
+ })
37
42
  return false;
38
43
  });
39
44
  }();
@@ -3,7 +3,7 @@
3
3
  padding: 7px 7px 5px 7px;
4
4
  margin: 10px 0 10px;
5
5
  }
6
- .flash a.close {
6
+ .flash a.closeable {
7
7
  float: right;
8
8
  }
9
9
  #flash_notice {
@@ -12,7 +12,7 @@ module Rostra
12
12
  end
13
13
 
14
14
  def index
15
- if params[:tag_search]
15
+ if params[:tag_search].present?
16
16
  @questions = Question.tagged_with(params[:tag_search]).order('created_at desc')
17
17
  else
18
18
  @questions = Question.order('created_at desc')
@@ -39,14 +39,15 @@ module Rostra
39
39
  # 2. Uses the users email address to look for a gravatar
40
40
  # 3. Renders <tt>app/assets/images/rostra/anonymous_avatar.png</tt>
41
41
  #
42
- def avatar_url(user)
42
+ def rostra_user_avatar(user)
43
43
  if user.respond_to?(:avatar)
44
- user.avatar
44
+ url = user.avatar
45
45
  else
46
46
  default_url = "#{main_app.root_url}assets/rostra/anonymous_avatar.png"
47
47
  gravatar_id = Digest::MD5.hexdigest(user.rostra_user_email.downcase)
48
- "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
48
+ url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
49
49
  end
50
+ image_tag(url, class: 'avatar')
50
51
  end
51
52
 
52
53
  # Method to build links for ajax-y voting arrows.
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
  </div>
27
27
 
28
- <%= image_tag avatar_url(question.user), class: 'avatar' %>
28
+ <%= rostra_user_avatar(question.user) %>
29
29
 
30
30
  <h3 class="title"><%= link_to question.title, question %></h3>
31
31
  <cite>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <div class="question" id="<%= dom_id(@question) %>">
6
6
  <%= render partial: 'rostra/shared/votes', locals: { resource: @question } %>
7
- <%= image_tag avatar_url(@question.user), class: 'avatar' %>
7
+ <%= rostra_user_avatar(@question.user) %>
8
8
  <cite>
9
9
  Asked by <%= link_to_profile(@question.user) %>
10
10
  <%= link_to 'edit', edit_question_path(@question) if can? :manage, @question %>
@@ -22,7 +22,7 @@
22
22
  <% @answers.each do |answer| %>
23
23
  <div class="answer" id="<%= dom_id(answer) %>">
24
24
  <%= render partial: 'rostra/shared/votes', locals: { resource: answer } %>
25
- <%= image_tag avatar_url(answer.user), class: 'avatar' %>
25
+ <%= rostra_user_avatar(answer.user) %>
26
26
  <cite>
27
27
  <%= link_to_profile(answer.user) %> says:
28
28
  <%= link_to('edit', edit_question_answer_path(@question, answer)) if can? :manage, answer %>
@@ -7,13 +7,13 @@
7
7
  <% unless user_signed_in? %>
8
8
  <div class="hidden flash" id="flash_notice">
9
9
  You must <%= link_to 'login', main_app_login_path %> or <%= link_to 'signup', main_app_signup_path %> in order to vote
10
- <%= link_to 'close', '#', class: 'close' %>
10
+ <%= link_to 'X', '#', class: 'closeable' %>
11
11
  </div>
12
12
  <% end %>
13
13
 
14
14
  <% if can? :manage, resource %>
15
15
  <div class="hidden flash" id="flash_notice">
16
16
  You cannot vote on your own <%= class_name(resource) %>
17
- <%= link_to 'close', '#', class: 'close' %>
17
+ <%= link_to 'X', '#', class: 'closeable' %>
18
18
  </div>
19
19
  <% end %>
@@ -26,14 +26,15 @@ module Rostra
26
26
  # 2. Uses the users email address to look for a gravatar
27
27
  # 3. Renders <tt>app/assets/images/rostra/anonymous_avatar.png</tt>
28
28
  #
29
- # def avatar_url(user)
29
+ # def rostra_user_avatar(user)
30
30
  # if user.respond_to?(:avatar)
31
- # user.avatar
31
+ # url = user.avatar
32
32
  # else
33
33
  # default_url = "#{main_app.root_url}assets/rostra/anonymous_avatar.png"
34
34
  # gravatar_id = Digest::MD5.hexdigest(user.rostra_user_email.downcase)
35
- # "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
35
+ # url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
36
36
  # end
37
+ # image_tag(url, class: 'avatar')
37
38
  # end
38
39
 
39
40
  # Used to populate both the <tt>title</tt> and <tt>h1</tt> elements for each page.
@@ -1,3 +1,3 @@
1
1
  module Rostra
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rostra
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.12
5
+ version: 0.0.13
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cory Schires