[Git][noosfero/noosfero][master] 2 commits: update schema
Rodrigo Souto
gitlab at mg.gitlab.com
Tue Feb 23 15:41:28 BRT 2016
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
16181ed0 by Rodrigo Souto at 2016-02-23T13:24:24-03:00
update schema
- - - - -
4c6bcb89 by Fabio Teixeira at 2016-02-23T15:39:08-03:00
Fix rails 4 organization_ratings bugs
Signed-off-by: Álvaro Fernando <alvarofernandoms at gmail.com>
Signed-off-by: Fabio Teixeira <fabio1079 at gmail.com>
- - - - -
8 changed files:
- db/schema.rb
- features/manage_users.feature
- features/step_definitions/custom_web_steps.rb
- plugins/organization_ratings/features/rate_community.feature
- + plugins/organization_ratings/features/vote_once_disable_cooldown.feature
- plugins/organization_ratings/lib/organization_ratings_plugin.rb
- plugins/organization_ratings/public/organization_rating_management.js
- plugins/organization_ratings/public/style.css
Changes:
=====================================
db/schema.rb
=====================================
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -55,6 +55,8 @@ ActiveRecord::Schema.define(version: 20160202142247) do
t.integer "person_id"
t.integer "article_id"
t.datetime "since"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
add_index "article_followers", ["article_id"], name: "index_article_followers_on_article_id", using: :btree
=====================================
features/manage_users.feature
=====================================
--- a/features/manage_users.feature
+++ b/features/manage_users.feature
@@ -15,7 +15,7 @@ Background:
Scenario: deactive user
Given I follow "Deactivate user" within "tr[title='Joao Silva']"
When I confirm the browser dialog
- Then the "tr[title='Joao Silva'] td.actions a.icon-activate-user" button should be enabled
+ Then the field "tr[title='Joao Silva'] td.actions a.icon-activate-user" should be enabled
@selenium
Scenario: activate user
@@ -23,7 +23,7 @@ Background:
And I confirm the browser dialog
And I follow "Activate user" within "tr[title='Paulo Santos']"
When I confirm the browser dialog
- Then the "tr[title='Paulo Santos'] td.actions a.icon-deactivate-user" button should be enabled
+ Then the field "tr[title='Paulo Santos'] td.actions a.icon-deactivate-user" should be enabled
@selenium
Scenario: remove user
@@ -36,7 +36,7 @@ Background:
Scenario: admin user
Given I follow "Set admin role" within "tr[title='Joao Silva']"
When I confirm the browser dialog
- Then the "tr[title='Joao Silva'] td.actions a.icon-reset-admin-role" button should be enabled
+ Then the field "tr[title='Joao Silva'] td.actions a.icon-reset-admin-role" should be enabled
@selenium
Scenario: unadmin user
@@ -44,4 +44,4 @@ Background:
And I confirm the browser dialog
And I follow "Reset admin role" within "tr[title='Paulo Santos']"
When I confirm the browser dialog
- Then the "tr[title='Paulo Santos'] td.actions a.icon-set-admin-role" button should be enabled
+ Then the field "tr[title='Paulo Santos'] td.actions a.icon-set-admin-role" should be enabled
=====================================
features/step_definitions/custom_web_steps.rb
=====================================
--- a/features/step_definitions/custom_web_steps.rb
+++ b/features/step_definitions/custom_web_steps.rb
@@ -18,14 +18,14 @@ When /^I should see "([^\"]+)" linking to "([^\"]+)"$/ do |text, href|
page.should have_xpath("//a[@href='#{href}']")
end
-Then /^the "([^"]*)" button should be disabled$/ do |selector|
- field = find(selector)
- field['disabled'].should be_truthy
-end
-
-Then /^the "([^"]*)" button should be enabled$/ do |selector|
- field = find(selector)
- field['disabled'].should_not be_truthy
+Then /^the field "([^"]*)" should be (enabled|disabled)$/ do |selector, status|
+ field = page.find(:css, selector)
+
+ if status == 'enabled'
+ field.disabled?.should_not be_truthy
+ else
+ field.disabled?.should be_truthy
+ end
end
When /^I reload and wait for the page$/ do
=====================================
plugins/organization_ratings/features/rate_community.feature
=====================================
--- a/plugins/organization_ratings/features/rate_community.feature
+++ b/plugins/organization_ratings/features/rate_community.feature
@@ -33,4 +33,4 @@ Feature: rate_community
Given I am on mycommunity's homepage
When I follow "Rate this Community"
Then I should see "Joao Silva" within ".star-profile-name"
- And I should see Joao Silva's profile image
\ No newline at end of file
+ And I should see Joao Silva's profile image
=====================================
plugins/organization_ratings/features/vote_once_disable_cooldown.feature
=====================================
--- /dev/null
+++ b/plugins/organization_ratings/features/vote_once_disable_cooldown.feature
@@ -0,0 +1,23 @@
+Feature: vote_once_disable_cooldown
+ As a admin
+ I want to disable the cooldown time when vote once is enabled
+ Making it clearly that there is no cooldown when vote once is enabled
+
+ Background:
+ Given plugin "OrganizationRatings" is enabled on environment
+ And I am logged in as admin
+ And I go to /admin/plugins
+ And I check "Organization Ratings"
+ And I press "Save changes"
+
+ @selenium
+ Scenario: disable or enable the cooldown field when vote on is checked or unchecked
+ Given I follow "Administration"
+ And I follow "Plugins"
+ And I follow "Configuration"
+ And the field "#organization_ratings_config_cooldown" should be enabled
+ And I check "Vote once"
+ And the field "#organization_ratings_config_cooldown" should be disabled
+ And I uncheck "Vote once"
+ Then the field "#organization_ratings_config_cooldown" should be enabled
+
=====================================
plugins/organization_ratings/lib/organization_ratings_plugin.rb
=====================================
--- a/plugins/organization_ratings/lib/organization_ratings_plugin.rb
+++ b/plugins/organization_ratings/lib/organization_ratings_plugin.rb
@@ -73,8 +73,8 @@ class OrganizationRatingsPlugin < Noosfero::Plugin
def js_files
%w(
- public/rate.js
- public/organization_rating_management.js
+ rate.js
+ organization_rating_management.js
)
end
=====================================
plugins/organization_ratings/public/organization_rating_management.js
=====================================
--- a/plugins/organization_ratings/public/organization_rating_management.js
+++ b/plugins/organization_ratings/public/organization_rating_management.js
@@ -9,8 +9,8 @@
cacheDom: function() {
- this.$vote_once_checkbox = $("#environment_organization_ratings_vote_once");
- this.$hours_timer_input = $("#environment_organization_ratings_cooldown");
+ this.$vote_once_checkbox = $("#organization_ratings_config_vote_once");
+ this.$hours_timer_input = $("#organization_ratings_config_cooldown");
},
@@ -21,10 +21,22 @@
verifyHoursTimerDisable: function() {
if (this.$vote_once_checkbox.is(":checked")) {
- this.$hours_timer_input.attr("disabled", "disabled");
+ //this.$hours_timer_input.attr("disabled", "disabled");
+ this.disableVoteOnce();
} else {
- this.$hours_timer_input.removeAttr("disabled");
+ //this.$hours_timer_input.removeAttr("disabled");
+ this.enableVoteOnce();
}
+ },
+
+
+ enableVoteOnce: function() {
+ this.$hours_timer_input.removeAttr("disabled");
+ },
+
+
+ disableVoteOnce: function() {
+ this.$hours_timer_input.attr("disabled", "disabled");
}
}
=====================================
plugins/organization_ratings/public/style.css
=====================================
--- a/plugins/organization_ratings/public/style.css
+++ b/plugins/organization_ratings/public/style.css
@@ -14,11 +14,11 @@
}
.star-negative {
- background-image: url('public/images/star-negative.png');
+ background-image: url('images/star-negative.png');
}
.star-positive {
- background-image: url('public/images/star-positive.png');
+ background-image: url('images/star-positive.png');
}
.small-star-negative, .small-star-positive {
@@ -31,11 +31,11 @@
}
.small-star-negative {
- background-image: url('public/images/small-star-negative.png');
+ background-image: url('images/small-star-negative.png');
}
.small-star-positive {
- background-image: url('public/images/small-star-positive.png');
+ background-image: url('images/small-star-positive.png');
}
.medium-star-negative, .medium-star-positive {
@@ -48,11 +48,11 @@
}
.medium-star-positive {
- background-image: url('public/images/star-positive-medium.png');
+ background-image: url('images/star-positive-medium.png');
}
.medium-star-negative {
- background-image: url('public/images/star-negative-medium.png');
+ background-image: url('images/star-negative-medium.png');
}
.star-hide {
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/a0b02c3df507588949a5285b98679c0883cbf160...4c6bcb89e2fba3e120848542e58d555f320a1a86
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160223/5d1ff611/attachment-0001.html>
More information about the Noosfero-dev
mailing list