本文整理汇总了C++中Assets_View::add_iteration方法的典型用法代码示例。如果您正苦于以下问题:C++ Assets_View::add_iteration方法的具体用法?C++ Assets_View::add_iteration怎么用?C++ Assets_View::add_iteration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets_View
的用法示例。
在下文中一共展示了Assets_View::add_iteration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changes_changes
//.........这里部分代码省略.........
vector <int> ids = database_modifications.getNotificationTeamIdentifiers (username, user, true);
for (auto id : ids) {
trash_change_notification (request, id);
database_modifications.deleteNotification (id);
#ifdef HAVE_CLIENT
request->database_config_user ()->addRemovedChange (id);
#endif
request->database_config_user ()->setChangeNotificationsChecksum ("");
}
}
// Read the identifiers.
// Limit the number of results to keep the page reasonably fast even if there are many notifications.
vector <int> personal_ids = database_modifications.getNotificationPersonalIdentifiers (username, changes_personal_category (), true);
vector <int> bible_ids = database_modifications.getNotificationTeamIdentifiers (username, changes_bible_category (), true);
vector <int> ids = database_modifications.getNotificationIdentifiers (username, true);
string textblock;
for (auto id : ids) {
Passage passage = database_modifications.getNotificationPassage (id);
string link = filter_passage_link_for_opening_editor_at (passage.book, passage.chapter, passage.verse);
string category = database_modifications.getNotificationCategory (id);
if (category == changes_personal_category ()) category = emoji_smiling_face_with_smiling_eyes ();
if (category == changes_bible_category ()) category = emoji_open_book ();
string modification = database_modifications.getNotificationModification (id);
textblock.append ("<div id=\"entry" + convert_to_string (id) + "\">\n");
textblock.append ("<a href=\"expand\" id=\"expand" + convert_to_string (id) + "\">" + emoji_file_folder () + "</a>\n");
textblock.append ("<a href=\"remove\" id=\"remove" + convert_to_string (id) + "\">" + emoji_wastebasket () + "</a>\n");
textblock.append (link + "\n");
textblock.append (category + "\n");
textblock.append (modification + "\n");
textblock.append ("</div>\n");
}
view.set_variable ("textblock", textblock);
string loading = "\"" + translate("Loading ...") + "\"";
string script = "var loading = " + loading + ";";
config_logic_swipe_enabled (webserver_request, script);
view.set_variable ("script", script);
// Enable links to dismiss categories of notifications depending on whether there's anything to dismiss.
if (!personal_ids.empty ()) view.enable_zone ("personal");
if (!bible_ids.empty ()) view.enable_zone ("bible");
// Add links to clear the notifications from the individual contributors.
string dismissblock;
vector <string> categories = database_modifications.getCategories ();
for (auto & category : categories) {
if (category == changes_personal_category ()) continue;
if (category == changes_bible_category ()) continue;
string user = category;
vector <int> ids = database_modifications.getNotificationTeamIdentifiers (username, user, true);
if (!ids.empty ()) {
dismissblock.append ("<p>* <a href=\"?dismiss=");
dismissblock.append (user);
dismissblock.append ("\">");
dismissblock.append (user);
dismissblock.append (": ");
dismissblock.append (translate("all of them"));
dismissblock.append (": ");
dismissblock.append (convert_to_string (ids.size ()));
dismissblock.append ("</a></p>\n");
}
}
view.set_variable ("dismissblock", dismissblock);
// Add links to clear matching notifications of the various users.
for (auto & category : categories) {
if (category == changes_bible_category ()) continue;
string user = category;
vector <int> personal_ids = database_modifications.getNotificationTeamIdentifiers (username, user, true);
string icon = category;
if (category == changes_personal_category ()) icon = emoji_smiling_face_with_smiling_eyes ();
if (!personal_ids.empty () && !bible_ids.empty ()) {
view.add_iteration ("matching", { make_pair ("user", user), make_pair ("icon", icon) } );
}
}
view.set_variable ("VERSION", config_logic_version ());
if (touch) view.enable_zone ("touch");
view.set_variable ("interlinks", changes_interlinks (webserver_request, changes_changes_url ()));
page += view.render ("changes", "changes");
page += Assets_Page::footer ();
return page;
}