瀏覽代碼

fix size of select2 + translated 'no results found'

Come 8 年之前
父節點
當前提交
228e7c0398
共有 2 個文件被更改,包括 11 次插入2 次删除
  1. 10 1
      tracim/tracim/public/assets/js/main.js
  2. 1 1
      tracim/tracim/templates/admin/workspace_getone.mak

+ 10 - 1
tracim/tracim/public/assets/js/main.js 查看文件

2
 
2
 
3
   // add select2 for admin/workspace/<id> for user selection
3
   // add select2 for admin/workspace/<id> for user selection
4
   if ($('#add-role-from-existing-user-form').length > 0) {
4
   if ($('#add-role-from-existing-user-form').length > 0) {
5
-    $('#user_id').select2();
5
+    $('#user_id').select2({
6
+      "language": {
7
+        "noResults": function () {
8
+          return "Aucun résultats"
9
+        }
10
+      },
11
+      escapeMarkup: function (markup) {
12
+        return markup
13
+      }
14
+    })
6
   }
15
   }
7
 })
16
 })

+ 1 - 1
tracim/tracim/templates/admin/workspace_getone.mak 查看文件

75
                                     <form role="form" method="POST" action="${tg.url('/admin/workspaces/{}/roles'.format(result.workspace.id))}">
75
                                     <form role="form" method="POST" action="${tg.url('/admin/workspaces/{}/roles'.format(result.workspace.id))}">
76
                                         <div class="form-group">
76
                                         <div class="form-group">
77
                                             <label for="user_id">${_('User')}</label>
77
                                             <label for="user_id">${_('User')}</label>
78
-                                            <select name="user_id" id="user_id" class="form-control">
78
+                                            <select name="user_id" id="user_id" class="form-control" style="width:100%">
79
                                                 % for user in fake_api.users:
79
                                                 % for user in fake_api.users:
80
                                                     % if user.id not in (user.id for user in result.workspace.members):
80
                                                     % if user.id not in (user.id for user in result.workspace.members):
81
                                                         <option value="${user.id}">${user.name}</option>
81
                                                         <option value="${user.id}">${user.name}</option>