Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure we handled properly image field #18

Open
sergeyglazyrindev opened this issue Jan 9, 2022 · 0 comments
Open

Make sure we handled properly image field #18

sergeyglazyrindev opened this issue Jan 9, 2022 · 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 Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request qa
Projects
None yet
Development

No branches or pull requests

1 participant