muck-raker 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -68,44 +68,10 @@ begin
68
68
  gemspec.add_dependency "muck-users"
69
69
  gemspec.add_dependency "muck-comments"
70
70
  gemspec.add_dependency "muck-solr"
71
- gemspec.files.include %w( tasks/*
72
- db/bootstrap/*.yml
73
- db/migrate/*.rb
74
- app/**/**/**/*
75
- config/*
76
- locales/*
77
- rails/*
78
- test/*
79
- lib/**/*
80
- raker/**/*
81
- public/javascripts/* )
82
71
  end
83
- rescue LoadError
84
- puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
85
- end
86
- # rubyforge tasks
87
- begin
88
- require 'rake/contrib/sshpublisher'
89
- namespace :rubyforge do
90
-
91
- desc "Release gem and RDoc documentation to RubyForge"
92
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
93
-
94
- namespace :release do
95
- desc "Publish RDoc to RubyForge."
96
- task :docs => [:rdoc] do
97
- config = YAML.load(
98
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
99
- )
100
-
101
- host = "#{config['username']}@rubyforge.org"
102
- remote_dir = "/var/www/gforge-projects/muck-raker/"
103
- local_dir = 'rdoc'
104
-
105
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
106
- end
107
- end
72
+ Jeweler::RubyforgeTasks.new do |rubyforge|
73
+ rubyforge.doc_task = "rdoc"
108
74
  end
109
75
  rescue LoadError
110
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
76
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
111
77
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.22
1
+ 0.1.23
@@ -77,7 +77,7 @@ module MuckRakerHelper
77
77
  end
78
78
 
79
79
  def already_shared_entry?(user, entry)
80
- user.shares.find(:all, :conditions => ['entry_id = ?', entry.id])
80
+ user.shares.find(:all, :conditions => ['entry_id = ?', entry.id]).length > 0
81
81
  end
82
82
 
83
83
  end
@@ -1,5 +1,6 @@
1
1
  <div id="toolbar">
2
2
  <div id="profile" class="section">
3
+
3
4
  </div>
4
5
  <div id="close" class="section">
5
6
  <a id="close_frame" title="Remove frame and go to this web address." class="url_fragment" href="<%= @resource_uri %>"> </a>
@@ -14,14 +15,12 @@
14
15
  <div id="tools" class="section">
15
16
  <%#= link_to t('muck.raker.remix'), new_content_path(@entry), :id => 'share' - copy the page into the content system %>
16
17
  <%#= link_to t('muck.raker.save'), new_content_path(@entry), :id => 'share' - save the content for use later on %>
17
- <% if GlobalConfig.enable_raker_shares -%>
18
- <% if logged_in? -%>
19
- <%= link_to t('muck.raker.share'), new_user_share_path(current_user, :title => @entry.title, :uri => @resource_uri), :id => 'share' %>
20
- <% else -%>
21
- <%= link_to t('muck.raker.login_to_prompt'), login_path, :id => 'login' %>
22
- <% end -%>
18
+ <% if logged_in? -%>
19
+ <%= link_to t('muck.raker.share'), new_user_share_path(current_user, :title => @entry.title, :uri => @resource_uri), :id => 'share' if GlobalConfig.enable_raker_shares -%>
20
+ <% else -%>
21
+ <span id="share_login"><%= t('muck.raker.login_or_signup_prompt', :signup => link_to(t('muck.raker.signup'), signup_path, :id => 'signup'), :login => link_to(t('muck.raker.login'), login_path, :id => 'login') ) %></span>
23
22
  <% end -%>
24
- <%= link_to t('muck.raker.comment_entries_count', :count => @entry.comment_count), entry_comments_path(@entry), :id => 'comment' if GlobalConfig.enable_raker_comments %>
23
+ <%= link_to t('muck.raker.comment_entries_count', :count => @entry.comment_count), entry_comments_path(@entry), :id => 'comment' if GlobalConfig.enable_raker_comments -%>
25
24
  </div>
26
25
  </div>
27
26
 
@@ -52,7 +51,7 @@
52
51
  <div id="shares_control">
53
52
  <h2><%= t('muck.shares.share_title') %></h2>
54
53
  <% if logged_in? -%>
55
- <% if already_shared?(current_user, @resource_uri)-%>
54
+ <% if already_shared_entry?(current_user, @entry) -%>
56
55
  <%= t('muck.raker.already_shared') %>
57
56
  <% end -%>
58
57
  <%= output_errors(t('muck.shares.problem_adding_share'), {:class => 'help-box'}, @share) %>
@@ -70,16 +69,15 @@
70
69
  <div id="frame_content" class="framed_content">
71
70
  <iframe id="content_iframe" class="framed_content" name="iframe" src="<%= @resource_uri %>" frameborder="0" scrolling="auto" noresize="noresize"></iframe>
72
71
  </div>
73
-
74
72
  <% content_for :head do -%>
75
73
  <%= javascript_tag %[var COMMENT_PROMPT = '#{t('muck.raker.write_comment_prompt')}';] %>
76
74
  <%= javascript_tag %[var ADD_COMMENT_MESSAGE = '#{t('muck.raker.adding_comment_message')}';] %>
77
75
  <%= javascript_tag %[var ADD_SHARE_MESSAGE = '#{t('muck.shares.adding_share')}';] %>
76
+ <%= javascript_include_tag 'muck_raker.js' %>
78
77
  <% end -%>
79
-
80
- <%# content_for :javascript do -%>
81
- <script type="text/javascript" language="JavaScript">
78
+ <% content_for :javascript do -%>
82
79
  jQuery(document).ready(function() {
80
+ <%= "show_tool('comments');" if params[:show_comments] || @entry.comment_count > 0 -%>
83
81
  jQuery(window).bind('resize', function() {
84
82
  maximize_space();
85
83
  });
@@ -96,61 +94,6 @@
96
94
  });
97
95
  setup_comment_submit();
98
96
  setup_share_submit();
97
+ apply_frame_comment_hover();
99
98
  });
100
- function show_tool(tool) {
101
- jQuery('.tool').hide();
102
- jQuery("#content_iframe").width('75%');
103
- jQuery('#' + tool + '_tool').show();
104
- maximize_space();
105
- return false;
106
- }
107
- function maximize_space() {
108
- var container = jQuery(".tools_container");
109
- var spacer = jQuery('#comments_tools_close_wrapper').height() + 5;
110
- container.height(jQuery(window).height() - (jQuery('#toolbar').height() + spacer));
111
- }
112
- function setup_comment_submit(){
113
- jQuery(".comment-submit").click(function() {
114
- jQuery(this).siblings('textarea').hide();
115
- jQuery(this).parent().append('<p class="comment-loading"><img src="/images/spinner.gif" alt="loading..." /> ' + ADD_COMMENT_MESSAGE + '</p>');
116
- var form = jQuery(this).parents('form');
117
- jQuery.post(form.attr('action'), form.serialize() + '&format=json',
118
- function(data){
119
- var json = eval('(' + data + ')');
120
- if(!json.success){
121
- jQuery.jGrowl.info(json.message);
122
- } else {
123
- jQuery('.comment-loading').remove();
124
- jQuery('#comments_tool').find('textarea').show();
125
- jQuery('#comments_tool').find('textarea').val('');
126
- jQuery("#comments_container").animate({ scrollTop: jQuery("#comments_container").attr("scrollHeight") }, 3000);
127
- var contents = jQuery(json.html)
128
- contents.hide();
129
- jQuery('#comments_wrapper').append(contents);
130
- contents.fadeIn("slow");
131
- }
132
- });
133
- return false;
134
- });
135
- }
136
- function setup_share_submit(){
137
- jQuery('#share_submit_share_new').click(function() {
138
- jQuery(this).parent().append('<p class="share-loading"><img src="/images/spinner.gif" alt="loading..." /> ' + ADD_SHARE_MESSAGE + '</p>');
139
- jQuery('#share_submit_share_new').hide();
140
- var form = jQuery(this).parents('form');
141
- jQuery.post(form.attr('action'), form.serialize() + '&format=json',
142
- function(data){
143
- var json = eval('(' + data + ')');
144
- jQuery('.share-loading').remove();
145
- jQuery('#share_submit_share_new').show();
146
- if(!json.success){
147
- jQuery.jGrowl.info(json.message);
148
- } else {
149
- jQuery.jGrowl.info(json.message);
150
- }
151
- });
152
- return false;
153
- });
154
- }
155
- </script>
156
- <%# end -%>
99
+ <% end -%>
@@ -65,6 +65,7 @@ module MuckRaker
65
65
  task :sync do
66
66
  path = File.join(File.dirname(__FILE__), *%w[.. ..])
67
67
  system "rsync -ruv #{path}/db ."
68
+ system "rsync -ruv #{path}/public ."
68
69
  system "rsync -ruv #{path}/config/solr ./config"
69
70
  end
70
71
 
data/locales/en.yml CHANGED
@@ -97,7 +97,9 @@ en:
97
97
  write_comment_prompt: "Add a comment"
98
98
  adding_comment_message: "Adding comment"
99
99
  login_to_comment: "Login to add a comment"
100
- login_to_prompt: "Login to comment and share resources."
100
+ login_or_signup_prompt: "{{signup}} or {{login}} to discuss and share resources."
101
+ login: "Login"
102
+ signup: "Sign Up"
101
103
  already_shared: "You've previously shared this page."
102
104
  comment_entries_count:
103
105
  one: "1 Comment"