Index: gui/admin_portal/list_table.cxx =================================================================== --- gui/admin_portal/list_table.cxx (revision 41444) +++ gui/admin_portal/list_table.cxx (working copy) @@ -226,6 +226,9 @@ boost::ref(*progress)); } + m_table.load(m_where, "", "count(*) as total_count").next(); + const uint64_t total_count = boost::lexical_cast(m_table["total_count"]); + std::ostringstream os; if(m_data_widget.m_ordering_enabled) os << "order by priority asc "; @@ -634,19 +637,31 @@ new Wt::WBreak(p); - TrackedTable* table = new TrackedTable(p); - table->setStyleClass("report"); - table->resize(Wt::WLength(100,Wt::WLength::Percentage), 0); + Wt::WContainerWidget* c = new Wt::WContainerWidget(p); + c->setWidth(Wt::WLength(100,Wt::WLength::Percentage)); + c->setContentAlignment(Wt::AlignCenter); + TrackedTable* table = new TrackedTable(c); + table->setInline(true); + m_prev_button = new ImageButton("prev", "Previous", table->currentCell()); m_prev_button->setMargin(Wt::WLength(2, Wt::WLength::Pixel), Wt::Right); - table->currentCell()->setContentAlignment(Wt::AlignMiddle | Wt::AlignRight); - table->currentCell()->setWidth(Wt::WLength(50, Wt::WLength::Percentage)); + table->currentCell()->setWidth(Wt::WLength(1, Wt::WLength::Percentage)); + for(unsigned i = 0; i <= total_count / m_limit; i++) + { + table->nextCellOfCurrentRow()->setWidth(Wt::WLength(1, Wt::WLength::Percentage)); + Wt::WContainerWidget* page = new Wt::WContainerWidget(table->currentCell()); + if(i == m_offset / m_limit) + page->setStyleClass("page_num_selected"); + else + page->setStyleClass("page_num"); + new Wt::WText(boost::lexical_cast(i + 1), page); + } + m_next_button = new ImageButton("next", "Next", table->nextCellOfCurrentRow()); m_next_button->setMargin(Wt::WLength(2, Wt::WLength::Pixel), Wt::Left); - table->currentCell()->setContentAlignment(Wt::AlignMiddle | Wt::AlignLeft); - table->currentCell()->setWidth(Wt::WLength(50, Wt::WLength::Percentage)); + table->currentCell()->setWidth(Wt::WLength(1, Wt::WLength::Percentage)); } m_prev_button->clicked().disconnect(m_prev_button_connection); Index: gui/css/style.css =================================================================== --- gui/css/style.css (revision 41441) +++ gui/css/style.css (working copy) @@ -1116,7 +1116,7 @@ height: 210px; background-color: #aaffaa; margin: 5px; - border: 1px solid #CFCFCF; */ + border: 1px solid #CFCFCF; padding: 2px; cursor: pointer; text-align: center; @@ -1330,3 +1330,49 @@ div.headset_connected { background-image: url('/images/headset_connected.gif'); } + +div.page_num { + position: relative; + width: 27px; + height: 22px; + background-color: #909090; + color: white; +/* font-weight: bold;*/ + font-size: 14px; + margin-left: 2px; + margin-right: 2px; + border: 0px solid #444444; + border-radius: 2px; + cursor: pointer; + text-align: center; +} + +div.page_num:hover { + background-color: #bbbbbb; +} + +div.page_num_selected { + position: relative; + width: 25px; + height: 20px; + background-color: white; + color: #909090; +/* font-weight: bold; */ + font-size: 14px; + margin-left: 2px; + margin-right: 2px; + border: 1px solid #aaaaaa; + border-radius: 2px; + cursor: pointer; + text-align: center; +} + +div.page_num_selected:hover { + background-color: #bbbbbb; +} + +div.page_num span.dialpad-numeric { + font-size: 30px; + display: block; + color: white; +}