diff --git a/lib/software_communities_plugin.rb b/lib/software_communities_plugin.rb index e0c7388..4a5e168 100644 --- a/lib/software_communities_plugin.rb +++ b/lib/software_communities_plugin.rb @@ -128,6 +128,7 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin views/complete-registration.js views/search-software-catalog.js views/profile-tabs-software.js + views/new-community.js blocks/software-download.js initializer.js app.js diff --git a/public/initializer.js b/public/initializer.js index 138e2e6..d2a753d 100644 --- a/public/initializer.js +++ b/public/initializer.js @@ -10,7 +10,8 @@ 'CompleteRegistration', 'SearchSoftwareCatalog', 'SoftwareDownload', - 'ProfileTabsSoftware' + 'ProfileTabsSoftware', + 'NewCommunity' ]; diff --git a/public/views/new-community.js b/public/views/new-community.js new file mode 100644 index 0000000..9aae676 --- /dev/null +++ b/public/views/new-community.js @@ -0,0 +1,18 @@ +modulejs.define("NewCommunity", ['jquery'], function($){ + + function replace_mandatory_message(){ + $(".required-field").first() + .replaceWith(" Os campos em destaque são obrigatórios. "); + } + + return { + + isCurrentPage: function() { + return true; + }, + + init: function() { + replace_mandatory_message(); + } + } +}) diff --git a/public/views/new-software.js b/public/views/new-software.js index b497836..180ff70 100644 --- a/public/views/new-software.js +++ b/public/views/new-software.js @@ -1,4 +1,4 @@ -modulejs.define('NewSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete'], function($, NoosferoRoot, AutoComplete) { +modulejs.define('NewSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete', 'NewCommunity'], function($, NoosferoRoot, AutoComplete, Community) { 'use strict'; var AJAX_URL = { @@ -61,6 +61,7 @@ modulejs.define('NewSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete'], funct init: function() { license_info_autocomplete(); + Community.init(); $("#community_name_id").blur(replace_domain_and_repository_link); } diff --git a/views/blocks/repository.html.erb b/views/blocks/repository.html.erb index 3d7cd58..dd9817d 100644 --- a/views/blocks/repository.html.erb +++ b/views/blocks/repository.html.erb @@ -2,4 +2,4 @@ <%= _("This community needs a software to use this block") %> <% else %> <%= link_to _("Repository") , block.owner.software_info.repository_link, :id => "bt_repositorio", :target => "_blank" %> -<% end %> \ No newline at end of file +<% end %> -- libgit2 0.21.2