diff --git a/vendor/gems/discourse_task/Gemfile b/vendor/gems/discourse_task/Gemfile deleted file mode 100644 index fcb7fdc2990..00000000000 --- a/vendor/gems/discourse_task/Gemfile +++ /dev/null @@ -1,13 +0,0 @@ -source 'https://rubygems.org' - -group :test do - gem 'rails' - gem 'rspec' - gem 'mocha' -end - -# TODO: We need our own gem server -gem 'discourse_plugin', path: '../discourse_plugin' - -# Specify your gem's dependencies in rails_multisite.gemspec -gemspec diff --git a/vendor/gems/discourse_task/Gemfile.lock b/vendor/gems/discourse_task/Gemfile.lock deleted file mode 100644 index 7c7324ecc75..00000000000 --- a/vendor/gems/discourse_task/Gemfile.lock +++ /dev/null @@ -1,111 +0,0 @@ -PATH - remote: . - specs: - discourse_task (0.0.1) - -PATH - remote: ../discourse_plugin - specs: - discourse_plugin (0.0.1) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (3.2.8) - actionpack (= 3.2.8) - mail (~> 2.4.4) - actionpack (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.8) - activesupport (= 3.2.8) - builder (~> 3.0.0) - activerecord (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - activesupport (3.2.8) - i18n (~> 0.6) - multi_json (~> 1.0) - arel (3.0.2) - builder (3.0.3) - diff-lcs (1.1.3) - erubis (2.7.0) - hike (1.2.1) - i18n (0.6.1) - journey (1.0.4) - json (1.7.5) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - metaclass (0.0.1) - mime-types (1.19) - mocha (0.12.7) - metaclass (~> 0.0.1) - multi_json (1.3.6) - polyglot (0.3.3) - rack (1.4.1) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.2) - rack - rack-test (0.6.2) - rack (>= 1.0) - rails (3.2.8) - actionmailer (= 3.2.8) - actionpack (= 3.2.8) - activerecord (= 3.2.8) - activeresource (= 3.2.8) - activesupport (= 3.2.8) - bundler (~> 1.0) - railties (= 3.2.8) - railties (3.2.8) - actionpack (= 3.2.8) - activesupport (= 3.2.8) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - rspec (2.11.0) - rspec-core (~> 2.11.0) - rspec-expectations (~> 2.11.0) - rspec-mocks (~> 2.11.0) - rspec-core (2.11.1) - rspec-expectations (2.11.3) - diff-lcs (~> 1.1.3) - rspec-mocks (2.11.3) - sprockets (2.1.3) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - thor (0.16.0) - tilt (1.3.3) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.33) - -PLATFORMS - ruby - -DEPENDENCIES - discourse_plugin! - discourse_task! - mocha - rails - rspec diff --git a/vendor/gems/discourse_task/LICENSE b/vendor/gems/discourse_task/LICENSE deleted file mode 100644 index 1561959f642..00000000000 --- a/vendor/gems/discourse_task/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Robin Ward - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/gems/discourse_task/README.md b/vendor/gems/discourse_task/README.md deleted file mode 100644 index 287c39407f0..00000000000 --- a/vendor/gems/discourse_task/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Discourse Task Gem - -Add support for a topic that can be marked as "Closed." diff --git a/vendor/gems/discourse_task/Rakefile b/vendor/gems/discourse_task/Rakefile deleted file mode 100644 index 56bb7292a1e..00000000000 --- a/vendor/gems/discourse_task/Rakefile +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env rake -require "bundler/gem_tasks" -require "rspec/core/rake_task" - -RSpec::Core::RakeTask.new(:test) do |spec| - spec.pattern = 'spec/*_spec.rb' -end diff --git a/vendor/gems/discourse_task/config/routes.rb b/vendor/gems/discourse_task/config/routes.rb deleted file mode 100644 index 35ef1b2c3ee..00000000000 --- a/vendor/gems/discourse_task/config/routes.rb +++ /dev/null @@ -1,5 +0,0 @@ -Rails.application.routes.draw do - - put 't/:slug/:topic_id/complete' => 'topics#complete', :constraints => {:topic_id => /\d+/} - -end diff --git a/vendor/gems/discourse_task/discourse_task.gemspec b/vendor/gems/discourse_task/discourse_task.gemspec deleted file mode 100644 index a837093c424..00000000000 --- a/vendor/gems/discourse_task/discourse_task.gemspec +++ /dev/null @@ -1,19 +0,0 @@ -# -*- encoding: utf-8 -*- -require File.expand_path('../lib/discourse_task/version', __FILE__) - -Gem::Specification.new do |gem| - gem.authors = ["Robin Ward"] - gem.email = ["robin.ward@gmail.com"] - gem.description = %q{This gem add a Task archetype to discourse that can be closed} - gem.summary = %q{This gem add a Task archetype to discourse that can be closed} - gem.homepage = "" - - # when this is extracted comment it back in, prd has no .git - gem.files = Dir['README*','LICENSE','lib/**/*.rb'] - - gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) - gem.name = "discourse_task" - gem.require_paths = ["lib"] - gem.version = DiscourseTask::VERSION -end diff --git a/vendor/gems/discourse_task/lib/discourse_task.rb b/vendor/gems/discourse_task/lib/discourse_task.rb deleted file mode 100644 index 259afff9a37..00000000000 --- a/vendor/gems/discourse_task/lib/discourse_task.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'discourse_task/version' -require 'discourse_task/engine' if defined?(Rails) && (!Rails.env.test?) - -I18n.load_path << "#{File.dirname(__FILE__)}/discourse_task/locale/en.yml" \ No newline at end of file diff --git a/vendor/gems/discourse_task/lib/discourse_task/engine.rb b/vendor/gems/discourse_task/lib/discourse_task/engine.rb deleted file mode 100644 index 7a3daaea25c..00000000000 --- a/vendor/gems/discourse_task/lib/discourse_task/engine.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'discourse_task/plugin' - -module DiscourseTask - class Engine < Rails::Engine - - engine_name 'discourse_task' - - initializer "discourse_task.configure_rails_initialization" do |app| - - app.config.after_initialize do - DiscoursePluginRegistry.setup(DiscourseTask::Plugin) - end - - app.config.to_prepare do - DiscourseTask::Plugin.include_mixins - end - end - - end -end diff --git a/vendor/gems/discourse_task/lib/discourse_task/locale/en.yml b/vendor/gems/discourse_task/lib/discourse_task/locale/en.yml deleted file mode 100644 index c12113f1951..00000000000 --- a/vendor/gems/discourse_task/lib/discourse_task/locale/en.yml +++ /dev/null @@ -1,21 +0,0 @@ -en: - archetypes: - task: - title: "Task" - - task: - completed: "This task has been marked as complete." - reversed: "This task has been re-opened." - - js: - topic_statuses: - task: - help: "this topic is a task" - - task: - title: "Task" - description: "This topic can be marked as complete by its creator or a moderator." - complete_action: "Complete Task" - complete_help: "mark this task as complete" - complete: "This task was marked as complete on {{completed_at}}." - reverse: "Undo Complete" diff --git a/vendor/gems/discourse_task/lib/discourse_task/plugin.rb b/vendor/gems/discourse_task/lib/discourse_task/plugin.rb deleted file mode 100644 index 79e9bc3dadf..00000000000 --- a/vendor/gems/discourse_task/lib/discourse_task/plugin.rb +++ /dev/null @@ -1,92 +0,0 @@ -require 'discourse_plugin' - -module DiscourseTask - - class Plugin < DiscoursePlugin - - def self.archetype - 'task' - end - - def setup - # Add our Assets - register_js('discourse_task') - register_css('discourse_task') - - # Add the archetype - register_archetype(DiscourseTask::Plugin.archetype) - - end - - module TopicViewSerializerMixin - def self.included(base) - base.attributes :can_complete_task, :complete, :completed_at - end - - def can_complete_task - scope.can_complete_task?(object.topic) - end - - def complete - object.topic.has_meta_data_boolean?(:complete) - end - - def completed_at - dt = Date.parse(object.topic.meta_data_string(:completed_at)).strftime("%d %b, %Y") - end - def include_completed_at? - object.topic.meta_data_string(:completed_at).present? - end - - end - - module GuardianMixin - - # We need to be able to determine if a user can complete a task - def can_complete_task?(topic) - return false if @user.blank? - return false if topic.blank? - return false unless topic.archetype == DiscourseTask::Plugin.archetype - return true if @user.moderator? - return true if @user.admin? - - # The OP can complete the topic - return @user == topic.user - end - - end - - module TopicsControllerMixin - - def complete - topic = Topic.find_by(id: params[:topic_id]) - guardian.ensure_can_complete_task!(topic) - - Topic.transaction do - if params[:complete] == 'true' - topic.update_meta_data(complete: true, completed_at: Time.now) - topic.add_moderator_post(current_user, I18n.t(:'task.completed')) - else - topic.update_meta_data(complete: false) - topic.add_moderator_post(current_user, I18n.t(:'task.reversed')) - end - end - - render nothing: true - end - - end - - module TopicListItemSerializerMixin - def self.included(base) - base.attributes :complete - end - - def complete - object.has_meta_data_boolean?(:complete) - end - end - - end - -end diff --git a/vendor/gems/discourse_task/lib/discourse_task/version.rb b/vendor/gems/discourse_task/lib/discourse_task/version.rb deleted file mode 100644 index d60d3ac4fa9..00000000000 --- a/vendor/gems/discourse_task/lib/discourse_task/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module DiscourseTask - VERSION = "0.0.1" -end diff --git a/vendor/gems/discourse_task/spec/plugin_spec.rb b/vendor/gems/discourse_task/spec/plugin_spec.rb deleted file mode 100644 index 1e06099dcf8..00000000000 --- a/vendor/gems/discourse_task/spec/plugin_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'spec_helper' -require 'discourse_task/plugin' - -describe DiscourseTask::Plugin do - - let(:registry) { stub_everything } - let(:plugin) { DiscourseTask::Plugin.new(registry) } - - context '.setup' do - - it 'registers its js' do - plugin.expects(:register_js).with('discourse_task') - plugin.setup - end - - it 'registers its css' do - plugin.expects(:register_css).with('discourse_task') - plugin.setup - end - - it 'registers a task archetype' do - plugin.expects(:register_archetype).with('task') - plugin.setup - end - - end - -end diff --git a/vendor/gems/discourse_task/spec/spec_helper.rb b/vendor/gems/discourse_task/spec/spec_helper.rb deleted file mode 100644 index aaa32597f1f..00000000000 --- a/vendor/gems/discourse_task/spec/spec_helper.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' -require 'rails' - -ENV["RAILS_ENV"] ||= 'test' - -RSpec.configure do |config| - - config.mock_framework = :mocha - config.color_enabled = true - -end - - diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task.js b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task.js deleted file mode 100644 index 565bbd39256..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task.js +++ /dev/null @@ -1 +0,0 @@ -//= require_tree ./discourse_task \ No newline at end of file diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/controllers/topic_controller.js b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/controllers/topic_controller.js deleted file mode 100644 index db588d4a22b..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/controllers/topic_controller.js +++ /dev/null @@ -1,15 +0,0 @@ -(function() { - - Discourse.TopicController.reopen({ - - // Allow the user to complete the task - completeTask: function(e) { - this.get('content').toggleComplete(); - return false; - } - - }) - -}).call(this); - - diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/models/topic.js b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/models/topic.js deleted file mode 100644 index dff6da490ac..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/models/topic.js +++ /dev/null @@ -1,23 +0,0 @@ -(function() { - - Discourse.Topic.reopen({ - - // Allow the user to complete the task - toggleComplete: function() { - this.toggleProperty('complete'); - this.set('completed_at', moment().format("d Mon, yyyy")); - - jQuery.ajax(this.get('url') + "/complete", { - type: 'PUT', - data: { - complete: this.get('complete') ? 'true' : 'false' - } - - }); - } - - }) - -}).call(this); - - diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/templates/about_task.js.handlebars b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/templates/about_task.js.handlebars deleted file mode 100644 index 7a702dc321f..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/templates/about_task.js.handlebars +++ /dev/null @@ -1,15 +0,0 @@ -
{{{i18n task.description}}}
- -{{#if controller.content.complete}} -{{i18n task.complete completed_at="controller.content.completed_at"}}
- - {{#if controller.content.can_complete_task}} - - {{/if}} -{{else}} - {{#if controller.content.can_complete_task}} - - {{/if}} -{{/if}} - diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_footer_buttons_view.js b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_footer_buttons_view.js deleted file mode 100644 index f282fdd9dbf..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_footer_buttons_view.js +++ /dev/null @@ -1,40 +0,0 @@ -(function() { - - Discourse.TopicFooterButtonsView.prototype.on("additionalButtons", function(childViews) { - var topic = this.get('topic'); - if (topic.get('archetype') == 'task' && topic.get('can_complete_task')) { - - // If we can complete the task: - childViews.addObject(Discourse.ButtonView.createWithMixins({ - - completeBinding: 'controller.content.complete', - - completeChanged: function () { - this.rerender(); - }.observes('complete'), - - renderIcon: function (buffer) { - if (!this.get('complete')) { - buffer.push("") - } - }, - - text: function () { - if (this.get('complete')) { - return I18n.t("task.reverse"); - } else { - return I18n.t("task.complete_action"); - } - }.property('complete'), - - click: function(e) { - this.get('controller').completeTask(); - } - })); - - } - }); - -}).call(this); - - diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_status_view.js b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_status_view.js deleted file mode 100644 index 47e7daf7feb..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_status_view.js +++ /dev/null @@ -1,21 +0,0 @@ -(function() { - - Discourse.TopicStatusView.prototype.on("addCustomIcon", function(buffer) { - - // Add icon for closed tasks - var topic = this.get('topic'); - if (topic.get('archetype') === 'task') { - var icon = 'cog'; - if (topic.get('complete')) icon = 'ok'; - this.renderIcon(buffer, icon, 'task'); - } - - }); - - Discourse.TopicStatusView.reopen({ - taskComplete: function() { - this.rerender(); - }.observes('topic.complete') - }) - -}).call(this); diff --git a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_summary_view.js b/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_summary_view.js deleted file mode 100644 index 27f5ecb44ef..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/javascripts/discourse_task/views/topic_summary_view.js +++ /dev/null @@ -1,14 +0,0 @@ -(function() { - - Discourse.TopicSummaryView.prototype.on("appendSummaryInformation", function(childViews) { - // Add the poll information - if (this.get('topic.archetype') === 'task') { - childViews.pushObject(Discourse.View.create({ - tagName: 'section', - classNames: ['information'], - templateName: 'discourse_task/templates/about_task' - })); - } - }); - -}).call(this); diff --git a/vendor/gems/discourse_task/vendor/assets/stylesheets/discourse_task.css.sass b/vendor/gems/discourse_task/vendor/assets/stylesheets/discourse_task.css.sass deleted file mode 100644 index 63848297d92..00000000000 --- a/vendor/gems/discourse_task/vendor/assets/stylesheets/discourse_task.css.sass +++ /dev/null @@ -1,15 +0,0 @@ -.complete-topic - background-color: #eee - padding: 5px - margin-bottom: 5px - font-size: 13px - clear: both - height: 30px - border-radius: 5px - - p - float: left - padding: 5px 0 0 3px - - button - float: right