#577 tidy up the library widget
Merged 6 years ago by abompard. Opened 6 years ago by ryanlerch.
ryanlerch/fedora-hubs tidy-library  into  develop

@@ -26,6 +26,12 @@ 

          )]

      is_react = True

      views_module = ".views"

+     description = {

+                    "stream": "Bookmark links for display on your stream",

+                    "user": "Bookmark links for display on your hub",

+                    "team": ("Bookmark links for display on the team's "

+                             "hub"),

+                   }

  

      def get_props(self, instance, *args, **kwargs):

          props = super(Library, self).get_props(instance, *args, **kwargs)

file modified
+18 -17
@@ -15,17 +15,31 @@ 

              alt=""

              />

          </div>

-         <div className={`media-body ${this.props.showDropdown ? "pr-3" : ""}`}>

-           { this.props.showDropdown &&

+         <div className={`media-body align-self-center`}>

+           <a

+             href={this.props.url}

+             className="d-block"

+             target="_blank"

+             >

+             {this.props.title}

+           </a>

+           <p className="mb-0 description">

+             <small>

+               {this.props.description}

+             </small>

+           </p>

+         </div>

+         { this.props.showDropdown &&

              <div

-               className="dropdown"

+               className="dropdown align-self-center"

                >

                <button

-                 className="btn btn-link text-secondary dropdown-toggle"

+                 className="btn btn-link text-secondary"

                  data-toggle="dropdown"

                  aria-haspopup="true"

                  aria-expanded="false"

                  >

+                  <i className="fa fa-cog"></i>

                </button>

                <div

                  className="dropdown-menu dropdown-menu-right"
@@ -46,19 +60,6 @@ 

                </div>

              </div>

            }

-           <a

-             href={this.props.url}

-             className="d-block"

-             target="_blank"

-             >

-             {this.props.title}

-           </a>

-           <p className="mb-0 description">

-             <small>

-               {this.props.description}

-             </small>

-           </p>

-         </div>

        </li>

      );

    }

@@ -198,16 +198,17 @@ 

                }

              </div>

              :

-             <p className="text-secondary">

-               <em>No links yet.</em>

+             <p className="text-secondary text-center">

+               <em>No items in this Library yet.</em>

              </p>

            }

            {this.props.hub.perms.config &&

              <div>

                <div className="text-center">

                  <button

-                   className="btn btn-secondary btn-sm"

+                   className="btn btn-outline-secondary btn-block btn-sm"

                    onClick={this.onAddDialogOpen}

+                   title="add new link to library"

                    >

                    Add a New Item

                  </button>

@@ -1,5 +1,5 @@ 

  .widget-library div.link-preview {

-   max-width: 25%;

+   max-width: 72px;

  }

  .widget-library img.link-preview {

    width: 100%;
@@ -11,11 +11,10 @@ 

      border-bottom: 1px solid #eee;

  }

  

- .widget-library .Link .dropdown {

-     position: absolute;

-     right: .5em;

- }

- 

  .widget-library .Link .description {

      line-height: 1;

  }

+ 

+ .widget-library .btn{

+     cursor: pointer;

Is this really necessary? I don't see where you're applying the btn class to anything but a button or a a element, and those already change the cursor to a pointer, don't they?

+ }

no initial comment

rebased onto 41d64cd

6 years ago

Is this really necessary? I don't see where you're applying the btn class to anything but a button or a a element, and those already change the cursor to a pointer, don't they?

Buttons don't by default (well it was not showing a pointer) -- that is why i am changing this here.

rebased onto 6667e2c

6 years ago

Commit 5aaac77 fixes this pull-request

Pull-Request has been merged by abompard

6 years ago

Pull-Request has been merged by abompard

6 years ago