|
168 | 168 | <script src="~/Scripts/editfieldvalues.js"></script>; |
169 | 169 | <hr /> |
170 | 170 |
|
171 | | - @if (Model.SupportsMassAdding) |
172 | | - { |
173 | | - <div> |
174 | | - <a href="@Url.Action("CreateValue", new { Model.ProjectId, Model.ProjectFieldId })" |
175 | | - class="btn btn-default"><i class="glyphicon glyphicon-plus"></i>Добавить значение</a> |
176 | | - <button class="btn btn-default" data-toggle="modal" data-target="#massAddValueModal">Добавить несколько значений</button> |
| 171 | + <div> |
| 172 | + <a href="@Url.Action("CreateValue", new { Model.ProjectId, Model.ProjectFieldId })" |
| 173 | + class="btn btn-default"><i class="glyphicon glyphicon-plus"></i>Добавить значение</a> |
| 174 | + @if (Model.SupportsMassAdding) |
| 175 | + { |
| 176 | + <button class="btn btn-default" data-toggle="modal" data-target="#massAddValueModal">Добавить несколько значений</button> |
| 177 | + } |
| 178 | + </div> |
| 179 | + <partial name="ValuesList" for="@Model.DropdownValues" /> |
| 180 | + |
| 181 | + <!-- Value deletion dialog --> |
| 182 | + <div id="dlgDeleteValue" class="modal" tabindex="-1" role="dialog"> |
| 183 | + <div class="modal-dialog"> |
| 184 | + <div class="modal-content"> |
| 185 | + <div class="modal-header"> |
| 186 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 187 | + <h4 class="modal-title">Удалить значение?</h4> |
| 188 | + </div> |
| 189 | + |
| 190 | + <div class="modal-body"> |
| 191 | + <div class="join alert alert-warning"> |
| 192 | + <i class="glyphicon glyphicon-question-sign"></i> |
| 193 | + <div>Удалить значение «<span id="valueToDeleteTitle"></span>»?</div> |
| 194 | + </div> |
| 195 | + <div class="join alert alert-info">Если значение использовалось хотя бы один раз, его можно будет восстановить</div> |
| 196 | + </div> |
| 197 | + |
| 198 | + <div class="modal-footer"> |
| 199 | + <button id="bnStartDelete" type="button" class="btn btn-danger">Удалить</button> |
| 200 | + <button id="bnCancelDelete" type="button" class="btn btn-default" data-dismiss="modal">Отмена</button> |
| 201 | + </div> |
| 202 | + </div> |
177 | 203 | </div> |
178 | | - } |
179 | | - <partial name="ValuesList" for="@Model.DropdownValues" /> |
180 | | -} |
| 204 | + </div> |
| 205 | + |
| 206 | + <!-- Deletion progress dialog --> |
| 207 | + <div id="dlgDeleteProgress" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false"> |
| 208 | + <div class="modal-dialog"> |
| 209 | + <div class="modal-content"> |
| 210 | + <div id="dlgDeleteProgressText" class="modal-body alert alert-info" style="margin: 0;">Удаляем...</div> |
| 211 | + </div> |
| 212 | + </div> |
| 213 | + </div> |
181 | 214 |
|
182 | | -<!-- Deletion dialog --> |
183 | | -<div id="dlgDeleteValue" class="modal" tabindex="-1" role="dialog"> |
184 | | - <div class="modal-dialog"> |
| 215 | + <!-- Mass addition dialog --> |
| 216 | + @if (Model.SupportsMassAdding) |
| 217 | + { |
| 218 | + <div class="modal fade" id="massAddValueModal" tabindex="-1" role="dialog"> |
| 219 | + <div class="modal-dialog"> |
185 | 220 | <div class="modal-content"> |
| 221 | + <form asp-controller="GameField" asp-action="MassCreateValueVariants" asp-route-projectId="@Model.ProjectId" method="post"> |
| 222 | + @Html.HiddenFor(model => model.ProjectFieldId) |
186 | 223 | <div class="modal-header"> |
187 | | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
188 | | - <h4 class="modal-title">Удалить значение?</h4> |
| 224 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 225 | + <h4 class="modal-title">Добавить значения</h4> |
189 | 226 | </div> |
190 | 227 |
|
191 | 228 | <div class="modal-body"> |
192 | | - <div class="join alert alert-warning"> |
193 | | - <i class="glyphicon glyphicon-question-sign"></i> |
194 | | - <div>Удалить значение «<span id="valueToDeleteTitle"></span>»?</div> |
| 229 | + <div class="form-horizontal"> |
| 230 | + <div class="form-group"> |
| 231 | + <div class="col-md-10"> |
| 232 | + <textarea type="text" required id="valuesToAdd" name="valuesToAdd" rows="4" class="form-control"></textarea> |
| 233 | + <div class="help-block">Введите сюда значения, которые хотите добавить этому полю. <br/> Одна строчка — одно значение</div> |
| 234 | + </div> |
195 | 235 | </div> |
196 | | - <div class="join alert alert-info">Если значение использовалось хотя бы один раз, его можно будет восстановить</div> |
| 236 | + </div> |
197 | 237 | </div> |
198 | 238 |
|
199 | 239 | <div class="modal-footer"> |
200 | | - <button id="bnStartDelete" type="button" class="btn btn-danger">Удалить</button> |
201 | | - <button id="bnCancelDelete" type="button" class="btn btn-default" data-dismiss="modal">Отмена</button> |
202 | | - </div> |
203 | | - </div> |
204 | | - </div> |
205 | | -</div> |
| 240 | + <button type="submit" class="btn btn-success">Добавить</button> |
| 241 | + <button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button> |
206 | 242 |
|
207 | | -<!-- Deletion progress dialog --> |
208 | | -<div id="dlgDeleteProgress" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false"> |
209 | | - <div class="modal-dialog"> |
210 | | - <div class="modal-content"> |
211 | | - <div id="dlgDeleteProgressText" class="modal-body alert alert-info" style="margin: 0;">Удаляем...</div> |
212 | | - </div> |
| 243 | + </div> |
| 244 | + </form> |
| 245 | + </div><!-- /.modal-content --> |
| 246 | + </div><!-- /.modal-dialog --> |
213 | 247 | </div> |
214 | | -</div> |
215 | | - |
216 | | -<!-- Mass addition dialog --> |
217 | | -<div class="modal fade" id="massAddValueModal" tabindex="-1" role="dialog"> |
218 | | - <div class="modal-dialog"> |
219 | | - <div class="modal-content"> |
220 | | - <form asp-controller="GameField" asp-action="MassCreateValueVariants" asp-route-projectId="@Model.ProjectId" method="post"> |
221 | | - @Html.HiddenFor(model => model.ProjectFieldId) |
222 | | - <div class="modal-header"> |
223 | | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
224 | | - <h4 class="modal-title">Добавить значения</h4> |
225 | | - </div> |
226 | | - |
227 | | - <div class="modal-body"> |
228 | | - <div class="form-horizontal"> |
229 | | - <div class="form-group"> |
230 | | - <div class="col-md-10"> |
231 | | - <textarea type="text" required id="valuesToAdd" name="valuesToAdd" rows="4" class="form-control"></textarea> |
232 | | - <div class="help-block">Введите сюда значения, которые хотите добавить этому полю. <br /> Одна строчка — одно значение</div> |
233 | | - </div> |
234 | | - </div> |
235 | | - </div> |
236 | | - </div> |
237 | | - |
238 | | - <div class="modal-footer"> |
239 | | - <button type="submit" class="btn btn-success">Добавить</button> |
240 | | - <button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button> |
| 248 | + } |
| 249 | +} |
241 | 250 |
|
242 | | - </div> |
243 | | - </form> |
244 | | - </div><!-- /.modal-content --> |
245 | | - </div><!-- /.modal-dialog --> |
246 | | -</div> |
|
0 commit comments