From b8899e350326af3e53dfad89747761c1c13a3915 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 14 Sep 2021 11:06:51 +0900 Subject: Learn 以下の文書内のリンクURLを正規化 (#2356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /en-US へのリンクを /ja へのリンクに修正 - /ja が付いていないものに /ja を付加 - MDN内のリンクが完全URLの場合、 /ja/docs からのURLに修正 --- .../displaying_data/author_detail_page/index.html | 4 ++-- .../displaying_data/author_list_page/index.html | 8 ++++---- .../displaying_data/book_detail_page/index.html | 4 ++-- .../displaying_data/book_list_page/index.html | 6 +++--- .../bookinstance_detail_page_and_challenge/index.html | 2 +- .../displaying_data/bookinstance_list_page/index.html | 4 ++-- .../date_formatting_using_moment/index.html | 4 ++-- .../flow_control_using_async/index.html | 4 ++-- .../displaying_data/genre_detail_page/index.html | 6 +++--- .../displaying_data/home_page/index.html | 8 ++++---- .../express_nodejs/displaying_data/index.html | 18 +++++++++--------- .../locallibrary_base_template/index.html | 6 +++--- .../displaying_data/template_primer/index.html | 8 ++++---- 13 files changed, 41 insertions(+), 41 deletions(-) (limited to 'files/ja/learn/server-side/express_nodejs/displaying_data') diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/author_detail_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/author_detail_page/index.html index 5c4acc7193..6598ed7e3d 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/author_detail_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/author_detail_page/index.html @@ -84,6 +84,6 @@ block content

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/author_list_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/author_list_page/index.html index f738902bfb..363c25ea64 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/author_list_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/author_list_page/index.html @@ -53,12 +53,12 @@ block content

Author List Page - Express Local Library site

-

Note: The appearance of the author lifespan dates is ugly! You can improve this using the same approach as we used for the BookInstance list (adding the virtual property for the lifespan to the Author model). This time, however, there are missing dates, and references to nonexistent properties are ignored unless strict mode is in effect. moment() returns the current time, and you don't want missing dates to be formatted as if they were today. One way to deal with this is to define the body of the function that returns a formatted date so it returns a blank string unless the date actually exists. For example:

+

Note: The appearance of the author lifespan dates is ugly! You can improve this using the same approach as we used for the BookInstance list (adding the virtual property for the lifespan to the Author model). This time, however, there are missing dates, and references to nonexistent properties are ignored unless strict mode is in effect. moment() returns the current time, and you don't want missing dates to be formatted as if they were today. One way to deal with this is to define the body of the function that returns a formatted date so it returns a blank string unless the date actually exists. For example:

return this.date_of_birth ? moment(this.date_of_birth).format('YYYY-MM-DD') : '';

-

Genre list page—challenge!Edit

+

Genre list page—challenge!Edit

In this section you should implement your own genre list page. The page should display a list of all genres in the database, with each genre linked to its associated detail page. A screenshot of the expected result is shown below.

@@ -80,6 +80,6 @@ block content

Next steps

-

Return to Express Tutorial Part 5: Displaying library data.

+

Return to Express Tutorial Part 5: Displaying library data.

-

Proceed to the next subarticle of part 5: Genre detail page.

+

Proceed to the next subarticle of part 5: Genre detail page.

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/book_detail_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/book_detail_page/index.html index f2080e6109..0655111870 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/book_detail_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/book_detail_page/index.html @@ -107,6 +107,6 @@ block content

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html index 4dfc9c5a5e..ec3737a832 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html @@ -56,13 +56,13 @@ block content

What does it look like?

-

Run the application (see Testing the routes for the relevant commands) and open your browser to http://localhost:3000/. Then select the All books link. If everything is set up correctly, your site should look something like the following screenshot.

+

Run the application (see Testing the routes for the relevant commands) and open your browser to http://localhost:3000/. Then select the All books link. If everything is set up correctly, your site should look something like the following screenshot.

Book List Page - Express Local Library site

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_detail_page_and_challenge/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_detail_page_and_challenge/index.html index 3c6cace6a5..6ec61cb4ea 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_detail_page_and_challenge/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_detail_page_and_challenge/index.html @@ -87,5 +87,5 @@ block content

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_list_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_list_page/index.html index 9bc7ee305f..f196628b07 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_list_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/bookinstance_list_page/index.html @@ -64,6 +64,6 @@ block content

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/date_formatting_using_moment/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/date_formatting_using_moment/index.html index 58851991b5..be96007add 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/date_formatting_using_moment/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/date_formatting_using_moment/index.html @@ -53,8 +53,8 @@ translation_of: Learn/Server-side/Express_Nodejs/Displaying_data/Date_formatting

Next steps

 

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/flow_control_using_async/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/flow_control_using_async/index.html index 0639f79bc3..807f896ed5 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/flow_control_using_async/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/flow_control_using_async/index.html @@ -132,6 +132,6 @@ translation_of: Learn/Server-side/Express_Nodejs/Displaying_data/flow_control_us

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html index 40770c5ef2..2edc3229bc 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html @@ -57,7 +57,7 @@ exports.genre_detail = function(req, res, next) { } -

The message will then propagate through to our error handling code (this was set up when we generated the app skeleton - for more information see Handling Errors).

+

The message will then propagate through to our error handling code (this was set up when we generated the app skeleton - for more information see Handling Errors).

The rendered view is genre_detail and it is passed variables for the title, genre and the list of books in this genre (genre_books).

@@ -116,6 +116,6 @@ block content

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/home_page/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/home_page/index.html index 3e2f337370..74a74b3109 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/home_page/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/home_page/index.html @@ -9,7 +9,7 @@ translation_of: Learn/Server-side/Express_Nodejs/Displaying_data/Home_page

Route

-

We created our index page routes in a previous tutorial. As a reminder, all the route functions are defined in /routes/catalog.js:

+

We created our index page routes in a previous tutorial. As a reminder, all the route functions are defined in /routes/catalog.js:

// GET catalog home page.
 router.get('/', book_controller.index);  //This actually maps to /catalog/ because we import the route with a /catalog prefix
@@ -27,7 +27,7 @@ router.get('/', book_controller.index); //This actually maps to /catalog/ becau

The index controller function needs to fetch information about how many Book, BookInstance, available BookInstance, Author, and Genre records we have in the database, render this data in a template to create an HTML page, and then return it in an HTTP response.

-

Note: We use the countDocuments() method to get the number of instances of each model. This is called on a model with an optional set of conditions to match against in the first argument and a callback in the second argument (as discussed in Using a Database (with Mongoose), and you can also return a Query and then execute it with a callback later. The callback will be returned when the database returns the count, with an error value (or null) as the first parameter and the count of records (or null if there was an error) as the second parameter.

+

Note: We use the countDocuments() method to get the number of instances of each model. This is called on a model with an optional set of conditions to match against in the first argument and a callback in the second argument (as discussed in Using a Database (with Mongoose), and you can also return a Query and then execute it with a callback later. The callback will be returned when the database returns the count, with an error value (or null) as the first parameter and the count of records (or null if there was an error) as the second parameter.

SomeModel.countDocuments({ a_model_field: 'match_value' }, function (err, count) {
  // ... do something if there is an err
@@ -128,6 +128,6 @@ block content
 

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/index.html index 5726b6c0e1..3877cc76f3 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/index.html @@ -80,13 +80,13 @@ translation_of: Learn/Server-side/Express_Nodejs/Displaying_data

このモジュール

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html index a97c536eb2..91d52ad66f 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html @@ -49,7 +49,7 @@ html(lang='en')

The template uses (and includes) JavaScript and CSS from Bootstrap to improve the layout and presentation of the HTML page. Using Bootstrap or another client-side web framework is a quick way to create an attractive page that can scale well on different browser sizes, and it also allows us to deal with the page presentation without having to get into any of the details—we just want to focus on the server-side code here!

-

The layout should be fairly obvious if you've read our above Template primer. Note the use of block content as a placeholder for where the content for our individual pages will be placed.

+

The layout should be fairly obvious if you've read our above Template primer. Note the use of block content as a placeholder for where the content for our individual pages will be placed.

The base template also references a local css file (style.css) that provides a little additional styling. Open /public/stylesheets/style.css and replace its content with the following CSS code:

@@ -64,6 +64,6 @@ html(lang='en')

Next steps

diff --git a/files/ja/learn/server-side/express_nodejs/displaying_data/template_primer/index.html b/files/ja/learn/server-side/express_nodejs/displaying_data/template_primer/index.html index a68921a6a7..f8029cb236 100644 --- a/files/ja/learn/server-side/express_nodejs/displaying_data/template_primer/index.html +++ b/files/ja/learn/server-side/express_nodejs/displaying_data/template_primer/index.html @@ -17,7 +17,7 @@ translation_of: Learn/Server-side/Express_Nodejs/Displaying_data/Template_primer

Template configuration

-

The LocalLibrary was configured to use Pug when we created the skeleton website. You should see the pug module included as a dependency in the website's package.json file, and the following configuration settings in the app.js file. The settings tell us that we're using pug as the view engine, and that Express should search for templates in the /views subdirectory.

+

The LocalLibrary was configured to use Pug when we created the skeleton website. You should see the pug module included as a dependency in the website's package.json file, and the following configuration settings in the app.js file. The settings tell us that we're using pug as the view engine, and that Express should search for templates in the /views subdirectory.

// View engine setup.
 app.set('views', path.join(__dirname, 'views'));
@@ -121,7 +121,7 @@ else
 
 

Across a site, it is usual for all pages to have a common structure, including standard HTML markup for the head, footer, navigation, etc. Rather than forcing developers to duplicate this "boilerplate" in every page, Pug allows you to declare a base template and then extend it, replacing just the bits that are different for each specific page.

-

For example, the base template layout.pug created in our skeleton project looks like this:

+

For example, the base template layout.pug created in our skeleton project looks like this:

doctype html
 html
@@ -144,6 +144,6 @@ block content
 

Next steps

-- cgit v1.2.3-54-g00ecf