index.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <div style="padding:0 20px;">
  2. <h1>泉心泉意</h1>
  3. <div class="row">
  4. <div class="col-md-6">
  5. <div class="list-group">
  6. <a href="#" class="list-group-item active">
  7. 允许注册人数
  8. </a>
  9. <a href="#" class="list-group-item">总:{$auth.total}人</a>
  10. <a href="#" class="list-group-item">男:{$auth.man}人</a>
  11. <a href="#" class="list-group-item">女:{$auth.woman}人</a>
  12. </div>
  13. </div>
  14. <div class="col-md-6">
  15. <div class="list-group">
  16. <a href="#" class="list-group-item active">
  17. 已注册成功人数
  18. </a>
  19. <a href="#" class="list-group-item">总:{$user.total}人</a>
  20. <a href="#" class="list-group-item">男:{$user.man}人</a>
  21. <a href="#" class="list-group-item">女:{$user.woman}人</a>
  22. </div>
  23. </div>
  24. <div class="col-md-6">
  25. <div class="list-group">
  26. <a href="#" class="list-group-item active">
  27. 相恋情况
  28. </a>
  29. <a href="#" class="list-group-item">配对:{$config.select_num}人</a>
  30. <a href="#" class="list-group-item">结婚:{$config.marry_num}人</a>
  31. <a href="#" class="list-group-item">领奖:{$config.lottery_num}人</a>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <include file="public@header"/>
  37. <hook name="admin_before_head_end"/>
  38. </head>
  39. <body>
  40. </div>
  41. <script src="__STATIC__/js/admin.js"></script>
  42. <php>
  43. $lang_set=defined('LANG_SET')?LANG_SET:'';
  44. $thinkcmf_version=cmf_version();
  45. </php>
  46. <script>
  47. Wind.css('dragula');
  48. Wind.use('masonry', 'imagesloaded', 'dragula', function () {
  49. var $homeGrid = $('.home-grid').masonry({
  50. // set itemSelector so .grid-sizer is not used in layout
  51. itemSelector: '.grid-item',
  52. // use element for option
  53. columnWidth: '.grid-sizer',
  54. percentPosition: true,
  55. horizontalOrder: false,
  56. transitionDuration: 0
  57. });
  58. $homeGrid.masonry('on', 'layoutComplete', function (event, laidOutItems) {
  59. });
  60. $homeGrid.masonry();
  61. var containers = [];
  62. $('.home-grid .grid-item').each(function () {
  63. containers.push(this);
  64. });
  65. dragula(containers, {
  66. isContainer: function (el) {
  67. return false; // only elements in drake.containers will be taken into account
  68. },
  69. moves: function (el, source, handle, sibling) {
  70. return true; // elements are always draggable by default
  71. },
  72. accepts: function (el, target, source, sibling) {
  73. return true; // elements can be dropped in any of the `containers` by default
  74. },
  75. invalid: function (el, handle) {
  76. return false; // don't prevent any drags from initiating by default
  77. },
  78. direction: 'vertical', // Y axis is considered when determining where an element would be dropped
  79. copy: false, // elements are moved by default, not copied
  80. copySortSource: false, // elements in copy-source containers can be reordered
  81. revertOnSpill: false, // spilling will put the element back where it was dragged from, if this is true
  82. removeOnSpill: false, // spilling will `.remove` the element, if this is true
  83. mirrorContainer: document.body, // set the element that gets mirror elements appended
  84. ignoreInputTextSelection: true // allows users to select input text, see details below
  85. }).on('drop', function (el, target, source, sibling) {
  86. var $target = $(target);
  87. var targetClasses = $target.attr('class');
  88. var targetDataWidget = $target.data('widget');
  89. var targetDataSystem = $target.data('system');
  90. var $source = $(source);
  91. var sourceClasses = $source.attr('class');
  92. var sourceDataWidget = $source.data('widget');
  93. var sourceDataSystem = $source.data('system');
  94. $(source).append($(target).find('.dashboard-box').not('.gu-transit'));
  95. $(target).append(el);
  96. $target.attr('class', sourceClasses);
  97. $target.data('widget', sourceDataWidget);
  98. $target.data('system', sourceDataSystem);
  99. $source.attr('class', targetClasses);
  100. $source.data('widget', targetDataWidget);
  101. $source.data('system', targetDataSystem);
  102. $homeGrid.masonry();
  103. _widgetSort();
  104. }).on('shadow', function (el, container, source) {
  105. $homeGrid.masonry();
  106. });
  107. });
  108. function _widgetSort() {
  109. var widgets = [];
  110. $('.home-grid .grid-item').each(function () {
  111. var $this = $(this);
  112. widgets.push({
  113. name: $this.data('widget'),
  114. is_system: $this.data('system')
  115. });
  116. });
  117. $.ajax({
  118. url: "{:url('main/dashboardWidget')}",
  119. type: 'post',
  120. dataType: 'json',
  121. data: {widgets: widgets},
  122. success: function (data) {
  123. },
  124. error: function () {
  125. },
  126. complete: function () {
  127. }
  128. });
  129. }
  130. //获取官方通知
  131. $.getJSON("//www.thinkcmf.com/service/sms_jsonp.php?lang={$lang_set}&v={$thinkcmf_version}&callback=?",
  132. function (data) {
  133. var tpl = '<li><em class="title"></em><span class="content"></span></li>';
  134. var $notices = $("#thinkcmf-notices");
  135. $notices.empty();
  136. if (data.length > 0) {
  137. $('#thinkcmf-notices-grid').show();
  138. $.each(data, function (i, n) {
  139. var $tpl = $(tpl);
  140. $(".title", $tpl).html(n.title);
  141. $(".content", $tpl).html(n.content);
  142. $notices.append($tpl);
  143. });
  144. } else {
  145. $notices.append("<li>^_^,{:lang('NO_NOTICE')}~~</li>");
  146. }
  147. });
  148. </script>
  149. <hook name="admin_before_body_end"/>
  150. </body>
  151. </html>