Browse Source

Multiple request artists still broken, sorry

pjc 5 years ago
parent
commit
ce43850b7f
2 changed files with 57 additions and 37 deletions
  1. 44
    29
      sections/requests/new_edit.php
  2. 13
    8
      static/functions/requests.js

+ 44
- 29
sections/requests/new_edit.php View File

128
 
128
 
129
         <!-- Category -->
129
         <!-- Category -->
130
         <tr>
130
         <tr>
131
-          <td class="label">Type</td>
131
+          <td class="label">
132
+            Category
133
+            <strong class="important_text">*</strong>
134
+          </td>
132
           <td>
135
           <td>
133
             <?php if (!empty($Disabled)) { ?>
136
             <?php if (!empty($Disabled)) { ?>
134
             <input type="hidden" name="type"
137
             <input type="hidden" name="type"
153
               value="<?= (isset($CatalogueNumber)?$CatalogueNumber:'') ?>"
156
               value="<?= (isset($CatalogueNumber)?$CatalogueNumber:'') ?>"
154
               <?= $Disabled ?>/>
157
               <?= $Disabled ?>/>
155
             <?php if (empty($Disabled)) { ?>
158
             <?php if (empty($Disabled)) { ?>
156
-            <input type="button" autofill="jav" value="Autofill"></input>
159
+            <input type="button" autofill="jav" value="Autofill" style="pointer-events: none; opacity: 0.5;"></input>
157
             <?php } ?>
160
             <?php } ?>
158
           </td>
161
           </td>
159
         </tr>
162
         </tr>
160
 
163
 
161
-        <!-- Three titles -->
164
+        <!-- Three title fields -->
162
         <tr>
165
         <tr>
163
-          <td class="label">Torrent Title</td>
166
+          <td class="label">
167
+            Torrent Title
168
+            <strong class="important_text">*</strong>
169
+          </td>
164
           <td>
170
           <td>
165
             <input type="text" id="title" name="title" size="45"
171
             <input type="text" id="title" name="title" size="45"
166
               value="<?= (!empty($Title) ? $Title : '') ?>"
172
               value="<?= (!empty($Title) ? $Title : '') ?>"
168
           </td>
174
           </td>
169
         </tr>
175
         </tr>
170
 
176
 
177
+        <!-- 2 -->
171
         <tr>
178
         <tr>
172
           <td class="label">Organism</td>
179
           <td class="label">Organism</td>
173
           <td>
180
           <td>
177
           </td>
184
           </td>
178
         </tr>
185
         </tr>
179
 
186
 
187
+        <!-- 3 -->
180
         <tr>
188
         <tr>
181
           <td class="label">Strain/Variety</td>
189
           <td class="label">Strain/Variety</td>
182
           <td>
190
           <td>
189
 
197
 
190
         <!-- Multiple artists -->
198
         <!-- Multiple artists -->
191
         <tr id="artist_tr">
199
         <tr id="artist_tr">
192
-          <td class="label">Author(s)</td>
200
+          <td class="label">
201
+            Authors(s)
202
+            <strong class="important_text">*</strong>
203
+          </td>
193
           <td id="artistfields">
204
           <td id="artistfields">
205
+            <p id="vawarning" class="hidden">
206
+              Please use the multiple artists feature rather than using "Various Artists."
207
+            </p>
194
             <?php
208
             <?php
195
-              if (!empty($ArtistForm)) {
196
-                  $First = true;
197
-                  foreach ($ArtistForm as $Artist) {
198
-                      # Cycle autocomplete?>
209
+    if (!empty($ArtistForm)) {
210
+        $First = true;
211
+        foreach ($ArtistForm as $Artist) {
212
+            ?>
199
             <input type="text" id="artist_0" name="artists[]" <?php Users::has_autocomplete_enabled('other'); ?>
213
             <input type="text" id="artist_0" name="artists[]" <?php Users::has_autocomplete_enabled('other'); ?>
200
-            size="45" value="<?= display_str($Artist['name']) ?>" <?= $Disabled ?>/>
201
-            <?php
202
-              if (empty($Disabled)) {
203
-                  if ($First) { ?>
204
-            <a class="add_artist_button brackets">+</a>
205
-            <a class="remove_artist_button brackets">&minus;</a>
206
-            <?php
207
-                }
208
-                  $First = false;
209
-              } ?>
214
+            size="45" value="<?=display_str($Artist['name']) ?>" <?=$Disabled?>/>
215
+            <?php if (empty($Disabled)) {
216
+                if ($First) { ?><a class="add_artist_button brackets">+</a> <a
217
+              class="remove_artist_button brackets">&minus;</a><?php }
218
+                $First = false;
219
+            } ?>
210
             <br />
220
             <br />
211
             <?php
221
             <?php
212
-                  }
213
-              } else {
214
-                  ?>
215
-            <input type="text" id="artist_0" name="artists[]" <?php Users::has_autocomplete_enabled('other'); ?>
216
-            size="45" <?= $Disabled ?>/>
222
+        }
223
+    } else {
224
+        ?> <input type="text" id="artist_0" name="artists[]" <?php Users::has_autocomplete_enabled('other'); ?>
225
+            size="45" <?=$Disabled?>/>
217
             <?php if (empty($Disabled)) { ?>
226
             <?php if (empty($Disabled)) { ?>
218
             <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
227
             <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
228
+            <?php } ?>
219
             <?php
229
             <?php
220
-                }
221
-              }
222
-            ?>
230
+    }
231
+?>
223
           </td>
232
           </td>
224
         </tr>
233
         </tr>
225
 
234
 
237
 
246
 
238
         <!-- Tags -->
247
         <!-- Tags -->
239
         <tr>
248
         <tr>
240
-          <td class="label">Tags</td>
249
+          <td class="label">
250
+            Tags
251
+            <strong class="important_text">*</strong>
252
+          </td>
241
           <td>
253
           <td>
242
             <?php
254
             <?php
243
               $GenreTags = $Cache->get_value('genre_tags');
255
               $GenreTags = $Cache->get_value('genre_tags');
273
 
285
 
274
         <!-- Description -->
286
         <!-- Description -->
275
         <tr>
287
         <tr>
276
-          <td class="label">Description</td>
288
+          <td class="label">
289
+            Request Description
290
+            <strong class="important_text">*</strong>
291
+          </td>
277
           <td>
292
           <td>
278
             <?php new TEXTAREA_PREVIEW('description', 'req_desc', $Request['Description']??''); ?>
293
             <?php new TEXTAREA_PREVIEW('description', 'req_desc', $Request['Description']??''); ?>
279
           </td>
294
           </td>

+ 13
- 8
static/functions/requests.js View File

80
   }
80
   }
81
 }
81
 }
82
 
82
 
83
+var ArtistCount = 1;
84
+
83
 function AddArtistField() {
85
 function AddArtistField() {
84
-  var ArtistCount = document.getElementsByName("artists[]").length;
86
+  window.getSelection().removeAllRanges()
87
+  ArtistCount = $('input[name="artists[]"]').length;
88
+
85
   if (ArtistCount >= 200) {
89
   if (ArtistCount >= 200) {
86
     return;
90
     return;
87
   }
91
   }
88
   var ArtistField = document.createElement("input");
92
   var ArtistField = document.createElement("input");
89
   ArtistField.type = "text";
93
   ArtistField.type = "text";
90
-  ArtistField.id = "artist_" + ArtistCount;
94
+  ArtistField.id = "artists_" + ArtistCount;
91
   ArtistField.name = "artists[]";
95
   ArtistField.name = "artists[]";
92
   ArtistField.size = 45;
96
   ArtistField.size = 45;
93
 
97
 
94
   var x = $('#artistfields').raw();
98
   var x = $('#artistfields').raw();
95
   x.appendChild(document.createElement("br"));
99
   x.appendChild(document.createElement("br"));
96
   x.appendChild(ArtistField);
100
   x.appendChild(ArtistField);
101
+  x.appendChild(document.createTextNode('\n'));
97
 
102
 
98
-  if ($("#artist_0").data("gazelle-autocomplete")) {
103
+  if ($("#artists_0").data("gazelle-autocomplete")) {
99
     $(ArtistField).on('focus', function () {
104
     $(ArtistField).on('focus', function () {
100
       $(ArtistField).autocomplete({
105
       $(ArtistField).autocomplete({
101
         deferRequestBy: 300,
106
         deferRequestBy: 300,
108
 }
113
 }
109
 
114
 
110
 function RemoveArtistField() {
115
 function RemoveArtistField() {
111
-  var ArtistCount = document.getElementsByName("artists[]").length;
116
+  window.getSelection().removeAllRanges()
117
+  ArtistCount = $('input[name="artists[]"]').length;
112
   if (ArtistCount == 1) {
118
   if (ArtistCount == 1) {
113
     return;
119
     return;
114
   }
120
   }
115
   var x = $('#artistfields').raw();
121
   var x = $('#artistfields').raw();
116
-
117
-  while (x.lastChild.tagName != "INPUT") {
122
+  for (i = 0; i < 3; i++) {
118
     x.removeChild(x.lastChild);
123
     x.removeChild(x.lastChild);
119
   }
124
   }
120
-  x.removeChild(x.lastChild);
121
-  x.removeChild(x.lastChild); //Remove trailing new line.
122
   ArtistCount--;
125
   ArtistCount--;
123
 }
126
 }
124
 
127
 
125
 function Categories() {
128
 function Categories() {
129
+  /*
126
   var cat = $('#categories').raw() ? $('#categories').raw().options[$('#categories').raw().selectedIndex].value : '';
130
   var cat = $('#categories').raw() ? $('#categories').raw().options[$('#categories').raw().selectedIndex].value : '';
127
   if (cat == "Movies") {
131
   if (cat == "Movies") {
128
     $('#artist_tr').gshow();
132
     $('#artist_tr').gshow();
149
     $('#cataloguenumber_tr').ghide();
153
     $('#cataloguenumber_tr').ghide();
150
     $('#dlsiteid_tr').ghide();
154
     $('#dlsiteid_tr').ghide();
151
   }
155
   }
156
+  */
152
 }
157
 }
153
 
158
 
154
 function add_tag() {
159
 function add_tag() {

Loading…
Cancel
Save