index.html 5.8 KB

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