Skip to content

Commit

Permalink
Changes to blog import text #244433
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinh Le authored and sammarshallou committed Jun 22, 2018
1 parent 28b21c6 commit a0735cd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
7 changes: 5 additions & 2 deletions import.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,11 @@ function toggleProgressResult() {
$stepinfo['importall'] = false;
$url = new moodle_url('/mod/oublog/import.php', array_merge($params, $stepinfo));
$conflictimport = new single_button($url, get_string('import_step2_conflicts_submit', 'oublog'));
echo $OUTPUT->confirm(get_string('import_step2_conflicts', 'oublog', count($conflicts)),
$conflictimport, $continueurl);
$cancelurl = new moodle_url($continueurl);
$cancelbutton = new single_button($cancelurl, get_string('import_step2_cancel_submit', 'oublog'));
$message = html_writer::tag('p', get_string('import_step2_conflicts', 'oublog', count($conflicts)),
['class' => 'import-conflicts-message']);
echo $OUTPUT->confirm($message, $conflictimport, $cancelbutton );
} else {
echo $OUTPUT->continue_button($continueurl);
}
Expand Down
6 changes: 3 additions & 3 deletions lang/en/oublog.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,9 @@
$string['import_step2_none'] = 'No posts selected for import.';
$string['import_step2_prog'] = 'Importing in progress';
$string['import_step2_total'] = '{$a} post(s) imported successfully';
$string['import_step2_conflicts'] = '{$a} post(s) to import were identified as conflicts with existing posts.';
$string['import_step2_conflicts_submit'] = 'Import conflicting posts';

$string['import_step2_conflicts'] = '{$a} post(s) have been imported before. If you wish to import the posts again select ‘import duplicate posts’ and another copy will be added to your blog.';
$string['import_step2_conflicts_submit'] = 'Import duplicate posts';
$string['import_step2_cancel_submit'] = 'Do not import duplicate posts';
// My Participation.
$string['contribution'] = 'Participation';
$string['contribution_all'] = 'Participation - All time';
Expand Down
4 changes: 4 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ ul.oublog-accordion li .oublog_statsview_content {
.oublog_import_step UL {
list-style: none;
}
#page-mod-oublog-import .oublog_import_step #oublog_import_result_container .modal-header {
display: none;
}
#page-mod-oublog-import .oublog_import_step p.import-conflicts-message,
#page-mod-oublog-import .oublog_import_step h3 {
font-weight: bold;
}
Expand Down
15 changes: 15 additions & 0 deletions tests/behat/importblog.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,18 @@ Feature: Test import posts function for blog
Then I should see "Post 0 Comment 1 message"
Then I should see "Post 0 comment 2"
Then I should see "Post 0 Comment 2 message"

@javascript
Scenario: Perform the import all posts again to should see confirm duplicate posts.
Given I am on "Course 1" course homepage
And I follow "student 1 blog two"
And I click on "Import" "button"
When I follow "Import blog"
Then I should see "2 post(s) imported successfully"
And I click on "Continue" "button"
And I click on "Import" "button"
When I follow "Import blog"
Then I should see "0 post(s) imported successfully"
Then I should see "2 post(s) have been imported before. If you wish to import the posts again select ‘import duplicate posts’ and another copy will be added to your blog."
And "Import duplicate posts" "button" should exist
And "Do not import duplicate posts" "button" should exist

0 comments on commit a0735cd

Please sign in to comment.