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,7 +128,10 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
128 128
 
129 129
         <!-- Category -->
130 130
         <tr>
131
-          <td class="label">Type</td>
131
+          <td class="label">
132
+            Category
133
+            <strong class="important_text">*</strong>
134
+          </td>
132 135
           <td>
133 136
             <?php if (!empty($Disabled)) { ?>
134 137
             <input type="hidden" name="type"
@@ -153,14 +156,17 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
153 156
               value="<?= (isset($CatalogueNumber)?$CatalogueNumber:'') ?>"
154 157
               <?= $Disabled ?>/>
155 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 160
             <?php } ?>
158 161
           </td>
159 162
         </tr>
160 163
 
161
-        <!-- Three titles -->
164
+        <!-- Three title fields -->
162 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 170
           <td>
165 171
             <input type="text" id="title" name="title" size="45"
166 172
               value="<?= (!empty($Title) ? $Title : '') ?>"
@@ -168,6 +174,7 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
168 174
           </td>
169 175
         </tr>
170 176
 
177
+        <!-- 2 -->
171 178
         <tr>
172 179
           <td class="label">Organism</td>
173 180
           <td>
@@ -177,6 +184,7 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
177 184
           </td>
178 185
         </tr>
179 186
 
187
+        <!-- 3 -->
180 188
         <tr>
181 189
           <td class="label">Strain/Variety</td>
182 190
           <td>
@@ -189,37 +197,38 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
189 197
 
190 198
         <!-- Multiple artists -->
191 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 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 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 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 220
             <br />
211 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 226
             <?php if (empty($Disabled)) { ?>
218 227
             <a class="add_artist_button brackets">+</a> <a class="remove_artist_button brackets">&minus;</a>
228
+            <?php } ?>
219 229
             <?php
220
-                }
221
-              }
222
-            ?>
230
+    }
231
+?>
223 232
           </td>
224 233
         </tr>
225 234
 
@@ -237,7 +246,10 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
237 246
 
238 247
         <!-- Tags -->
239 248
         <tr>
240
-          <td class="label">Tags</td>
249
+          <td class="label">
250
+            Tags
251
+            <strong class="important_text">*</strong>
252
+          </td>
241 253
           <td>
242 254
             <?php
243 255
               $GenreTags = $Cache->get_value('genre_tags');
@@ -273,7 +285,10 @@ View::show_header(($NewRequest ? 'Create Request' : 'Edit Request'), 'bbcode,req
273 285
 
274 286
         <!-- Description -->
275 287
         <tr>
276
-          <td class="label">Description</td>
288
+          <td class="label">
289
+            Request Description
290
+            <strong class="important_text">*</strong>
291
+          </td>
277 292
           <td>
278 293
             <?php new TEXTAREA_PREVIEW('description', 'req_desc', $Request['Description']??''); ?>
279 294
           </td>

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

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

Loading…
Cancel
Save