Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Make sure we handled properly image field #18

Open
sergeyglazyrindev opened this issue Sep 13, 2021 · 0 comments
Open

Make sure we handled properly image field #18

sergeyglazyrindev opened this issue Sep 13, 2021 · 0 comments
Labels
enhancement New feature or request qa

Comments

@sergeyglazyrindev
Copy link
Owner

We should compare to how we handled image field in our current implementation with a previous one:

image, file

                    <label class="col-sm-12 control-label form_label visible-xs" data-toggle="tooltip" data-placement="bottom" title="{{ .Help }}"><span class="camelcaseFix">{{.DisplayName}}</span>{{ if eq .Help "" }}{{ else }}<span class="text-muted" style="font-size:12px;"> <i class="fa fa-question-circle"></i>{{end}}:{{ if .Required }}<span style="color:#f00;font-weight:bold;">&nbsp;*</span>{{ end }}</label>
                    <div class="col-sm-12">
                      <table class="" style="width: 100%;">
                        <tr>
                          <td style="padding-right:10px;">
                            <div class="input-group search">
                              {{if and (eq .ApprovalAction 0) (ne .ChangedBy "")}}
                              <div class="input-group-addon" style="font-family:monospace;overflow:hidden;max-width:200px;text-overflow:ellipsis;" title="{{.ChangedBy}} {{.ChangeDate.Format "2006-01-02 15:04"}}">
                                <a href="{{$RootURL}}approval/{{.ApprovalID}}" style="text-decoration:none;"><i class="fa fa-exclamation-triangle" style="color:#ffc028"></i> {{.NewValue}}</a>
                              </div>
                              {{else if eq .ApprovalAction 1}}
                              <div class="input-group-addon" style="font-family:monospace;" title="{{.ApprovalBy}} {{.ApprovalDate.Format "2006-01-02 15:04"}}">
                                <i class="fa fa-check" style="color:lime"></i>
                              </div>
                              {{else if eq .ApprovalAction 2}}
                              <div class="input-group-addon" style="font-family:monospace;" title="{{.ApprovalBy}} {{.ApprovalDate.Format "2006-01-02 15:04"}}">
                                <i class="fa fa-times" style="color:red"></i>
                              </div>
                              {{end}}
                              <label class="input-group-btn">
                                <span class="btn btn-primary">
                                  Browse&hellip; <input {{ if and .Required (eq .Value "") }} required {{ end }} name="{{.Name}}" type="file" style="display: none;">
                                </span>
                              </label>
                              <input {{ if and .Required (eq .Value "")}} required {{ end }} type="text" class="form-control" readonly id="{{.Name}}-filename">
                              {{if .WebCam}}<div class="input-group-btn">
                                <button type="button" class="btn btn-info open-web-cam" data-toggle="modal" data-target="#webCam" target-field="{{.Name}}"><i class="fa fa-camera"></i></button>
                              </div>{{end}}
                            </div>
                            {{ if eq .Help "" }}{{ else }}<span class="text-muted" style="font-size:12px;"><i class="fa fa-question-circle"></i> {{.Help}}</span>{{ end }}
                            {{if ne "" (.ErrMsg)}}<span class="text-muted" style="font-size:12px; color:red;"><i class="fa fa-question-circle"></i> {{.ErrMsg}}</span>{{ end }}
                            <!-- <input class="pull-right btn btn-default btn-file" name="{{.Name}}" type="file" accept=".png, .jpg, .jpeg"> -->
                          </td>
                          <td style="width: 50%;">
                            {{ if ne .Value "" }}
                            <button class="btn btn-danger pull-right delete-file-btn" id="{{.Name}}-delete-btn" title="{{Tf "uadmin/system" $langCode "Delete File"}}">
                              <i class="fa fa-trash-alt"></i>
                            </button>
                            {{end}}
                            {{if eq $type "file"}}
                            <a href="{{.Value}}" target="_blank">{{.Value}}</a>
                            {{else}}
                            <img class="search pull-left image_trigger pointer" style="max-width: 100px; height:auto;padding-right:0px;" src={{.Value}}>
                            {{end}}
                          </td>
                        </tr>
                      </table>
                    </div>
                  </td>

                  
@sergeyglazyrindev sergeyglazyrindev added enhancement New feature or request qa labels Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request qa
Projects
None yet
Development

No branches or pull requests

1 participant